Pixelblaze config via tftp or dhcp?

There are several ways to leverage existing infra tech (dhcp | tftp | git | … ) to autoprovision things…

has there been any consideration given to using a dhcp attribute to point a pixelblaze at a config relevant to itself?

or using a tftp server to save its config anytime things change?

or using a git repo to store configs?

so many ways… not sure what (if any) would be preferential to explore

That’s a good idea which could easily be hacked up from the outside.

Just monitor the DHCP server for new pixelblazes, and post a .pbb (pixelblaze backup) file at it when one appears. You would probably want to change the name in the config JSON at the very least.

You could also pull the .pbb regularly, extract it to the filesystem, and track the changes in git.

So it’s possible today with some duct tape, and I could see the incoming-dhcp thing working just like a PXE system, but that’s already a bit too 1980’s for me, so writing to tftp would be a bit much. As for git, that would be neat – just configure a git server on the pixelblaze and have it pull its config by name … and presumably a tiny subset of git would fit on the ESP.

The backup/restore tool runs in the browser, using the file management APIs. You could certainly script a browser to do that via selenium or something.

Another path could be to poke them using the APIs. Check out @pixie 's midnight commander plugin of example:

and @zranger1’s client library:

The .pbb format is a JSON file with base64 encoded files, so you could use the UI to get an archive and parse it in a tool to automate bringup for copies.


Regarding DHCP specifically, I don’t know if this would be easy to tap in to on the PB side for custom provisioning, like I’ve done with bootstrapping linux installs.

The APIs now are HTTP, fully curl-able and scriptable. Initial wifi setup could be scripted as well by scanning for new APs, connecting, and posting to the wifi config form endpoint.

I’ve definitely considered some kind of git integration. There’s a destructured format for patterns I have in mind that would make it much easier to manage via git, and having a repo backing the community patterns is on my list.

1 Like