Skip to content

Commit

Permalink
Merge pull request #3 from lukakiro/master
Browse files Browse the repository at this point in the history
Dockerized modbus-scan-serial script
  • Loading branch information
sourceperl authored Oct 31, 2020
2 parents 1d3fc92 + 452e16f commit c340b76
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.8-buster

RUN apt-get update && \
apt-get install -y git python3-setuptools

RUN git clone https://github.com/sourceperl/modbus-serial-monitor.git

WORKDIR /modbus-serial-monitor

RUN python3 setup.py install

ENV DEVICE=/dev/ttyAP0
ENV BAUDRATE=115200

CMD ["sh", "-c", "python3 scripts/modbus-scan-serial --device=$DEVICE --baudrate=$BAUDRATE --parity=N"]

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ Store all traffic on modbus.log file

$ modbus-scan-serial > modbus.log

## Use it with docker

$ docker build -t modbus-serial-monitor .
$ docker run -it --device=/dev/ttyUSB2:/dev/ttyUSB2:rwm -e "DEVICE=/dev/ttyUSB2" -e "BAUDRATE=460800" modbus-serial-monitor

0 comments on commit c340b76

Please sign in to comment.