I have two of these for the time being (one is a loaner from iowa scaled), so I am putting some cycles into developing a web app to handle the Xbee network these guys inhabit. It is way cool how the Protothrottle backend works. It sends out broadcast packets to every Xbee on the network but leaves a huge space for directed messages.
In light of that, I’ve come up with this minimalistic setup to send those directed messages. Super simple hardware. A Raspberry PiZero W, configured as a Wifi Access point with an Xbee as a USB device. It’s running Apache web server and Python Flask on the backend. I’ve thrown in MySQL and reddis (database apps) and created the basics for a web app. Because of the way linux works, I need a background process that runs as root that actually talks to the USB/Xbee. (the web app doesn’t have access to the hardware) I run two reddis queues so the web code can build the messages and then the root process can receive and send them. Took a while to get that working right but it’s doing quite well now. Everything starts at powerup. I like stuff to ‘just work’ when you turn it on.
Using this interface, I can scan for all the nodes on the xbee network and then direct specific message packets to each using a web based interface. Or in other words, I will be able to configure a DCC decoder in a locomotive with my smart phone while I control it with the Protothrottle. Way cool!
Above is how the Windows PC sees the RPiZeroW, it’s just another Wifi network. Once you join here, the RPiZW (linux) handles all of the DHCP and DNS stuff so you can use any browser to get to it. Below is the console login using windows 10 bash. You can just ssh into the Rpi, just like a big ole honkin web server box (even though its only as big as two postage stamps, ha) As you can see, all of this is over Wifi, I have no hardwired ethernet.
Below is Firefox, note the URL.
It needs some cosmetics, kinda bland, just a very basic graphic for each node. I can click the ‘scan’ button to find all nodes on the network, then I can click on one of the node graphics to ‘zoom’ into the receiver. Two of those screens are below. For now I only have the basics, but I will, in time, come up with graphical interfaces for the TCSWow and TSU4400 so I don’t have to lookup all those darn CV doodads to change things.