Giter Club home page Giter Club logo

simple-streaming-gateway's Introduction

NOTE This is currently in alpha, we expect stable operation for streaming for BLE, TCPIP, and Serial. However, you may run into issues with the errors not being propagated to the UI. If you see issues please open a ticket. Additionally, some of the APIs may still change in the future.

SensiML Gateway

This SensiML Gateway implements the Simple Streaming Service protocol to enable forwarding data to the SensiML Data Capture Lab for recording and annotation. The Gateway supports connecting to sensors sources over a Serial, BLE, and TCP/IP connections. It also supports recording video and sensor data locally to the gateway.

Installation

To install the app dependencies run

cd simple-streaming-gateway
pip install -r requirements.txt

To Start the application run

python3 app.py

Installation (Windows, Mac)

Currently the application uses bluepy for BLE connections on linux, which is not supported on windows or Mac. We have experimental support for BLE on windows/OSx using bleak. If you are installing for windows, remove bluepy as a dependency in requirements.txt.

Usage

The Gateway must first be configured to record data from your target sensor. It does that by fetching a configuration json from the source device. You can scan for devices connected over Serial and BLE. The gateway does not support scanning for TCP/IP devices, these addresses must be entered manually into the device id field as address:port.

Configure Gateway

After fetching the configuration your gateway will connect to the device. When connected you will see a Device: Connected status on the left navigation bar. When connected, the Gateway is able to forward sensor data from the source device to the SensiML Data Capture Lab which is used to record and annotate sensor data.

Data Collection over Serial Source

1. Connect edge node to Gateway over USB serial
2. Go to Gateway Configure Screen, Select Serial Radio and Click Scan
3. Enter the Device ID (which is the port) into the Text Field and Click Configure
4. The SensiML Gateway is now configured to Stream Data from your Device over Wi-Fi

NOTE The BAUD RATE for the serial connection can be changed in the app.py by updating the default BAUD_RATE configuration.

Data Collection from TCP/IP Source

1. Connect edge node to network
2. Go to Gateway Configure Screen, Select TCP/IP Radio Button
3. Enter the Device ID (address:port) into the Text Field and Click Configure
4. The SensiML Gateway is now configured to Stream Data from your Device over Wi-Fi

Data Collection over BLE Source

1. Connect edge node to Gateway over USB serial
2. Go to Gateway Configure Screen, Select BLE Radio and Click Scan
3. Enter the Device ID (which is the port) into the Text Field and Click Configure
4. The SensiML Gateway is now configured to Stream Data from your Device over Wi-Fi

Data Capture and Recognition Mode

Data Capture is for capturing raw sensor data, Recognition is for viewing classification results from machine learning models.

Data Capture

View Sensor Data

Recognition

As well as the recognition results stream whcih shows the classification and model ID.

View Results

Recording Video

In the Gateway Status screen you can start and stop a video source. If you start the video source, it will be recorded along with sensor data when you click the Record Button in the Record to Gateway Widget in Test Mode. You can then download the file to your local machine by hitting the Download Button.

Configure Gateway

BLE Troubleshooting on Linux

NOTE To use Bluetooth as a source you may have to run the following to allow bluepy-helper to access the correct permissions

find ~/ -name bluepy-helper
cd <PATH>
sudo setcap 'cap_net_raw,cap_net_admin+eip' bluepy-helper

Cycle Bloothooth on Linux

Sometimes your BLE gets stuck in a weird state and you need to reset it. Instead of cycling the power, just run this command in your shell. You may also need to power cycle the device.

rfkill block bluetooth && rfkill unblock bluetooth

Disable onboard bluetooth raspberry pi (if you have a dongle)

We have noticed some issues with the raspberry pi BLE data drivers when using a camera and streaming data. We recommend using a dongle for video capture and ble streaming on the rpi. To disable the onboard BLE

add the line to /boot/config.txt

dtoverlay=disable-bt

run the commands, you should see only a single output which is the plugged in usb at hcl0 now

sudo systemctl stop hciuart and sudo systemctl disable hciuart.
sudo hcitool dev

simple-streaming-gateway's People

Contributors

cdknorow avatar cristianpb avatar jublin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.