Use Octoblu and Freeboard to compare weather data

  • 20 January 2017
  • 11 reacties
  • 2499 keer bekeken

Badge
This short tutorial shows how you can use Octoblu and Freeboard to visualize your LoRa data from the developer portal. Weather data from OpenWeatherMap is used in combination with simulated LoRa data. Freeboard is a free tool to visualize data, disadvantage it that it does not save the data.

The content is structured as follows:
Set up Octoblu
Connect with Developer Portal
Create flow in Octoblu
Connect Freeboard
Create Dashboard
Overview


Set up Octoblu
To start get an Octoblu account at https://www.octoblu.com/. When you open your account go to the dashboard. Create a new flow and give it a relevant name. Now you are ready to create your own flow. A 'Trigger' can be used to receive data from the developer portal. Input a โ€˜Triggerโ€™ from the tools button. Set the payload type to String and connect it with a โ€˜Debugโ€™ tool. This is all that is needed to receive messages.



Connect with Developer Portal
Since the flow in Octoblu is ready to receive messages a platform from where they can be send is neccesary. In the developer portal it is possible to conncect a LoRa device. For this example simulated uplink messages are used. Go to the develop portal (kpn.com/loradeveloperportal). Log in or register and add a device. Give it a relevant name. For the 'destination url' go back to Octoblu. Select the trigger and copy the link from 'HTTP post'. Use this link in the developer portal as destination url. Use the test uplink button in the developer portal to send a message to trigger your flow in Octoblu. If you switch back to Octoblu you should see a J-SON message in the debug tab with the payload you gave in the developer portal.



Create flow in Octoblu
It is now possible to send sensor data through the developer portal to Octoblu. It might be beneficial to compare this data with a different source. For example for temperature OpenWeatherMap can be used. Connect the โ€˜Weatherโ€™ โ€˜thingโ€™ (this is how these are called in Octoblu) to the trigger. Everytime the trigger receives LoRa data from the developer portal it will also check the OpenWeatherMap data.
To combine these two data types into one message the โ€˜Composeโ€™ thing is used. In this example the LoRa data can be extracted from the J-SON with {{msg.data.DevEUI_uplink.payload_hex}} and the OpenWeatherMap data with {{msg.temperature}}. Give relevant names (keys). To make sure both data types arrive in the same message a โ€˜delayโ€™ tool is used.



Connect Freeboard
Octoblu currently does not have a tool or thing for a dashboard but we can use Freeboard to visualize the data. Follow the steps described in the link to connect Octoblu and Freeboard: https://github.com/octoblu/freeboard. Connect the newly created 'Freeboard' thing to the Octoblu flow (make sure to set โ€˜use incoming messageโ€™ on) and you are ready to receive and visualize data. Send a test uplink message from the developer portal to check if no errors occur.



Create Dashboard
If everything goes as planned go to your freeboard on freeboard.io. Select โ€˜add paneโ€™ and then add type โ€˜sparklineโ€™. It is possible to combine two data sources in this graph. In our example the temp_sens and temp_app are used. Save the pane and send some data from the developer portal. The sparkline should show the temperature send from the test message and the temperature from the OpenWeatherMap.





Overview
You should now be able to use Octoblu to receive LoRa messages and visualize them using Freeboard. This was just a simple example of what can be possible using Octoblu. If you have any questions/remarks/comments please feel free to post them. If you want to share your own tutorial or your LoRa/IoT project we are also very curious!

Useful links


- LoRa: Starters Guide
- LoRa: Forum and Manuals
- LoRa: Geolocation
- LoRa: Dictionary & Definitions
- Tools: www.LoRaTools.nl
- Tools: Freeboard and Octoblu
- Tools: IoT Academy Github
- FAQ: Frequently Asked Questions

11 reacties

Reputatie 1
Badge
Hallo Rick,
Dank voor deze uitleg, echter.... ik krijg het niet aan de praat. Ik denk dat het zit in de UUID en TOKEN. De UUID kan ik uit de message halen maar waar kan ik de TOKEN vinden?
Verder neem ik aan dat de overige velden (SERVER en PORT) juist zijn. Ik stuur data naar de Octoblu server vanuit de KISS-LoRa device. De message komt goed aan op de Octoblu en in de Freeboard thing, maar dan....
Rick, thanks for the tutorial. Very helpful. One thing I noticed: The body of the message contains:
{
"DevEUI_uplink": {
"Time": "2017-07-10T08:23:38.356+0200",
...

So instead of {{msg.data.payload_hex}} I have to use {{msg.data.DevEUI_uplink.payload_hex}}
Reputatie 7
Badge +11
Thanks a lot for your input @duizendmiljard!
I will add this to Rick's tutorial.

@Roberto48 Is het gelukt om verder te komen? Onze collega Rick is aan het genieten van zijn vakantie, voorlopig zien we van hem nog geen reactie. Persoonlijk heb ik niet gewerkt met Octoblu en weet ik geen advies te geven uit ervaring. Meer informatie over de Token (SHA 256 signature) kun je in dit topic vinden.
Reputatie 1
Badge
@Tim Dank voor je reactie. Helaas ben ik de afgelopen tijd niet met Lora bezig geweest, andere prio's.... Maar ga dit zeker binnenkort weer oppakken, ook omdat anders mijn inlog gaat verlopen. Resultaten zal ik hier melden.
Rob.
Reputatie 1
Badge
@duizendmiljard Please can you help me calculating the TOKEN to get my messages into the Freeboard Dashboard? All is working well but not this last step....
Thanks!
Rob
Reputatie 1
Badge
@Tim @duizendmiljard Problem solved... To get the right UUID and TOKEN you have to go to the Octoblu design page and then click on item Things, click on Other things Freeboard and click on Credentials Generate and next Download. In the download file you find the right UUID and TOKEN.
Put it into the Datasource and it will work.

Rob
Reputatie 7
Badge +11
Hi @Roberto48, bedankt voor het delen van je ervaring en tips op het forum! ๐Ÿ˜€
Ik heb je bericht uitgelicht, je helpt er vast een gebruiker mee die ook op zoek is naar de UUID en TOKEN. Top!
Reputatie 1
Badge
@Tim Graag gedaan! Van fora word ik ook wijzer dus dan weer wat terug doen... Ondertussen heb ik nu de KISS-LoRa gadget helemaal draaien op Freeboard. Zie onder. Leuk project geweest en een boel van geleerd dankzij het KPN LoRa net. Helaas is het TTN hier (nog) niet te ontvangen.
Rob

Reputatie 7
Badge +11
Hi Rob, ja, dan ben je inderdaad afhankelijk van ons netwerk. Volgens mij is er nog een concullega bezig met een LoRa netwerk in Nederland, maar ik noem natuurlijk liever geen namen. ๐Ÿ˜‰
Freeboard is een aanrader voor iedereen om mee te beginnen, erg mooi, redelijk eenvoudig en gratis voor 1 dashboard!

Ik ben nieuwsgierig, wat ben je nog meer van plan met LoRa @Roberto48?
Reputatie 1
Badge
Hi Tim,
Ben benieuwd wie er nog meer bezig is.... Maar dat zullen we ongetwijfeld wel een keertje horen.
Voor mij was dit door de KISS-LoRa gadget een eerste kennismaking met LoRa. Verder (nog) geen plannen om er verder mee te gaan. Ik wil nog wel proberen om een RaspberryPi AP-server op te zetten om de berichten te ontvangen als vervanger voor de Octoblu. Maar dat lukt nog niet echt...
Maar er liggen hier nog genoeg andere projecten ๐Ÿ˜‰
Rob
Reputatie 7
Badge +11
Maar er liggen hier nog genoeg andere projecten ๐Ÿ˜‰
Haha, ongetwijfeld Rob! Fijn weekend ๐Ÿ˜

Reageer