This is an old revision of the document!


Raspberry as a broker

On this page, we will explain how to turn your Raspberry Pi 3 (also works with 3+) into a broker with the Wifi access point. Having the Raspberry Pi working as an access point means that you will not need an additional router (NB. we have not tested this under heavy load). If you have a spare router and do not wish to install our image then you can follow the instructions here on how to turn any Raspberry Pi into a broker.

You can download the image file for the configuration with AP and MQTT broker here:

Raspberry broker

And you can find a guide on how to install it here. You will need a 16GB (or larger) micro-SD card since the original image was on a 16 GB card. The easiest way in Linux is to download the zip file, unzip it and by using Startu Disck creator, write the image to a new SD card.

Once you have flashed the image to the SD card you should insert it into your Raspberry and boot it up. The Wifi-AP service should activate on its own. But to activate the MQTT broker enter

mosquitto -d

to the terminal window (you can use SSH or monitor and keyboard to do this). You can use the terminal on Raspbian to confirm if your broker is working. For this, open a terminal window and enter

mosquitto_sub -t "mytopic"

Then open another terminal window and enter

mosquitto_pub -t "mytopic" -m "This is my message"

If this works then the next thing you should try is connecting your laptop (or other) device to the Raspberry and test publishing and subscribing to messages with it. A good program for debugging is MQTTBox. You can find the default Wifi name and password below.

NB!! Avoid turning off Raspberry by removing the power cord since it can cause the SD card to become corrupted. You should always turn the Raspberry off via GUI or typing sudo shutdown now to the terminal (using screen and keyboard, or SSH). Upgrading Rasbian may stop the initial system from working. Always consider it when upgrading and keep a copy of important configuration files or the original system.

Passwords and other data for the raspberry broker

IP address of Raspberry Pi (for broker and SSH):

192.168.4.1:22

Port for MQTT broker (without password): 1883

Raspberry login (SSH):

username: pi

password: raspberry

Raspberry Wifi Access Point:

ssid: raspberryIoT

password: piIoT123

en/iot/examples/setup/broker.1675153061.txt.gz · Last modified: 2023/01/31 10:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0