Significant feature release: Sync multiple Pixelblazes

Each follower can choose which set of data to use for the accelerometer, sound, light, and group of analog inputs. So that way you can for example share sound from the leader but still use local accelerometers.

3 Likes

Does the new sync feature support syncing of timers when both connected to the same wifi? Having issues with that right now, all patterns are changing together but when I enable the timer only one goes off and both timers are set the same. Maybe I’m missing something?

1 Like

@PB43VER Yes, it synchronizes each device’s calls to time().

Pattern math involving adding up timers based on delta can be a little less consistent in patterns between the various controllers in your group, especially if they have fairly different numbers or types of LEDS, so the frame rates are different between the devices in your group.

Did you mean something else when you say timer, like the scheduled on/off times in Settings? If so, no, those remain independent. If you’re having trouble, be sure that all devices have the same Time Zone set in settings.

1 Like

This looks awesome! Sync aside this is so nice even for managing patterns on a fleet of pixelblazes. A couple questions:

I still don’t grok that mapping code. If each PB has the same mapping function and you aren’t using nodeId than how do the different PBs have different mappings?

Can this still work if you’re using a router? Will you see all PBs connected to the same router in the list of peer devices?

Each Pixelblaze can have its own pixel map. Using the fake pixel trick, you can divvy up the world coordinate space across multiple individual pixel maps. Or use the nodeId() in pattern code with the coordinate transformation api.

If you have the exact same map on each Pixelblaze and don’t use nodeId() in pattern code, then they render the same stuff.

Yes, this works on a network you host, or with a Pixelblaze in AP mode. The leaders and solo Pixelblazes, or anything that isn’t following another PB, will show up in the status dropdown menu, so as long as you know/guess the IP of one PB, you can find the others. On a leader you can see it’s followers from the same menu in case you want to jump over to them for setting changes, etc.

This isn’t so much pattern management, as obviating the need to manage patterns while in a group. The patterns from the leader are used, and the patterns that are installed on the followers doesn’t change and isn’t needed/used at all unless they leave the group.

One benefit of this is you can have an XL with tons and tons of patterns as the leader, and can use smaller storage Pixelblaze followers which will still follow along with anything the leader does without needing to store everything.

3 Likes

This isn’t so much pattern management, as obviating the need to manage patterns while in a group. The patterns from the leader are used, and the patterns that are installed on the followers doesn’t change and isn’t needed/used at all unless they leave the group.

So on pattern change the leader will send the pattern code out to the follower pixelblazes over the network? Regardless this still gets rid of the step where I have to copy the pattern to all my pixelblazes in my network before checking to make sure everything looks good. Huge improvement in the development loop!

Each Pixelblaze can have its own pixel map. Using the fake pixel trick, you can divvy up the world coordinate space across multiple individual pixel maps. Or use the nodeId() in pattern code with the coordinate transformation api.

Ah yes ok this is the same thing I do. Cool to know you can use nodeId() in the pattern code though, that makes it a little less manual to do the mapping on each Pixelblaze.

1 Like

I tried to use this nice feature by connection two PB with each other (on in AP Mode one in client).
I found them both when I am connected to the network (one as *4.1, the other as *4.3), but both PB doesn’t find each other - I can not choose any mode within group settings.

Some advice for me?

Try power cycling them. There may be an issue if the PB recently switched Wi-Fi modes.

Thanks, as easy as it sound that’s solved the problem. :slight_smile:

Ok, I’ve been recently trying to set this up and I’ve run into a problem. I have 4 PBs running together, with 3 following one that has a sensor board. This works mostly fine. However, when I try to update variable remotely via Zranger’s python client, I am only able to update the leader variables. They don’t propagate to the followers. If I run all 4 on the same network with none as followers, I can control all of them at once, but then they can’t share sensor data. Is there any way to both share sensor data and exported variables?

Controls are replicated, but exported vars are not. It’s kind of like poking into the memory of the script and each node has its own memory.

You could send the vars to each node.

At some point I will add a way to replicate any data around that you want.

The issue with sending data to each node is that the followers disappear from the network so I can’t detect them any more.

They are visible via the leader using a getPeers request.

@zranger1 , does this exist in PBclient?

Not yet. I’ve got some pieces done, but likely won’t have time to put them all together 'till after burning man.

1 Like

OMG This is amazing and it works so FLAWLESSLY!

I helped a friend set up their pixelblaze yesterday and after updating the firmware on mine to the new 3.40, everything just…worked.

@wizard this is such a genius ploy to sell more pixelblazes, because now I’m realizing I need a bunch of them to make more fruits!

3 Likes

There actually is a getPeers function in PBClient, so I was able to find the followers.

1 Like

Quick question before I break out a bunch of boards and run tests – @wizard what happens when PixelBlaze which have been set to follow the leader comes in and out of WiFi range?

As is unsurprising for anyone who’s read anything else I’ve posted in this forum, this is for a set of Wearables at Burning Man. I’d love ~10 different PixelBlaze (attached to coats, backpacks, helmets, etc) to be showing the same pattern sequences when they’re near each other, and then to fail gracefully when folks wander off and the devices can no longer “see” each other – and then re-sync if the leader comes into WiFi range of any of the follower devices.

I’d love to get a read on what SHOULD happen before testing, or even if that use case with mobile PB works in this release. Thanks.

@ZacharyRD, I just tested this, for nearly identical reasons – contemplating building a PB leader “beacon” on top of giant art car so when anybody with a camp Pixelblaze comes in range, they pick up audio information from the car’s sound system.

When the leader goes offline or the follower loses connection, the follower:

  • continues in follower mode, running whatever pattern it was running when disconnected. (You can’t change patterns without taking it out of follower mode.)
  • displays something like: “Follow: --Offline–” on its settings screen.

When the leader becomes available again, it reconnects automatically and keeps on following!

1 Like

Bingo, thanks @zranger1 ! That just saved me a set of testing. We’re doing basically the same thing, except I very much don’t have an art car.^ Luckily, with the palette rotation functionality I worked on with you, it can hold on a single pattern and be visually interesting for quite a while.

I COULD also built a composite pattern with multiple effects in it for this purpose – do you happen to recall which of the reference patterns I think you wrote gives example code for that?

^ My one rule of running Burning Man camps – come say hi to me at Bubble TEAse, 9:00 & C this year, serving Bubble Milk Tea 2-4 PM – has always been “no art cars, they only lead to pain and suffering” – especially since I live in the downtown of a major city. Bless you and everyone else who organizes them.