Pages

Friday, August 4, 2023

Freeboard revisisted part 1

For an index to all my stories click this text.

What we are going to do.

We are going to build an IOT dashboard with Freeboard that can be freely arranged by yourself.



As you can see the dashboard has a field displaying time. Gauges that give the temperature inside the house and outside. A graph displaying the temperature. Buttons for putting lamps on and off and indicator leds that show if people are in and if apparatus are functioning or off-line. You can add many more widgets to build a complete Home automation system.

This is going to be a multiple story project, so keep following this blog and see how we get Freeboard working with a lot more options as what the standard version offers.

Freeboard

Looong time ago (oktober 2019) I published a story about Freeboard. You can re-read that here: http://lucstechblog.blogspot.com/2019/10/freeboard.html

Freeboard was free at that time. Meaning anybody could sign up and use the service for free. You could build your dashboards and use ESP's to send data to them.
And then things changed. Suddenly the makers of Freeboard decided that the service could not be used for free anymore. This bothered me a lot cause I wrote a story on Freeboard and suddenly readers that got enthousiastic and started using it had to pay for it.

And then, sometime ago, I stumbled upon a story about a programming service called Bipes. Bipes works with programming blocks (just like MIT's App Inventor) which are translated into MicroPython and sends the code to your Microcontroller which can be an ESP (8266 or 32) or a Raspberry Pi Pico. Bipes in itself is somewhat interesting and maybe worth having a look at. You can find it here: http://bipes.net.br/beta2/ui/
If you read from the above lines that I am a bit reluctant to get further into this then you are right. These services (there are more like Bipes) are totally dependent on their makers. So libraries and sensors are only added when the makers decide so. Which makes you dependent.

The interesting part though was that Bipes included Freeboard for displaying sensor data. And the author claimed that it was easy to install Freeboard in your own projects. But he did not get into that. And so started my search.

Freeboard on Github.

I found Freeboard on Github: https://github.com/Freeboard/freeboard Then I saw that the makers of Freeboard had a demo version set up on Github: http://freeboard.github.io/freeboard/ I immediately started testing this demo version and it worked flawless.

The Freeboard page stated that Freeboard was published on Github under the MIT license. I looked into that license and it has the following statement:

 Copyright (c) <year> <copyright holders>

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.


Now that opens perspectives !!! So I immediately forked Freeboard to my own repositry.

Some time ago I wrote a story on how to use Github as a web-server for your own web-pages. You can re-read that story here.
http://lucstechblog.blogspot.com/2023/07/using-github-for-building-website.html
And that is what I did with my own repositry. I made a web-page from the repositry.



And yes it started.



So I added my faithfull thermometer which was after all these years still sending data to Dweet. Weather stations and thermometers are really stupid things. Just look out of your window or go outside and you feel what the temperature is. No need for electronics to tell me.  Still I have an electronic thermometer as it is a constant data source which can be used for testing purposes like now...... So let´s have a look at how my thermometer Dweets. My ´Thing´ is called Lucstemp2018 and the thermometer value is in the variable `temp´. Let us use that.

Short intermezzo.

Freeboard uses (amongst others) Dweet to store data on and get data from. If you do not know what Dweet is and how to use it please read these stories:
https://lucstechblog.blogspot.com/2019/05/dweet-volatile-iot-cloud-service.html
https://lucstechblog.blogspot.com/2019/08/dweet-again.html
http://lucstechblog.blogspot.com/2019/12/dweet-with-arduino.html

The thermometer I am using is build with an ESP-01 and a Dallas DS18B20 temperature sensor. It is programmed in ESP-Basic and has been running since 2017. Story, schematics and program can be found here:
http://lucstechblog.blogspot.com/2017/11/oh-no-not-another-wifi-thermometer.html

I use the thermometer to send data to my Domoticz setup, Thingspeak and Dweet. The Dweet part is the most interesting for use with Freeboard. You can re-read how that's done here: https://lucstechblog.blogspot.com/2019/08/dweet-again.html

Something is wrong !!!

I thought that all was OK but it was not.



As you can see Freeboard is not getting the Thermometers value. It never updates its value. So where did I go wrong ???



Back to the Github demo from Freeboard itself. And hey that works ???????

So I send a requets to the makers of Freeboard on Github.
https://github.com/Freeboard/freeboard/issues/283

Within a day they responded with a suggestion, which I tried immediately. But alas it did not work.

And then I had an idea. I carefully looked at the url's that were used in Freeboards github page and mine.



This is the Freeboard URL



And this is mine.

Spot the difference ????
Well Freeboard's Github page is HTTP and mine is HTTPS.

When the Freeboard Github page was made Github allowed webpages to be HTTP. And now they only allow HTTPS (secure) pages. There is the difference.
Therefore Freeboard will not work as a GitHub webpage.

So I had to find another web-service that allowed me to setup a webpage as a HTTP page. And That was easier as I imagined. Read how to achieve this in an upcoming story.

Till that time dive into Freeboard with the Freeboard Github version http://freeboard.github.io/freeboard/ and look at all the possibilities. Freeboard is fun and an easy way to build an IOT dashboard. And re-read my first story about Freeboard which will help you setting up your own Dashboard: http://lucstechblog.blogspot.com/2019/10/freeboard.html

Till next time.
Have fun

Luc Volders