Image for post
Image for post

How to connect Raspberry Pi to Mainflux

Setting up MQTT on headless Raspberry Pi and connecting it to Mainflux platform on DigitalOcean droplet

Ivan Milošević
Jul 25, 2018 · 8 min read

Installing Raspbian

Image for post
Image for post

Connecting Raspberry Pi

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WiFiNetworkName"
psk="WiFiPassword"
key_mgmt=WPA-PSK
}
Image for post
Image for post
Local IP address of PC
Image for post
Image for post
Searching for local IP address of Rasberry Pi
Image for post
Image for post

Installing MQTT on Raspberry Pi

Image for post
Image for post
Subscribing and publishing MQTT messages on localhost

Installing Mainflux on DigitalOcean

adduser ivan
usermod -aG sudo ivan
su ivan
Install Docker
Installing Docker Compose -replace 1.22.0 with current version
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Add things and connect them to the channel
Image for post
Image for post
Obtaining an authorization key in Postman
Image for post
Image for post
Getting things ids and keys in Postman
Image for post
Image for post
Grafana login page. Username: admin, password: admin
Image for post
Image for post
InfluxDB data source settings in Grafana

Connect Raspberry Pi to Mainflux

Image for post
Image for post
Image for post
Image for post
-m '[{"bn":"name","bu":"A", "n": "voltage", "u": "V", "v": 120.1 }, { "n": "current", "t": -2, "v": 1.5 },{ "n": "current", "t": -1, "v": 1.6 }, { "n": "current", "t": 0, "v": 1.7 }]'
Image for post
Image for post
Create new dashboard in Grafana
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Mainflux IoT Platform

Mainflux is highly secure, scalable, open-source IoT…

Ivan Milošević

Written by

Developer at Mainflux

Mainflux IoT Platform

Mainflux is highly secure, scalable, open-source IoT platform written in Go and deployed in Docker. It serves as software infrastructure and set of microservices for development of the Internet of Things Solutions and deployment of Intelligent products.

Ivan Milošević

Written by

Developer at Mainflux

Mainflux IoT Platform

Mainflux is highly secure, scalable, open-source IoT platform written in Go and deployed in Docker. It serves as software infrastructure and set of microservices for development of the Internet of Things Solutions and deployment of Intelligent products.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store