You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kikimor 7f04566242 barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
..
.env.example barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
README.md barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
app.py barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
backend_client.py barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
config.py barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
requirements.txt barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
serial_bridge.spec barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
serial_reader.py barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago
tray_icon.py barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh 2 months ago

README.md

Serial Bridge - COM Port Reader

This is the serial port reading application that runs as a system tray service.

Features

  • Reads data from COM ports
  • Runs in system tray (no console window)
  • Automatically posts data to Django backend
  • Retry logic for failed posts
  • Backend health checks
  • Configurable via environment variables
  • Can be packaged as a Windows .exe

Setup

  1. Install Python dependencies:

    pip install -r requirements.txt
    
  2. Configure environment:

    copy .env.example .env
    # Edit .env with your settings
    
  3. Run the application:

    python app.py
    

Building as EXE

To create a standalone Windows executable:

pip install pyinstaller
pyinstaller serial_bridge.spec

The executable will be created in the dist\ScalesApp\ folder.

Configuration

Edit .env to configure:

  • COM_PORT: COM port to read from (default: COM1)
  • BAUD_RATE: Serial port baud rate (default: 9600)
  • BACKEND_URL: Django backend URL (default: http://localhost:8000)
  • AUTO_CONNECT: Automatically connect on startup (default: True)
  • DEBUG: Enable debug logging (default: False)

Architecture

COM Port → Serial Reader → Backend Client → Django API
                             ↓
                         System Tray Icon

Logging

Logs are written to serial_bridge.log and console output.

Troubleshooting

  • COM port not found: Check COM_PORT setting and device connection
  • Cannot connect to backend: Verify Django server is running on BACKEND_URL
  • Data not posting: Check logs in serial_bridge.log
  • Tray icon not appearing: Run as administrator, check Windows settings