element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Arduino
  • Products
  • More
Arduino
Blog BYOB Party #5, Mrs Yun gets her MQTT on
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Robert Peter Oakes
  • Date Created: 24 Dec 2014 1:30 AM Date Created
  • Views 788 views
  • Likes 2 likes
  • Comments 0 comments
  • iot_holidaylights
  • byob_party
Related
Recommended

BYOB Party #5, Mrs Yun gets her MQTT on

Robert Peter Oakes
Robert Peter Oakes
24 Dec 2014


MQTT Server on the Arduino YUN

 

Back to the beginning BYOB Party #1, "Bring you own Bulbs" - The Internet of Holiday Lights


In this episode leading up to the final party of the year we look at running the MQTT Server directly on the YUN, there are numerous posts where this is running on a VM on a PC or on another more capable device but truth be known, it will run perfectly well on the YUN OpenWRT  Linux kernel directly, With the help from Mrs YUN,  ill show you how


A video if you prefer (Oh, and I kept it under a half hour image )

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Or the text version for those so inclined to read image, you know who you are

 

First thing is to update the Yun, use a wireless device or connect via the Ethernet port

(Wireless you look for the YUN SSID and connect, no code needed, then browse to "arduino")

(Ethernet, browse to the ip address or connect to arduino.local )

image

log in with the default password "arduino", the following screen is after the upgrade (Sorry, the video contains the original )

image

click configure and fill in for your local network

image

Set your time zone (Apparently Canada is part of America... who knew, so to find Toronto you need to select "America, Toronto), you don't need to change the password but do so if you wish

image

If your planning on using the REST interface and don't want it to be secure (No Password prompt when you try to access the rest interface), then also check "OPEN"

Then click on "Configure & restart"

 

I had to repeat this a few times before it stuck (Or I finally got the WIFI password right, one or the other image )

 

anyway, once it is connecting to the local intranet (Home network), you should be able to connect using the url "HTTP://arduino.local", if this does not work, you may need to look at your router so see the IP address assigned to it and connect directly via the IP address "HTTP://192.168.nnn.nnn" or what ever your network is configured for. once you connect you will see a screen similar to that shown above, you may have different IP address of course.

 

After setting up the YUN via the WEB browser to configure it to connect to your local internet connection via WIFI or use the Ethernet port (Where's the fun in that)

 

Given your successful you should be able to SSH into the Linux side of the board. I use a program called PUTTY (Down load from PuTTY: a free telnet/ssh client  ), the screen below show the start screen and how I configure it for my instance of a YUN. Saving the setting makes life so much easier later on

imageimage

on connection you will be presented with a logon prompt, enter "root" for the logon name followed by "arduino" for the password

 

you should have a screen like the one below but without the mosquitto (MQTT) stuff at the bottom, note the date of the core version

BusyBox v1.19.4 (2014-11-13 19:03:47 CET), if yours is not at this level or newer, you may need to upgrade, I have two YUN's and one would work without upgrade, one would not, neither where at this date revision but all had the same version (v1.19.4) so I guess they don't update the version numbers for over a years worth of updates.so if things don't work and your not at this version, upgrade, it is very painless and I will have a video below (To Follow) to show how easy it is.

image

 

So once were here we can proceed to install the required software, this is available at the Mosquitto.org website "Mosquitto on OpenWrt | Mosquitto" simply follow the instructions

 

opkg update
opkg install mosquitto mosquitto-client libmosquitto

and your ready to roll, just type "mosquitto" at the command prompt and your broker is ready and running

here is the screen show of those steps

image

using the samples provided on the mosquitto MQTT site, it is easy to test the servers operation (See here: Documentation | Mosquitto )

once subscribers and publishers start to use the server, it will print messages on the console as shown below

image

I set up a raspberry pi with MQTT client and published a few events to the YUN as shown here, it also had a second console subscribed to only the humidity topic (Was on temperature to start with)

imageimage

The YUN console subscribed to a wild card topic using "oakesclan/#" and received every publication as shown (# is a wild card for MQTT topics)

image

So, there you have it, the Arduino YUN does not need a separate server to support MQTT, it is more than able to host the server itself and have numerous consoles running at the same time, in the next post I will be getting the Arduino side of the YUN to subscribe to the Linux side MQTT server and have it react to commands sent to the MQTT broker, at a later stage I will also try to configure the server to bridge to the Eclipse sandbox, extending the reach of the party.


Now Mrs YUN is ready to relay messages between all the guest who want to talk and those who will listen, now we need radios for the none network connected guests.

  • 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 © 2025 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