Skip to content

Commit

Permalink
Add service instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
felipengeletrica committed May 10, 2024
1 parent 13cfb35 commit 13477d8
Showing 1 changed file with 52 additions and 53 deletions.
105 changes: 52 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,11 @@
# 🐍 Python Datalogger for debugging embedded systems
# 🐍 Python Datalogger and MQTT gateway debugging embedded systems and outhers

Like ESP WIFI modules, microcontrollers, Linux serial console etc.

With this program it's possible to save logs from different serial ports just by [configuring the JSON file](#-configuring) (`config.json`), the number of ports and unlimited and each process for processing and saving the logs is with you on separate instances and threads.

## Setup config file

## 🚀 Run the application

create a virtual environment to isolate our package dependencies locally (first run time)
```bash
python3 -m venv env
```

```bash
source env/bin/activate
```

On Windows use:
```bash
`env\Scripts\activate`
```

Install dependencies:

```bash
pip install -r requirements.txt
```

To run the application, simply execute:
```bash
python src/main.py
```

## 💻 Install as a service
To install the app as a service, just run:
```bash
cd services && sudo chmod +x install.sh && sudo ./install.sh
```

Verify service in realtime

```bash
journalctl -u datalogger.service -f
```

Uninstalling

```bash
sudo ./uninstall.sh
```



***
To find the tty port associated with your microcontroller using the `ls /dev/serial/by-path` command, follow these steps:

1. Connect your microcontroller to the computer via the serial port;
Expand All @@ -65,12 +18,12 @@ To find the tty port associated with your microcontroller using the `ls /dev/ser

| Interface | Description | Configuration Example | Implementations Status |
|--------------------|-------------------------------------------------------------------|-------------------------------------------------------------------------|-------------------------|
| Serial-to-File | Serial communication interface for saving data locally. | ```json { "serialport": "...", "baudrate": 115200, "timeout": 5, ... }``` | In progress |
| Serial-to-File | Serial communication interface for saving data locally. | ```json { "serialport": "...", "baudrate": 115200, "timeout": 5, ... }``` | Implemented |
| Serial-to-MQTT | Converts serial data to MQTT messages. **MQTT setup is mandatory.**| ```json { "serialport": "...", "baudrate": 115200, "timeout": 5, ... }``` | Implemented |
| Bluetooth-GPS | Connects GPS devices via Bluetooth. | ```json { "address": "...", "port": 1, "samplingSeconds": 1, ... }``` | In progress |
| Bluetooth-BLE | Connects BLE devices via Bluetooth Low Energy. | ```json { "address": "...", "port": 1, "samplingSeconds": 1, ... }``` | Planned |
| Bluetooth-GPS | Connects GPS devices via Bluetooth. | ```json { "address": "...", "port": 1, "samplingSeconds": 1, ... }``` | Implemented |
| Bluetooth-BLE | Connects BLE devices via Bluetooth Low Energy. | ```json { "address": "...", "port": 1, "samplingSeconds": 1, ... }``` | Implemented |
| Others | Unspecified interfaces causing exceptions for invalid devices. | No specific configuration example provided. | Not applicable |
| MQTT Server | MQTT server setup for Serial-to-MQTT interface. **Mandatory.** | No specific configuration example provided. | Implemented |



Using file `config.json` for configuration for one or multiple serial ports:
Expand Down Expand Up @@ -136,6 +89,52 @@ Example two serial ports:
> Note: The capacity of the data logger depends only on the CPU and disk IO speeds!

## 🚀 Run the application

Create a virtual environment to isolate our package dependencies locally (first run time)
```bash
python3 -m venv env
```

```bash
source env/bin/activate
```

On Windows use:
```bash
`env\Scripts\activate`
```

Install dependencies:

```bash
pip install -r requirements.txt
```

To run the application, simply execute:
```bash
python src/main.py
```

## 💻 Install as a service
To install the app as a service, just run:
```bash
cd services && sudo chmod +x install.sh && sudo ./install.sh
```

Verify service in realtime

```bash
journalctl -u datalogger.service -f
```

Uninstalling

```bash
sudo ./uninstall.sh
```

***

## 👷 Development
Expand Down

0 comments on commit 13477d8

Please sign in to comment.