Master-Slave Pixel Blaze Wireless control

I want to use the sensor shield on one pixel blaze with no leds, to wirelessly control the leds connected to another pixel blaze. How can I do that? Further detail, I have a box i want to control stage lighting with based on the orientation of the box, for a theater show.

Thats a good idea! It doesn’t do that yet, but its something I’d like to add in the future.

Another option would be to use a wireless serial repeater, the serial packets can be relayed to a PB. Something like this should work, but requires a bit more work!

https://jeelabs.org/2015/06/24/ftdi-over-wifi-esp-bridge/

I’m building a stage lighting system that pulls data from an accelerometer mounted on a guitar headstock to control animations on a series hanging of LED strips. I want to make the system modular and expandable - so I’d been searching for a reliable and easy to use method to establish a wireless connection between the microcontroller on the headstock (right now I’m using ESP8266 Huzzah feather) and whatever board is driving the LEDs. Here’s a video of the controller prototype that I’m trying to sync - https://vimeo.com/383385759

Basically what I need to do is put together is something like a wireless version of your sensor expansion board which automatically searches for and connects to the Pixelblaze.

I guess this is a slightly different question than the original, so I’m not sure if using a serial repeater would be necessary in this case. Either way, could go into a little more detail about how i might go about incorporating something like this with the Pixelblaze?

I read the link you posted, but I’m not really an expert in wireless protocols at this point, so if you could break down for me the basic structure of what I’d need to do to incorporate a system like this with your controller that would be extremely helpful! I’d be happy to document my progress and write a guide if that would be useful for people on here (this is for a thesis project so I’ll be doing that anyway)

thanks!

What you are looking to do is totally doable. An esp8266 with an accelerometer (or the sensor board itself) can be used to connect via websocket and send over variables.

Look for the setvars websocket API on this page:
https://www.bhencke.com/pixelblaze-advanced

You’d use a websocket client library to connect, then send over json frames. Either making a with the proper formatting, or using a library like arduinojson.

1 Like

Thanks! I’m gonna try to get something running this week, I’ll let you know if any specific questions come up.

1 Like

Hi again, hope you’re doing ok!
Things got hectic on my end but I’m back on track now.

I decided to try to test out the Websocket connection by using your getVars.js example file before I moved on to using the Arduino libraries. I cant seem to get it to get it to connect properly though - whenever I run it I get this error message -

ofershouval@Ofers-MBP-2526:~/Developer/pixelblaze_websocket_example-master_4_7/nodejs$ node getVars.js websocket error: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) { errno: -54, code: 'ECONNRESET', syscall: 'read' }

This happens regardless of whether I am in AP mode or connecting through my router. Any ideas as to what I might be doing wrong?

Thanks

Hi @refo,
It sounds like it can’t make a connection. The example getVars.js expects an argument on the command line for the IP address, otherwise it defaults to 192.168.4.1.

Can you ping the IP address of your Pixelblaze?

Right so if the pixelblaze is connected through my router, and i call

node getVars.js 192.168.1.193

I get the same result as if I call

node getVars.js 192.168.4.1 or just node getVars.js
Which defaults to 192.168.4.1 while the blaze is in AP mode.

Anything else, for instance and I get no error, it just cant establish a connection and times out.

Is that what you meant, or am i missing something?

for example

ofershouval@Ofers-MBP-2526:~/Developer/pixelblaze_websocket_example-master_4_7/nodejs$ node getVars.js 192.168.1.193 websocket error: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) { errno: -54, code: 'ECONNRESET', syscall: 'read' } websocket closed! Timed out waiting for connection and/or getVars result ofershouval@Ofers-MBP-2526:~/Developer/pixelblaze_websocket_example-master_4_7/nodejs$
is there another way for me to ping it that I don’t know about?

ping is a network tool that most devices support that helps identify basic network connectivity. You can run it on the command line like so:

ping 192.168.1.193

You should see something like this:

PING 192.168.1.132 (192.168.1.132): 56 data bytes
64 bytes from 192.168.1.132: icmp_seq=0 ttl=128 time=211.315 ms
64 bytes from 192.168.1.132: icmp_seq=1 ttl=128 time=9.456 ms
64 bytes from 192.168.1.132: icmp_seq=2 ttl=128 time=22.878 ms
64 bytes from 192.168.1.132: icmp_seq=3 ttl=128 time=1.899 ms

You can get out of it with control-c.

You can also use curl to try to connect to the web server, like this:

curl -is 192.168.1.193

And should get something like this:

HTTP/1.1 200 OK
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 240472
Connection: close

Ok yes, pinging worked the same way yours did.

PING 192.168.1.193 (192.168.1.193): 56 data bytes 64 bytes from 192.168.1.193: icmp_seq=0 ttl=255 time=11.156 ms 64 bytes from 192.168.1.193: icmp_seq=1 ttl=255 time=29.072 ms 64 bytes from 192.168.1.193: icmp_seq=2 ttl=255 time=9.968 ms

when i used the curl command, it returned

HTTP/1.1 200 OK Content-Type: text/html Content-Encoding: gzip Content-Length: 267035 Connection: close
but then it also spit out a bunch of random characters like this

?u??v?Ʋ0??O?(+'VLB?UZ???ىgŎO?${??|{?H" n??p?<ļ??y?y????%%3?7?l?쮮??????U????w?????W??Z?W=???<^/.???&?qr?Q<[?U̖?L?ˣ]5?ɌeUm??v????_??|?}^?6q?M??(??*]C??_]??"Uʭ?Uzyt??7?b[)?7YR-/??:??]?d???[??<??Q4y?~l???\?ٮ J?>e?7???H??h???W????=?Хp'?x???nU?fˮ??7?E??e?[Z^?N??N?Ⱥ$?@????}?J?}(???q 먥????????P?g?Ƴ:&P??VY??Wo?i>????g'4?d~??_EUV?xt?H ?}vBU??i??賲??2'??Q?R?z??? ?????EZMy^8+V????n?Ų ?Q?ׅ_g??????m'x???- ?u?&?n??????wi?X?j??"???fZ??*N?y1=Y?%?:????^?? ?<??S?u?N?q?x?l?e?P?|WV? ?<[????g?????\U?????e??uPP???1???t?b??shl8+K$4 ?? fV|SP??Y???^????9???<^e??E??n?n????*?U????v??W

etc etc

Not sure if that’s a clue?

curl with -is shouldn’t have spit out the payload, but there’s no problem there. The garbled output is just the gzip of the main page.

For some reason it’s rejecting the websocket connection. Try closing all browser windows with Pixelblaze open, and resetting Pixelblaze. Maybe its out of resources? It can handle a few simultaneous connections, but it’s resources aren’t unlimited.

Tried closing the web browser and it worked!

It seems to only handle 1 connection at a time right now, and that might become a problem in the future, but for now this a big step forward, thank you!

Out of curiosity, is it possible to modify the pixelblaze so it can connect simultaneously on different ports?

It should allow multiple connections, and is working for me. I wonder if its a browser related issue or old version maybe? What browser and version of PB are you running?