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.

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

Forum Jump:


Users browsing this thread: 1 Guest(s)