Skip to content

Basic scripting with Panel using Apache ECharts, Apache IoTDB and Zenoh

License

Notifications You must be signed in to change notification settings

ottlukas/ApacheCon_2022_IoT

Repository files navigation

READ ME

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.

Prerequisites

Install and execute

  1. Zenoh Installation INFO: Zenoh upgrade 30 September 2022 and API changed! (This is not yet included here)

  2. Zenoh First App

    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/**' 
    
  3. Apache IoTDB Quickstart

    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
    
  4. Install Panel

    Used Python packages:

    import zenoh
    from iotdb.Session import Session
    from datetime import datetime
    import panel as pn
    
  5. Execute in a Shell / Terminal (whith running Zenoh Broker and Apache IoTDB):

    panel serve 'panel_script.py' --autoreload --show 
    

About

Basic scripting with Panel using Apache ECharts, Apache IoTDB and Zenoh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages