mirror of
https://github.com/daniviga/django-ram.git
synced 2026-09-10 02:37:58 +02:00
Add support for containers and simulation
This commit is contained in:
@@ -130,3 +130,4 @@ dmypy.json
|
|||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
dcc/media
|
dcc/media
|
||||||
|
arduino/CommandStation-EX/build/
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
|
RUN mkdir /opt/dcc && pip -q install pyserial
|
||||||
|
ADD net-to-serial.py config.ini /opt/dcc
|
||||||
|
|
||||||
|
EXPOSE 2560/tcp
|
||||||
|
|
||||||
|
CMD ["python3", "/opt/dcc/net-to-serial.py"]
|
||||||
Regular → Executable
+1
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import logging
|
import logging
|
||||||
import serial
|
import serial
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
FROM dcc/net-to-serial
|
||||||
|
|
||||||
|
RUN apk update && apk add qemu-system-avr && mkdir /io
|
||||||
|
ADD start.sh /opt/dcc
|
||||||
|
ADD CommandStation-EX-uno-*.elf /io
|
||||||
|
|
||||||
|
CMD ["/bin/sh", "/opt/dcc/start.sh"]
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# AVR Simulator
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ podman build -t dcc/net-to-serial:sim .
|
||||||
|
$ podman run -d -p2560:2560 dcc/net-to-serial:sim
|
||||||
|
```
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PTY=0
|
||||||
|
|
||||||
|
if [ -c /dev/pts/0 ]; then
|
||||||
|
PTY=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i "s/ttyACM0/pts\/${PTY}/" /opt/dcc/config.ini
|
||||||
|
|
||||||
|
qemu-system-avr -machine uno -bios /io/CommandStation-EX-uno-*.elf -serial pty -daemonize
|
||||||
|
/opt/dcc/net-to-serial.py
|
||||||
Reference in New Issue
Block a user