companion-module-requests icon indicating copy to clipboard operation
companion-module-requests copied to clipboard

Support for AVMATRIX PVS0403U

Open jcoutch opened this issue 3 years ago • 17 comments

As a user, it would be nice to control the AVMATRIX PVS0403U from Companion.

Ideally, it would be nice if the majority of the functionality could be controlled, but at a bare minimum, if Program/Preview input switching, as well as the cut/auto button worked, that'd be great.

I was able to get a packet capture from the device, mapped out the messages for various buttons, and created a datasheet. Hopefully this helps speed up development.

Some of the commands require knowledge of the previous states, which could be ascertained using the "get current state" command, and/or by listening to messages being sent back from the console as it's used.

Also, this may resolve #327 if the packets are reasonably the same.

jcoutch avatar Oct 14 '22 05:10 jcoutch

Update - AVMATRIX sent me the actual API datasheet...which has a lot more detail than mine does: PVS0403U-API V3.1.pdf

jcoutch avatar Oct 17 '22 18:10 jcoutch

jcoutch, did you ever get this to work on that AVMatrix switcher? I have the same model and can't figure out that confusing API doc from the company. I emailed them and they never replied. I'd love to be able to integrate this switcher. I was able to integrate a switcher from Feelworld and it works great. Thanks!

Jumpcutjeff avatar Jul 21 '23 17:07 Jumpcutjeff

jcoutch, did you ever get this to work on that AVMatrix switcher? I have the same model and can't figure out that confusing API doc from the company.

It doesn't seem too bad @Jumpcutjeff , but I don't have the switcher to test it against.

Have you tried sending some of their example commands?

If you look at their example for "Set PIP1 Source to color bar": 5A 0E 00 00 00 00 05 24 01 00 00 25 B7 DD

Which breaks down as:

5A - Header
0E 00 - Length (little endian)
00 - Device type
00 - Device ID
00 - Reserved
05 - Frame data length
--- Frame data length start
24 - PIP1 command
01 - Source colour bars
00 - Size 1/2
00 - X=0
25 - Y=25 (hex)=37 decimal
--- Frame data length end
B7 - Checksum (5A+0E+00+00+00+00+05+24+01+00+00+25)
DD - End of frame

peternewman avatar Jul 23 '23 12:07 peternewman

@Jumpcutjeff - I was able to get commands to work using a hacked together C# app, but didn't have time to implement a Companion module.

On Sun, Jul 23, 2023, 8:24 AM Peter Newman @.***> wrote:

jcoutch, did you ever get this to work on that AVMatrix switcher? I have the same model and can't figure out that confusing API doc from the company.

It doesn't seem too bad @Jumpcutjeff https://github.com/Jumpcutjeff , but I don't have the switcher to test it against.

Have you tried sending some of their example commands?

If you look at their example for "Set PIP1 Source to color bar": 5A 0E 00 00 00 00 05 24 01 00 00 25 B7 DD

Which breaks down as:

5A - Header 0E 00 - Length (little endian) 00 - Device type 00 - Device ID 00 - Reserved 05 - Frame data length --- Frame data length start 24 - PIP1 command 01 - Source colour bars 00 - Size 1/2 00 - X=0 25 - Y=25 (hex)=37 decimal --- Frame data length end B7 - Checksum (5A+0E+00+00+00+00+05+24+01+00+00+25) DD - End of frame

— Reply to this email directly, view it on GitHub https://github.com/bitfocus/companion-module-requests/issues/936#issuecomment-1646827130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC6L4MHTQUEEBMOI2UBME3XRUJV7ANCNFSM6AAAAAARE5EERA . You are receiving this because you authored the thread.Message ID: @.***>

jcoutch avatar Jul 23 '23 15:07 jcoutch

@jcoutch @peternewman Thanks so much for your reply! I tried using their sample code: 5A 0E 00 00 00 00 05 24 01 00 00 25 B7 DD BUT it didn't work. However, it could be user error. I was using the generic TCP/UDP module for Companion. See pic for how I entered code (not above code). Perhaps I entered it incorrectly?

UDP-Command

Jumpcutjeff avatar Jul 26 '23 22:07 Jumpcutjeff

@peternewman I'm absolutely confounded by how to generate the codes from their data sheet. I don't even know what this kind of data is called...hex code? For example, in their API doc, under Transitions->PGM-Source: Command=0x12 Data=1 (PGM1=1) Data Length=1

I have no idea of how to use your guide, which I appreciate you posting, to convert those values into a string that resembles the example. Any additional guidance would be appreciated. Thank you!

Have you tried sending some of their example commands?

If you look at their example for "Set PIP1 Source to color bar": 5A 0E 00 00 00 00 05 24 01 00 00 25 B7 DD

Which breaks down as:

5A - Header
0E 00 - Length (little endian)
00 - Device type
00 - Device ID
00 - Reserved
05 - Frame data length
--- Frame data length start
24 - PIP1 command
01 - Source colour bars
00 - Size 1/2
00 - X=0
25 - Y=25 (hex)=37 decimal
--- Frame data length end
B7 - Checksum (5A+0E+00+00+00+00+05+24+01+00+00+25)
DD - End of frame

Jumpcutjeff avatar Jul 26 '23 23:07 Jumpcutjeff

Thanks so much for your reply! I tried using their sample code: 5A 0E 00 00 00 00 05 24 01 00 00 25 B7 DD BUT it didn't work. However, it could be user error. I was using the generic TCP/UDP module for Companion. See pic for how I entered code (not above code). Perhaps I entered it incorrectly?

I'm a bit confused how you got from my example code to what's in your input box?

Are you sure you're sending to port 19523?

I think you want "none" for command end character.

Looking at https://github.com/bitfocus/companion-module-generic-tcp-udp/issues/3 you just want a % before each hex pair I mentioned, so you actually want to put this in the box: %5A%0E%00%00%00%00%05%24%01%00%00%25%B7%DD

@peternewman I'm absolutely confounded by how to generate the codes from their data sheet. I don't even know what this kind of data is called...hex code? For example, in their API doc, under Transitions->PGM-Source: Command=0x12 Data=1 (PGM1=1) Data Length=1

Yeah it's hex codes, there guide isn't the clearest, but it's not the worst I've ever seen. As long as you can view PIP1, I'd start with that example as there's a good chance it will actually work if you send it properly. The further you drift from that the greater the chances of it not even being a valid command to send...

No worries, if that string works I can explain more about the mapping stuff.

peternewman avatar Jul 26 '23 23:07 peternewman

Thanks! Yes, I'm sending to port 19523. I'll try adding those percentage signs and see where we're at.

Jumpcutjeff avatar Jul 26 '23 23:07 Jumpcutjeff

Nothing. I tried enclosing the string in <>, too.

I plugged the switcher into the network on a PC and ran AVMatrix's control software. It did connect. So, it can be controlled via IP. I'm just unsure how to get Companion to connect.

Jumpcutjeff avatar Jul 27 '23 00:07 Jumpcutjeff

@Jumpcutjeff - I tried looking for my .NET code, but not sure where it's at. I did find a sample Node app that I was using during my initial reverse engineering of the protocol, and uploaded it as a Gist: https://gist.github.com/jcoutch/fc3b37309f1d09f864b839337de90500

And here's a small fiddle I wrote for building the messages: https://jsfiddle.net/jcoutch/s4gyumn9/26/

Just edit the frame data section, and you should be able to test with different messages.

jcoutch avatar Jul 27 '23 00:07 jcoutch

@jcoutch Wow, that looks awesome. Forgive me, but I'am a severe coding dunce. :) Where/how do I run the index.mjs file? I'm on Mac.

Jumpcutjeff avatar Jul 27 '23 00:07 Jumpcutjeff

@jcoutch Ha! This dummy learned a new trick! I installed Visual Studio Code and ran your .mjs file. I copied some of the commands after the [ & it worked!

Jumpcutjeff avatar Jul 27 '23 01:07 Jumpcutjeff

WOW! It's working in Companion. Using the TCP/UDP module, I enter the code: %5a%0c%00%00%00%00%03%11%01%00%7b%dd and VOILA! It does an auto transition. This is a game changer.

Thank you both!

Jumpcutjeff avatar Jul 27 '23 01:07 Jumpcutjeff

Looking a bit further, my/their PIP example might have been a poor choice as you probably need to turn the PIP on to see the effects.

Looking at @jcoutch it looks like 5a0b0000000002fe0166dd would get tally feedback, at which point you'd definitely want a module I think...

peternewman avatar Jul 27 '23 12:07 peternewman

Yes, please. If this feature is still possible, for people who aren't as coding-savvy as others, this feature on the Bitfocus Companion would literally save lives! (Not literally literally lives, but at least some precious time, indeed!)

Please keep me updated if there is a way to more-or-less easily implement this in Companion! I would be grateful, volumes and volumes!

In the mean time, I'll try to make the TCP/UDP module work :)

silvansan avatar Apr 03 '24 20:04 silvansan

have you any news about the avmatrix connection with companion?

gianni244 avatar May 08 '24 08:05 gianni244