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

Message protocol #5

Closed
JSMSolns opened this issue Oct 18, 2022 · 14 comments
Closed

Message protocol #5

JSMSolns opened this issue Oct 18, 2022 · 14 comments

Comments

@JSMSolns
Copy link

Firstly - brilliant work on decoding the messages to the wrist bands.
I've written an Arduino script to take your bit sequences and turn them into IR timings for the transmitter and it all works a treat on 2 Music of the Spheres wristbands.

I've been struggling with trying to understand the message formats though?
I was hoping to control these via some DMX software (VixenLights) sync'd to an audio track and using the Arduino to decode the DMX and convert to suitable messages. I was expecting some sort of RGB(W) levels to be embedded in the messages but that doesn't seem to be the case here?

It would be interesting to know how the professional lighting controllers sequence these wristbands.

One thing I've noticed (as I'm sure you have too) is that there is never any more than 2 '1' bits together which makes me think there is some sort of additional encoding going on? Clearly not Manchester coding as there are too many repeating 0s.

@danielweidman
Copy link
Owner

Thanks for the kind words! Glad to hear it is working for you.

When I started this project, I was also expecting some sort of clear RGB levels encoded in the messages, but so far I have not been able to figure out the exact pattern. There's got to be one though, unless the bracelets literally store a table of IR code to light effect/color.

I've found that usually if you discover a working IR code via brute force that's just a couple bits off from another, the color is usually similar (like light green vs dark green). However, when I (and my partner) tried segmenting out the packets in various ways based on estimates of what we thought might be the R, G, and B (or H, S, and V)-associated bits and then changed one to try and get a desired color, most of the time the resulting code wouldn't work (leading to a theory that there's a checksum of some sort too).

It's of course notable that each packet, in addition to just the color, also seems to indicate the duration of the effect (and sometimes the fade parameters). So there's some information in each beyond just the RGB levels; that's made it harder to identify the pattern.

FWIW, I came across this page during my search, maybe it could reveal something?
https://onyxfixturefinder.com/fixture/PixMob/pixmob+pro2.1
Would be interested to hear your thoughts on that if you understand it better than me. I believe it mainly has to do with how the controller/computer/whatever communicates with the PixMob IR blaster (which takes commands via DMX) though. So the PixMob transmitter is doing some extra translation of the signals from DMX to get the output IR commands. That's my understanding at least.

Here's the manual for one model of PixMob transmitter that takes commands according to the "PixMob PRO 2" protocol: https://fccid.io/2ADS4WASH/User-Manual/Users-Manual-4434103.pdf

Anyway, those are just some ramblings; it would be great to fully figure out the pattern.

@JSMSolns
Copy link
Author

JSMSolns commented Oct 21, 2022 via email

@danielweidman
Copy link
Owner

Hi again,

That's really cool what you've been doing with the DMX signal and the selection of the closes color by RGB values! I love it and would be very interested in seeing a sample video.

Regarding the minimum acceptable delay, I can tell you that the recordings we've gotten indicate that PixMob leaves 6300 microseconds (equivalent to 9 700 microsecond "0" bits) between separate messages/repetitions of messages.

@JSMSolns
Copy link
Author

JSMSolns commented Nov 1, 2022

Hi,
I managed to make a bit of progress.
Here is a linklink hopefully to a video I made of my set up running with 2 wristbands. I covered the wristbands with a sheet of paper because otherwise their brightness saturates the camera and makes it hard to discern the colours.
The setup is running Vixen with the DMX output sent over a serial (usb) port. The Arduino reads the serial DMX stream, extracts the channel information, interprets it and re-encodes it as an IR stream and transmits it to the IR sender attached to the Arduino.
The channels set up are:
1: Red
2: Green
3: Blue
4: Tail code index
5: Weird code index
Hope you like Coldplay!
I'll leave the link open for a few days.
Let me know if you manage this view it ok.

@danielweidman
Copy link
Owner

danielweidman commented Nov 1, 2022

Brilliant! You've got a whole thing set up end-to-end and it look so cool. Thanks very much for sharing the video.

Are there any particular shades of color/effects/etc you feel are missing? I got some new recordings the other day (will add to this repo) and am hoping to figure out a bit more about the packet structure.

@sean1983
Copy link
Contributor

sean1983 commented Nov 1, 2022 via email

@JSMSolns
Copy link
Author

JSMSolns commented Nov 2, 2022

Brilliant! You've got a whole thing set up end-to-end and it look so cool. Thanks very much for sharing the video.

Are there any particular shades of color/effects/etc you feel are missing? I got some new recordings the other day (will add to this repo) and am hoping to figure out a bit more about the packet structure.

Cheers for that.
Just wanted to see what was possible rather than having a particular use case. Wouldn't have been possible without all your hard work, so thanks again for doing it all.

Most of the video was done just using the RGB settings with just a few of the tail codes and weird codes towards the end (slow fades etc.) as these were a late addition to the development.
I'll probably park the development for now, so don't worry about additional decodes on my part - plenty to go at already!
On the protocol front, I have a suspicion that the coding may be based on 3 bit encoding but excluding 111 ( ignoring the first and last bits as start/stop) but this still doesn't get me any further.

@JSMSolns
Copy link
Author

JSMSolns commented Nov 2, 2022

Bloody hell mate, you've done it. and it looks fantastic! This is exactly what I have been trying too do with no luck. Vixen is just the original version of xLights isn't it? Soon, I guess this could run on an ESP32 also? Is your code available? I really really want to play! Specially know I have a collection of about 20 of these latest gen bands from Coldplay's last tour! I would love to use them with xLights or my DMX Console with my Christmas Lights Display aswell as for Party's, I would love to actually sequence them to a whole video of a concert matching the fx being used. Better then VR, Although I might have to build some CO2 & Concetti Cannons too! I saw them twice this year, Wembly and the second time in Glasgow. And at Glasgow I had a little play, I took a Cheap Home Automation IR Hub (SwitchBot) with me, Programmed up with tons of this IR codes, Powered it USB-C on my phone and connected it via WiFi to my phones Hotspot, Now I wouldn't spoil a Coldplay Gig, But before them started I held it in my hand behind my phone and push a few codes out. 🤣🤣🤣 I got about 12 seats each side of me and 6 or 7 rows up and down. The look on people's faces thinking the gig was about to start was priceless. Didn't want to try holding it up, because it was probably obvious enough to the lighting directors, centre of where they were all flashing away, Plus this PixMob Moving Heads have IR / Visible Cameras on board for Calibration at venue's so they definitely would have seen me! But leaving the venue was fun watching 100s of them flash ad I walked to find a taxi. Well done on the progress mate. 👏 Sean Yem

On Tue, 1 Nov 2022, 22:10 JSMSolns, @.***> wrote: Hi, I managed to make a bit of progress. Here is a linklink https://drive.google.com/file/d/1RbWuvI1nAY7a7wVZ3fR-A8afUV0r4NzG/view?usp=drivesdk hopefully to a video I made of my set up running with 2 wristbands. I covered the wristbands with a sheet of paper because otherwise their brightness saturates the camera and makes it hard to discern the colours. The setup is running Vixen with the DMX output sent over a serial (usb) port. The Arduino reads the serial DMX stream, extracts the channel information, interprets it and re-encodes it as an IR stream and transmits it to the IR sender attached to the Arduino. The channels set up are: 1: Red 2: Green 3: Blue 4: Tail code index 5: Weird code index Hope you like Coldplay! I'll leave the link open for a few days. Let me know if you manage this view it ok. — Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPB3C6PNY63G3PIL4ZZ4ATWGGIL3ANCNFSM6AAAAAARIER4ZY . You are receiving this because you are subscribed to this thread.Message ID: </issues/5/1299292586@ github.com>

Thanks for the comment.
My intention was always to follow in the footsteps of Coldplay in terms of reuse/recycling/sustainability and try and use these wrist bands rather than throw them away. Possibly to use them at parties/Xmas.

Arduino code isn't complicated. Just loops reading the serial port and picking out the channel info (mainly RGB). As there doesn't seem to be a direct coding of colour on the IR message, the Arduino tries to do a closest match to the known colours available (these are also used as favourites in the colour selection within Vixen). The ir code sequences are held in 2d arrays in the program memory as 0s and 1s as shown on this site. The code then converts them to 700us timings in real time to pump out to the IR led.
I think you can also use Xlights in a similar way. You can also use an ESP32 but may have to ensure interrupts are disabled whilst transmitting the IR possibly?

@sean1983
Copy link
Contributor

sean1983 commented Nov 5, 2022

Its impressive, I am.not a coder, but can normally wangle something together copy and pasting bits here and these and generally get something to working.

But no look with this, I need to learn more about programming arduino, Brain is getting older and visually impaired so things are much more difficult these days.

I already Daniels code on the ESP32 but rather than using a single IR LED I have the data pin drive a Transistor that is firing off an Intrared Illuminator PCB used for CCTV, so can trigger the bands over a large area now!

https://drive.google.com/file/d/1Pa5LE-J73l1GjIj4OU_m1orIR7pC4XAN/view

I am trying to add RS485 to I can have a standard DMX Input, plus also got an Ethernet module that will work with the ESP32 but take up far too many pins, but that was a thought of running hard wired Ethernet for ArtNet or E131. Obviously them protocols can run over WiFi but latency is an issue then. Direct RS458 (DMX) should be easier to implement at least for me.

https://drive.google.com/file/d/1PlwuEKmHJRVqUNtT6t9PIvor-xyX6KSr/view

Would you be able to share the code you have written so far to make this work with Vixen please 🙏 it would really help me, I understand if you don't.

Thanks in advance.

Sean

@JSMSolns
Copy link
Author

JSMSolns commented Nov 5, 2022

Happy to share the code although it is very much a development setup and could be tidied up a lot. You will probably have to modify it for the ESP32 and the RS485 handling.
I'd recommend setting it up for OTA updates because having to constantly switch the serial port between programming and Vixen was a bit of a pain.
I'll try and upload the code later tonight or tomorrow and send a link.
I hope the basis of this code won't be used at any live concerts and only used to re-use the wristbands for personal use.

@sean1983
Copy link
Contributor

sean1983 commented Nov 5, 2022 via email

@JSMSolns
Copy link
Author

JSMSolns commented Nov 5, 2022

The Arduino Nano development code is here:

https://drive.google.com/drive/folders/1QL1kPWrWzF3vtw2RiBbOQsQR6VMyGKgv?usp=sharing

I'll leave it open for a day or two for you to grab.
There are some comments at the top of the code which may help with setting up depending upon how you're going to interface your ESP32.

The Vixen software is set up as a Generic serial controller with a packet header of +> (so the Arduino knows where the start of a DMX message begins). The Arduino is plugged into the PC's USB port and receives the serial output from Vixen.
I guess your openDMX/RS-485 interface won't require this.

Hope you can make sense of my coding (containing very few comments!). There is quite a bit of copy/paste of code due to the development phase so could be tidied up a lot by using more common functions.

If you struggle to understand any of the code, let me know and I'll try and help out where I can.

@sean1983
Copy link
Contributor

sean1983 commented Nov 6, 2022 via email

@JSMSolns
Copy link
Author

JSMSolns commented Nov 6, 2022

Glad you got it working on the ESP32.
Enjoy.

@JSMSolns JSMSolns closed this as completed Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants