This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Openplotter + MQTT + Dashboard
#1
Hello,
After several days of trial and error I finally found a successful way to publish some data from openplotter with MQTT to an online dashboard:

[Image: dbwgtk2.png]

What is MQTT:
A lightweight messaging protocol for small sensors and mobile devices, optimized for high-latency or unreliable networks. Click here for more on MQTT. In short Openplotter publishes data on different topics to a broker, other devices can subscribe to these topics (the dashboard)
So if you want to use Openplotter as a remote monitoring device on your boat or publish real time saildata when you are on the move and you don’t have (any) linux skills, please read on!

1. Sign up for a free Cloud MQTT Broker
I used CloudMQTT, the free ‘Cute Cat’ plan. You will get a servername, a username and password and a set of ports. Create a name username with read/write permissions on a topic 'Temp' (for example)

2. Configure Openplotter for CloudMQTT
Enter your credentials from you CloudMQTT (control panel -> ‘Details’ button -> Overview), use the first port listed (starting with a 1)

[Image: tDfe6pN.png]

3. Create a topic in Openplotter
Add a topic, the ‘Short’ name you can find in the first column in the Inspector. The topicname you can make up yourself

[Image: WRJocH6.png]

4. Create an Action in Openplotter
Publishing the data from the topics is done by an Action under the Actions-tab. First add a trigger, choose 'None (always true)'

[Image: UqihJj1.png]

Then add an action. In the dropdown list you will find below a ‘Publish on topic X (topic you created in step 3)’, for ‘data’ put the ‘Short’ name (from step 3) between brackets

[Image: EJ24T1i.png]

5. Create a dashboard on Freeboard.io
I got a free account at freeboard.io, you will get a small demo with your smartphone which is really cool. Now it gets a little complex. For Freeboard to use an MQTT broker as a datasource, we have to configure a MQTT plugin. This can be done with the ‘Developer Console’ in the upper left corner. Enter the following plugin script URL’s:
https://rawgit.com/benjaminchodroff/free....plugin.js
https://rawgit.com/benjaminchodroff/free....plugin.js
Leave /plugins/all where it is.

[Image: R1gsZmn.png]

For more details on the plugin, I found above information on https://github.com/alsm/freeboard-mqtt/issues/3

6. Add Datasource to Freeboard.io
The ‘Name’ and ‘ClientID’ you can chose yourself. The portnumber is the ‘Websocket Port’ you can find in your CloudMQTT broker dashboard (starting with 3..). 
The ‘Last Updated’ time should be updated within the timeframe you set on the Action tab in Openplotter. If it is not updated reload the freeboard. (took me 2 days to find that out)

[Image: ojBPJJ1.png]

7. Add a Widget with the published data:
Click ‘Add Pane’ and an empty pane is created. Click on the settings icon (wrench) to give it a name and adjust the width (1 to 3 columns) 
Then click the ‘+’. For Temperature choose ‘Text’, ‘Gauge’ or ‘Sparkline’. as Type. Choose a fitting title. For the Value click on ‘+ Datasources’ and click in the dropdown menu on your topicname and then on ‘msg’, see example below. And Voila!! 

[Image: J8iUwMU.png]

In my example above I used also used a 'gauge' with the same datasource and a 'google map' which needs Lat & Lon

[Image: 2a1dxy3.png]

In my dashboard I used also a gauge-widget with the same 'Temp' datasource and a GoogleMap-widget with the datasources Lat & Lon.
Don't forget when you add a topic in Openplotter you have to give your CloudMQTT user read/write permissions!

Notes:
- There are probably more efficient ways to accomplish the same result, I just want to share my way. Feel free to comment!
- To make it useful I would have to add a 2g/3g dongle 
- I'm thinking about 2 dashboards, one for remote monitoring for temperature, humidity, power, gas and bilgewater, and one for under sail with speed, location etc.
- I didn’t get the humidity sensor to display data, still no clue why....
- For troubleshooting you click the Websocket button in your CloudMQTT console, you should see your topics sent from Openplotter

Happy tinkering!
Reply


Messages In This Thread
Openplotter + MQTT + Dashboard - by Snijdor - 2016-07-12, 07:54 AM
RE: Openplotter + MQTT + Dashboard - by Sailoog - 2016-07-12, 10:44 AM
RE: Openplotter + MQTT + Dashboard - by Sailoog - 2016-07-12, 11:57 AM
RE: Openplotter + MQTT + Dashboard - by Snijdor - 2016-07-12, 04:39 PM
RE: Openplotter + MQTT + Dashboard - by Sailoog - 2016-07-12, 12:24 PM
RE: Openplotter + MQTT + Dashboard - by svtgd - 2016-07-12, 09:45 PM
RE: Openplotter + MQTT + Dashboard - by Sailoog - 2016-08-12, 05:02 PM
RE: Openplotter + MQTT + Dashboard - by PaddyB - 2016-08-15, 01:53 AM
RE: Openplotter + MQTT + Dashboard - by Sailoog - 2016-08-15, 11:37 AM
Openplotter + MQTT + Dashboard - by Alpenskipper - 2016-08-16, 07:26 AM
RE: Openplotter + MQTT + Dashboard - by Snijdor - 2016-08-16, 02:37 PM
Openplotter + MQTT + Dashboard - by Alpenskipper - 2016-08-16, 05:40 PM
Openplotter + MQTT + Dashboard - by Alpenskipper - 2016-08-16, 08:16 PM
RE: Openplotter + MQTT + Dashboard - by Snijdor - 2016-08-16, 08:29 PM
Openplotter + MQTT + Dashboard - by Alpenskipper - 2016-08-16, 09:14 PM
Openplotter + MQTT + Dashboard - by Alpenskipper - 2016-08-18, 07:54 AM
RE: Openplotter + MQTT + Dashboard - by Snijdor - 2016-09-28, 08:53 PM
RE: Openplotter + MQTT + Dashboard - by jram - 2016-11-18, 07:51 PM
RE: Openplotter + MQTT + Dashboard - by gniersma - 2016-11-21, 09:03 PM
RE: Openplotter + MQTT + Dashboard - by Vamonos - 2016-11-21, 07:04 PM
RE: Openplotter + MQTT + Dashboard - by tradeeasy - 2017-04-17, 07:02 AM
RE: Openplotter + MQTT + Dashboard - by dreuf - 2017-04-18, 03:49 PM
RE: Openplotter + MQTT + Dashboard - by tocan - 2017-05-05, 03:47 AM
RE: Openplotter + MQTT + Dashboard - by kste - 2017-05-18, 08:31 PM
RE: Openplotter + MQTT + Dashboard - by tocan - 2017-05-18, 09:53 PM
RE: Openplotter + MQTT + Dashboard - by Vamonos - 2017-05-18, 11:15 PM
RE: Openplotter + MQTT + Dashboard - by tocan - 2017-05-19, 12:07 AM
RE: Openplotter + MQTT + Dashboard - by kste - 2017-05-19, 04:57 AM
RE: Openplotter + MQTT + Dashboard - by tocan - 2017-05-19, 06:23 AM
RE: Openplotter + MQTT + Dashboard - by Vamonos - 2017-05-19, 11:59 AM
RE: Openplotter + MQTT + Dashboard - by tocan - 2017-05-19, 12:08 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)