Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AVMATRIX PVS0403U #936

Open
jcoutch opened this issue Oct 14, 2022 · 16 comments
Open

Support for AVMATRIX PVS0403U #936

jcoutch opened this issue Oct 14, 2022 · 16 comments
Labels
Hardware This module interacts with a specific piece of hardware.

Comments

@jcoutch
Copy link

jcoutch commented Oct 14, 2022

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
Copy link
Author

jcoutch commented Oct 17, 2022

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

@josephdadams josephdadams added the Hardware This module interacts with a specific piece of hardware. label Nov 24, 2022
@Jumpcutjeff
Copy link

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!

@peternewman
Copy link

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

@jcoutch
Copy link
Author

jcoutch commented Jul 23, 2023 via email

@Jumpcutjeff
Copy link

Jumpcutjeff commented Jul 26, 2023

@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
Copy link

@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

@peternewman
Copy link

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 bitfocus/companion-module-generic-tcp-udp#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.

@Jumpcutjeff
Copy link

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

@Jumpcutjeff
Copy link

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.

@jcoutch
Copy link
Author

jcoutch commented Jul 27, 2023

@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.

@Jumpcutjeff
Copy link

Jumpcutjeff commented Jul 27, 2023

@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
Copy link

@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
Copy link

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!

@peternewman
Copy link

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...

@silvansan
Copy link

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 :)

@gianni244
Copy link

have you any news about the avmatrix connection with companion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware This module interacts with a specific piece of hardware.
Projects
None yet
Development

No branches or pull requests

6 participants