Since my last post I've made some good progress on setting up communication between the various Raspberry Pi computers over MQTT. I got a case in the mail for my RPi 2 and that bugger is now sitting in the living room with a network cable plugged directly into the cable router. At my desk I have the other two RPi's that make up the brains of the pizza carrier.
PiFace CAD is running on my old RPi model B and the Xtrinsic board and GPS module are on the Model B+. Both have their own wifi dongles, the B+ is getting internet via the WiPi dongle that came with the kit. The other is using the standard dongle available from Adafruit.
So far, I can successfully publish messages from the B+ computer to the server (running on the RPi 2) and I can subscribe to those messages on the model B. This was a major hurdle for me because while the libraries that are available for communicating over MQTT are dead simple to use, getting a grip on how it all works is not. At least for me, anyway.
As mentioned in my previous posts, the server is running lighttpd and mosquitto. Mosquitto is the MQTT broker, it acts as a middleman between the subscriber and publisher clients. Lighttpd is a lightweight web server. The next hurdle was to get websockets enabled and working with mosquitto. It turns out that this was not possible until mid-last year. I have managed to get mosquitto working with websockets enabled and I can send messages using MQTT but I'm having some trouble getting messages sent over websockets via JavaScript. I'll have to keep working on this, there must be something in the config file that needs adjusting. Right now, my browser can connect to the broker but the broker gives me an error message:
1432607712: Socket error on client lilxbuntu, disconnecting.
Not sure where the socket error is coming from, so I'll have to dig deeper!
Once I get that fixed, though, I'll be in business and I can start building out the various interfaces! I don't think I mentioned this before, but initially in my proposal I had planned to 3D print the case that would hold the pizza box. I've since given this a lot of thought and I think a better idea is to modify the existing pizza delivery bags. There are a number of reasons for this, but the obvious one is that it will save me money. Furthermore, I think there are some pluses to having a soft case over a hard one. I kind of like the idea of modifying the bag for another reason, which is that I can dust off my sewing machine skills (and my sewing machine).
Other thoughts for the project before the deadline is up:
1) Handling multiple orders for one bag (turns out that pizza delivery bags handle at minimum two pizzas at a time).
2) Figuring out how to help the driver make speedy deliveries with PizzaPi in tow and,
3) Is there an easy and cost effective way to keep the bag heated?
I was supposed to be on vacation already, but I had to stay on at the lab a few extra weeks. I'm looking forward to spending endless days working on my projects at home and sleeping in a bit. Until my next update...
References:
http://tech.scargill.net/mosquitto-and-web-sockets/
https://goochgooch.wordpress.com/2014/08/01/building-mosquitto-1-4/
Make your Raspberry Pi into the Ultimate IoT Hub - ThingStudio BlogThingStudio Blog