forked from sfera-labs/exo-sense-py-modbus
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,681 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Build image | ||
# $ docker build -t micropython-client-rtu -f Dockerfile.client_rtu . | ||
# | ||
# Run image | ||
# $ docker run -it --rm --name micropython-client-rtu micropython-client-rtu | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
# use "volumes" in docker-compose file to remove need of rebuilding | ||
# COPY ./ /home | ||
# COPY umodbus /root/.micropython/lib/umodbus | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
|
||
CMD [ "micropython-dev", "-m", "examples/rtu_client_example.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Build image | ||
# $ docker build -t micropython-host-rtu -f Dockerfile.host_rtu . | ||
# | ||
# Run image | ||
# $ docker run -it --rm --name micropython-host-rtu micropython-host-rtu | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
# use "volumes" in docker-compose file to remove need of rebuilding | ||
# COPY ./ /home | ||
# COPY umodbus /root/.micropython/lib/umodbus | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
|
||
CMD [ "micropython-dev", "-m", "examples/rtu_host_example.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# build all non-image containers | ||
# $ docker-compose -f docker-compose-rtu-test.yaml build | ||
# can be combined into one command to also start it afterwards | ||
# $ docker-compose -f docker-compose-rtu-test.yaml up --build | ||
# | ||
|
||
version: "3.8" | ||
|
||
services: | ||
micropython-client: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.client_rtu | ||
container_name: micropython-client | ||
volumes: | ||
- ./:/home | ||
- ./registers:/home/registers | ||
- ./umodbus:/root/.micropython/lib/umodbus | ||
- ./fakes:/usr/lib/micropython | ||
expose: | ||
- "65433" | ||
ports: | ||
- "65433:65433" # reach "micropython-client" at 172.25.0.2:65433, see networks | ||
networks: | ||
serial_bridge: | ||
# fix IPv4 address to be known and in the MicroPython scripts | ||
# https://docs.docker.com/compose/compose-file/#ipv4_address | ||
ipv4_address: 172.25.0.2 | ||
|
||
micropython-host: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.test_examples | ||
container_name: micropython-host | ||
volumes: | ||
- ./:/home | ||
- ./umodbus:/root/.micropython/lib/umodbus | ||
- ./fakes:/usr/lib/micropython | ||
- ./mpy_unittest.py:/root/.micropython/lib/mpy_unittest.py | ||
depends_on: | ||
- micropython-client | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
micropython-dev -c "import mpy_unittest as unittest; unittest.main(name='tests.test_rtu_example', fromlist=['TestRtuExample'])" | ||
networks: | ||
serial_bridge: | ||
# fix IPv4 address to be known and in the MicroPython scripts | ||
# https://docs.docker.com/compose/compose-file/#ipv4_address | ||
ipv4_address: 172.25.0.3 | ||
|
||
networks: | ||
serial_bridge: | ||
# use "external: true" if the network already exists | ||
# check available networks with "docker network ls" | ||
# external: true | ||
driver: bridge | ||
# https://docs.docker.com/compose/compose-file/#ipam | ||
ipam: | ||
config: | ||
- subnet: 172.25.0.0/16 | ||
gateway: 172.25.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# | ||
# build all non-image containers | ||
# $ docker-compose build | ||
# can be combined into one command to also start it afterwards | ||
# $ docker-compose up --build | ||
# | ||
|
||
version: "3.8" | ||
|
||
services: | ||
micropython-client: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.client_rtu | ||
container_name: micropython-client | ||
volumes: | ||
- ./:/home | ||
- ./umodbus:/root/.micropython/lib/umodbus | ||
- ./fakes:/usr/lib/micropython | ||
expose: | ||
- "65433" | ||
ports: | ||
- "65433:65433" # reach "micropython-client" at 172.25.0.2:65433, see networks | ||
networks: | ||
serial_bridge: | ||
# fix IPv4 address to be known and in the MicroPython scripts | ||
# https://docs.docker.com/compose/compose-file/#ipv4_address | ||
ipv4_address: 172.25.0.2 | ||
|
||
micropython-host: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.host_rtu | ||
container_name: micropython-host | ||
volumes: | ||
- ./:/home | ||
- ./umodbus:/root/.micropython/lib/umodbus | ||
- ./fakes:/usr/lib/micropython | ||
depends_on: | ||
- micropython-client | ||
networks: | ||
serial_bridge: | ||
# fix IPv4 address to be known and in the MicroPython scripts | ||
# https://docs.docker.com/compose/compose-file/#ipv4_address | ||
ipv4_address: 172.25.0.3 | ||
|
||
networks: | ||
serial_bridge: | ||
# use "external: true" if the network already exists | ||
# check available networks with "docker network ls" | ||
# external: true | ||
driver: bridge | ||
# https://docs.docker.com/compose/compose-file/#ipam | ||
ipam: | ||
config: | ||
- subnet: 172.25.0.0/16 | ||
gateway: 172.25.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.