Skip to content

A growing collection of basic python examples demonstrating how to communicate with USB sensors from sglux GmbH

License

Notifications You must be signed in to change notification settings

sglux/usb-sensor-python-examples

Repository files navigation

USB Sensor communication

The current USB based sensors from sglux present a virtual serial port to the USB host. They employ the royalty free Modbus protocol to transmit measurement data and receive configuration data.

The examples are valid for all UV sensor probes from sglux with the option "USB output".

Examples of such sensors are: UV surface, UV cosine and UV air probes.

UV surface   UV cosine   UV air

How to run

Please download the latest code from ZIP oder clone the repository.

Extract to a folder of your choice. Then locate your shell to that folder, no matter if you are on Windows (CMD or powershell) or Linux (bash or whatever shell you prefer).

Check or install the required packages, for instance by calling pip install -r requirements.txt once.

Start the individual examples by typing python example-1-sensor-summary.py and so on.

Example 1: Read parameters and some data

This example reads parameters and captures 100 consecutive readings from the first sglux USB sensor detected on the system (further sensors are ignored). The gathered data is written do a CSV file (placed in the current folder) displayed in the terminal as well.

Start it by typing python example-1-sensor-summary.py

Click here for further details.

Issues

If you discover an issue or somthing does not work as expected please first start a discussion before opening an issue ticket (as these are reserved for bugs not support ;-)

Thank you!

About

A growing collection of basic python examples demonstrating how to communicate with USB sensors from sglux GmbH

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages