This project provides a web-based serial monitor for communicating with devices like Arduino, ESP32, and other microcontrollers connected via USB to an Orange Pi running Ubuntu. It allows users to choose the serial port, change the baud rate, send and receive data, and optionally view the data in different colors for sent and received inputs. Additionally, it offers a RESTful API for interacting with serial ports.
- Serial Monitor: Communicate with connected devices via USB.
- Baud Rate and Port Selection: Dynamically change the baud rate and port through the web interface.
- Auto Scroll: Optionally enable/disable automatic scrolling in the terminal.
- API: Exposes APIs to check available ports, send data, and receive data.
- Clear Input: Automatically clears the input field after sending data.
- Orange Pi running Ubuntu
- Python 3.x
- Flask
pyserial
library for serial communication
-
Clone the repository:
git clone https://github.com/yourusername/serial-monitor.git cd serial-monitor
-
Install required dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python app.py
-
Access the web interface in your browser:
http://localhost:5000
- Connect your device (Arduino, ESP32, etc.) to the Orange Pi via USB.
- Open the web interface and select the serial port and baud rate.
- Use the input field to send data to the connected device, and the terminal will display received data.
- Toggle auto-scroll if needed, and clear the input field after sending data.
Endpoint: /api/get_ports
Method: GET
Description: Fetches the list of available serial ports.
Example:
curl http://localhost:5000/api/get_ports