https://github.com/christophkarlheck/serial-data-logger-phyto-node-classifier
https://github.com/christophkarlheck/serial-data-logger-phyto-node-classifier
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.8%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: ChristophKarlHeck
- License: mit
- Language: Python
- Default Branch: main
- Size: 31.3 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Serial Data Logger for Phyto Node Classifier
serial-data-logger is a Python-based tool for reading, processing, and exporting serial data transmitted via a serial port. It decodes structured data using the FlatBuffers serialization library, converts raw byte measurements into analog voltages, and exports the results to JSON or CSV formats.
Features
- Serial Communication: Reads structured binary data from a serial port.
- Data Conversion: Converts 3-byte raw data into analog voltages using configurable parameters (
databits,vref,gain). - Custom Export Options:
- Exports processed data to either JSON or CSV files.
- Appends to existing files if specified.
- Console Visualization: Prints processed data in a human-readable format.
Requirements
- Python: Version 3.8 or later
- Libraries:
pyserialflatbuffers
Install dependencies using the provided requirements.txt file:
bash
pip install -r requirements.txt
Command-Line Arguments
| Argument | Required | Description |
|-----------------|--------------|-------------------------------------------------------------------------|
| --port | Yes | Serial port to read from (e.g., /dev/ttyS0 or COM3). |
| --baudrate | No | Baud rate for serial communication (default: 115200). |
| --path | No | Path to save the output file (default: current directory .) |
Example Commands
Log Data to a CSV File
bash
python3 main.py --port /dev/ttyACM0 --baudrate 115200
Docker
Build the Docker Image
bash
docker build -t serial-data-logger-classifier .
Run in Docker
bash
docker run --name serial-data-logger-classifier-container \
--restart=always \
--device=/dev/ttyACM2:/dev/ttyACM2 \
-v /media/chris/e110508e-b067-4ed5-87a8-5c548bdd8f77:/app/output \
--log-opt max-size=10m \
--log-opt max-file=3 \
-d \
serial-data-logger-classifier \
--port /dev/ttyACM2 --baudrate 115200 --path /app/output
How It Works
Data Workflow
Serial Data Read:
- Reads structured binary data over a serial connection using
serial.Serial.
- Reads structured binary data over a serial connection using
Decoding:
- Decodes data using FlatBuffers.
Processing:
- Converts 3-byte raw byte measurements into analog voltages using:
- Configurable
databits(default:8388608). - Configurable
vref(default:2.5V). - Configurable
gain(default:4.0).
- Configurable
- Converts 3-byte raw byte measurements into analog voltages using:
Output:
- Exports processed data to CSV, appending to existing files if applicable.
Owner
- Login: ChristophKarlHeck
- Kind: user
- Repositories: 5
- Profile: https://github.com/ChristophKarlHeck
GitHub Events
Total
- Public event: 1
- Push event: 9
Last Year
- Public event: 1
- Push event: 9
Dependencies
- flatbuffers >=23.5.26
- numpy >=1.21.0
- pyserial >=3.5
- python 3.11.2-slim build