Using FLEDGE as the data source connector

EdgeLake-fledge-connector is based on fledge-http-north. The connector replaces FLEDGE nodes with EdgeLake nodes and data is streamed using POST or PUT.

Prerequisites

  1. EdgeLake REST services enabled. Details are available here
  2. FLEDGE & Corresponding plugins
    • FLEDGE
    • FLEDGE-GUI
    • FLEDGE Southbound services OpenWeatherMap

Stream Data from FLEDGE into EdgeLake

  1. Clone EdgeLake's fledge-connector
    cd $HOME
    git clone https://github.com/AnyLog-co/fledge-connector
  2. Copy edgelake_plugin into FLEDGE
    cp -r $HOME/fledge-connector/anylog_rest_conn/ /usr/local/fledge/python/fledge/plugins/north/
  3. Access Fledge GUI
  4. Begin sending data & view readings columns - using the OpenWeatherMap asset as an example
    # Sample data being generated
    {
     "asset": "OpenWeatherMap",
     "reading": {
       "city": "London",
       "wind_speed": 5.14,
       "clouds": 100,
       "temperature": 289.21,
       "pressure": 1009,
       "humidity": 74,
       "visibility": 10000
     },
     "timestamp": "2022-06-25 19:42:09.916403"
    }
    
  5. Under the North section add anylog_rest_conn
    • URL - The IP:Port address to send data to
    • REST Topic Name - REST topic to send data to
    • Asset List - Comma separated list of assets to send using this AnyLog connection. If no assets set, then data from all assets will be sent
    • Database Name - logical database to store data in AnyLog

The process detailed above streams data into EdgeLake via REST.

Configuring EdgeLake REST Client

Notes:

  • To stream data using PUT, enable the EdgeLake REST service.
  • To stream data via POST, enable the message client service on the EdgeLake node.

Sample Message Client:

<msg client where broker=rest and user-agent=anylog and log=!mqtt_log and topic=(
    name=fledge-weather and
    dbms=!default_dbms and
    table="bring [asset]" and
    column.timestamp.timestamp="bring [timestamp]" and
    column.city=(type=str and value="bring [readings][city]" and optional=true) and
    column.clouds=(type=float and value="bring [readings][clouds]" and optional=true) and
    column.humidity=(type=float and value="bring [readings][humidity]" and optional=true) and
    column.pressure=(type=float and value="bring [readings][pressure]" and optional=true) and
    column.temperature=(type=float and value="bring [readings][temperature]" and optional=true) and
    column.visibility=(type=float and value="bring [readings][visibility]" and optional=true) and
    column.wind_speed=(type=float and value="bring [readings][wind_speed]" and optional=true)
)>

EdgeLake deployment comes with a sample connection to Fledge that accepts data from both OpenWeather and Random southbound service.