blob: df091d7eb123863acbfac0f6acbe2dbbd6250185 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# T-937/M Serial Simulator
This directory contains a 'dummy' oven implemented in Python.
It exists mainy to facilitate development of the web client without physical access to an oven (and without wasting energy).
The code has been written and tested with Python 3.11 but should work with most if not all Python 3 versions.
Either the `pyserial` or `websockets` python library is required, depending on the operating mode:
## Serial loopback on Linux
Unfortunately Chromium only offers `udev`-visible kernel tty nodes as WebSerial ports.
Therefore using a fifo or pty (for example with `socat`) will not get picked up by the browser.
Instead, you'll need to either use a kernel loopback driver (like [tty0tty][tty0tty]) or a physical "null modem".
You can use tty0tty like this:
sudo modprobe tty0tty
python simulator/__init__.py /dev/tnt1
# /dev/tnt0 now behaves as if it were a reflow oven
## WebSocket implementation
Alternatively, WebSockets can be used as a transport for developopment.
To run the simulator in websocket mode, omit the serial port argument:
python simulator/__init__.py
# a WebSocket server is now accepting connections at 0.0.0.0:8001
[tty0tty]: https://github.com/freemed/tty0tty
|