This is a short Python script to show an end to end connection from Zenoh IoT Protocol to a Panel Dashboard Webapplication, which could run in a Notebook to analyse the incoming IoT Data.
Install and execute
-
Zenoh Installation INFO: Zenoh upgrade 30 September 2022 and API changed! (This is not yet included here)
-
Adapt the Producer topic to the one in the panel_script py or the other way around.
- "'/myhome/kitchen/temp'" Same for the Zenoh Broker
- "'/myhome/**'"
Start zenoh broker:
zenohd --mem-storage='/myfactory/**'
-
Download Apache IoTDB
./sbin/start-server.sh
./sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
Execute in IoTDB CLI:
SET STORAGE GROUP TO root.myfactory CREATE TIMESERIES root.myfactory.machine1.temperature WITH DATATYPE=INT32, ENCODING=PLAIN INSERT INTO root.myfactory.machine1(timestamp,temperature) values(200,21) // Test Insert SELECT * FROM root.myfactory.machine1
-
Install Panel
Used Python packages:
import zenoh from iotdb.Session import Session from datetime import datetime import panel as pn
-
Execute in a Shell / Terminal (whith running Zenoh Broker and Apache IoTDB):
panel serve 'panel_script.py' --autoreload --show