Share My Creation [IoT] Lighthouse58

Lighthouse58 is an Internet of Things learning case based upon the LEGO® Lighthouse Point 31051.
The goal was to enhance the features of the Lighthouse by integrating and controlling objects, e.g. top light, OLED display with a clock & actual weather (at the Lighthouse position gathered from a weather service), motion detector, outdoor lights, room lights, illuminance, LED indicators.
The objects contain various Tinkerforge modules, i.e. Master Bricks & Bricklets.
The original Lighthouse Point has been enhanced to accommodate the various modules. In addition a newly designed Control Unit holds the Tinkerforge Master Bricks.

Controlled by a Raspberry Pi 4 (over WiFi with MQTT mosquitto and the Tinkerforge MQTT API bindings) or direct from Desktop Application via USB (jTinkerforge library - wrapped partially Java API Bindings Tinkerforge.jar).
Several applications developed to control the Lighthouse:
Web-browser Dashboard Node-RED), Windows Client Dashboard (B4J), Windows or Ubuntu Human Machine Interface (B4J) and Multi Client Browser Dashboard (server, B4J).

Lookup GitHub repository for more information.

B4J Windows Client Example
Dashboard to control the various objects with its modules via MQTT.
1656939002387.png


Version Control
20220704 - (Post #6) NEW B4 Human Machine Interface (HMI) Desktop Application; Weather service from Bright Sky; jTinkerforge library.
20161009 - (Post #5) UPD B4J Server solution completed.
20161006 - (Post #4) NEW Server solution first draft; UPD B4J Windows client completed.
20161001 - (Post #3) NEW Lighthouse configuration; UPD Lighthouse with Lighthouse selection & information.
20160929 - (Post #2) NEW MQTT console, object form icon buttons, B4J source available.
20160926 - (Post #1) NEW first version published.
 
Last edited:

rwblinn

Well-Known Member
Licensed User
Longtime User
Update #1 20160929 (see post #1)
Added MQTT Console, Icon Buttons to several object forms, B4J source made available for download.
 
Last edited:

rwblinn

Well-Known Member
Licensed User
Longtime User
Update #2 20161001 (see post #1)
Added Lighthouses Configuration form (TableView with textfields; RGB color builder with sliders; Lighthousetype holding information).
Updated the Lighthouse form with Lighthouse selection, Lighthouse information.

Getting close to completion :)
 
Last edited:

rwblinn

Well-Known Member
Licensed User
Longtime User
Update #3 20161006 (see post #1)
B4J Windows Client solution is completed.
B4J Server solution: Development started. Source shared.
The biggest challenge was to enable multi client control via Browser. This means when a client presses a button to turn f.e. the Pier Outdoor Light on, the button state is also updated on all clients connected. The same applies for showing values like Illuminance, Motion detected but also the state of the Lighthouse Toplight.
The solution was
  • to build a shared module (LighthouseShared) for functions like MQTT, timers etc but also to keep the state of buttons and
  • to use the websocket module (Lighthouse) to handle the Browser updates (via various callsubdelayed).
Now that this is working, can start to complete functions like request system status and shutdown.
Have not made up my mind yet, how to display the Weather information in gauges - probably via Google Chart.

In addition started to build in B4J a TinkerForge MQTT library - used for the B4J Server solution. Will be included in the next B4J Windows Client updated after completing the B4J Server solution.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Update #4 20161009 (see post #1)
Completed the B4J Server solution running on the Raspberry Pi.
The server solution has w3.css as the CSS framework with responsive design including dialogs (see index.html).
Tested the multi client control via Browser on several devices (Windows 10, Raspberry Pi newest Raspian Jessie with Pixel, Smartphone running Android).
Code developed for the B4J Windows Client has been reused for the B4J Server solution - pretty much copy and paste enabling rapid development.

Whats next
Received several requests for publishing this IoT showcase. Will keep posted on the outcome.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Update #5 20220704 (see post #1)
On request, developed a new Lighthouse58 Human Machine Interface (HMI) running on Windows 10 or Ubuntu 20.04 with direct connection to the Control Unit.
The HMI is developed with B4J as B4XPages application using widgets (custom views), graphs (xChartLite), jTinkerforge library (partial wrapped Tinkerforge Java API), B4XPreferencesDialog (Configuration). Compiled with Java JDK 8.
1656923095913.png


To share some challenges in developing the HMI with B4J:
  • jTinkerforge library - Wrapper for the Tinkerforge Java API Bindings to control selected Tinkerforge modules (10 out of 100), esp. handling multiple module events with callbacks,
  • Widgets - Came up with the idea to develop reusable modules via Custom Views, i.e. RGB LEDs, State Settings, Setpoint/Process value control, alarm tracking,
  • Weather charts - Used the xChartLite library (Thanks to @klaus) to display Lighthouse Weather Information (Bright Sky),
  • Timers - Various timers and resumable subs.
INFO: Can not share the source code yet of the application and the jTinkerforge library.
 
Last edited:
Top