element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog PizzaPi: Communicating over MQTT
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dmrobotix
  • Date Created: 26 May 2015 4:48 AM Date Created
  • Views 410 views
  • Likes 1 like
  • Comments 0 comments
  • design_challenge
  • pizza_pi
  • sci_fi_your_pi
Related
Recommended

PizzaPi: Communicating over MQTT

dmrobotix
dmrobotix
26 May 2015

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

Build your own Javascript MQTT Web Application

Talking Small

Paho-MQTT Open Source Messaging

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube