mapid/README.md

83 lines
2.5 KiB
Markdown
Raw Normal View History

2023-10-15 11:11:20 +02:00
# MAPID Malte's Arduino-Powered Info Display
2023-10-15 11:39:14 +02:00
Info display powered by two parts:
1. Command line OS running on Arduino (MAPID/CP)
2. Python pyserial script controlling the display over a serial connection
2023-10-15 18:00:37 +02:00
## Requirements
- Arduino libraries
2023-10-29 21:43:57 +01:00
- [SerialCommand Advanced](https://github.com/shyd/Arduino-SerialCommand)
- [serLCD](http://playground.arduino.cc/Code/SerLCD)
*Note: This is not the official library, but an old one found on the legacy Arduino Playground!*
2023-10-15 18:00:37 +02:00
- Python libraries
- pyserial
- python-dotenv
2023-10-29 21:43:57 +01:00
## Configuration
2023-10-15 18:00:37 +02:00
2023-10-29 21:43:57 +01:00
MAPID is configured using a dotenv file. Currently you have to set three options:
`SERIAL_DEV`
: Serial device file. `/dev/ttyUSB\*` on Linux, `/dev/cu.usbserial-*` on macOS.
`SERIAL_SPEED`
: Speed (in Baud) of the serial connection. `9600` is the default value of the Arduino Sketch.
`FIFO`
: File name for the FIFO. Note that systemd uses a private `/tmp` for services, so the Web-UI cannot access these files, and you have to use a different location.
An example file for GNU/Linux:
```sh
# Serial device
SERIAL_DEV="/dev/ttyUSB0"
# Serial baud rate
SERIAL_SPEED=9600
# FIFO filename
FIFO="/var/mapid/fifo"
```
## Components
### `MAPID-CP/`
An Arduino sketch containing the command line os *MAPID/CP* (CP=Control Program). It supports some commands to control a LCD and a LED (there are even a few more non-relevant ones):
- Turn the LED on/off: `ON`/`OFF`
- Turn the display on/off: `LCDON`/`LCDOFF`
- Select a line for output: `LINE i`
- Display some text: `ECHO Foo bar`
- Clear the display: `CLS`
### `mapid.py`
A Python library used by the other scripts
### `mapid-count.py`
Displays a fake bomb countdown like in one of those action movies. Written as a first test for Pyserial communication with *MAPID/CP*.
### `fifo_bridge.py`
A Python script that provides a FIFO file to pass commands to *MAPID/CP*. Each line read from that file is directly passed over a serial connection.
### `fifo-webui/`
PHP based Web interface for `fifo_bridge.py` supporting all commands of *MAPID/CP* (except for those without a real purpose, that only return some information relevant for interactive serial connections).
### `notification.sh`
Use the LED and display to show a notification, the purpose of the whole MAPID project.
2023-11-08 19:59:23 +01:00
## Links
- [My blog post about MAPID (German)](https://malte70.de/blog/mapid/)
- Arduino libraries
- [SerialCommand Advanced](https://github.com/shyd/Arduino-SerialCommand)
- [serLCD](http://playground.arduino.cc/Code/SerLCD)