https://github.com/embox/embox_project_modbus_iocontrol
https://github.com/embox/embox_project_modbus_iocontrol
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/embox/embox_project_modbus_iocontrol
- Owner: embox
- License: bsd-2-clause
- Created: 2021-02-24T15:07:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T13:11:16.000Z (about 2 years ago)
- Last Synced: 2025-01-28T20:06:05.805Z (over 1 year ago)
- Language: C
- Size: 184 KB
- Stars: 1
- Watchers: 12
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# embox_project_modbus_iocontrol
embox_project_modbus_iocontrol is an Embox external project. It demonstrates how to libmodbus work in Embox. There are several target to run this demo:
* Standalong on Linux host
* In Embox on ARM QEMU
* In Embox on STM32F4-discovery
LEDs are emulated On QEMU and on host. The real on-board LEDs are used on STM32f4-Discovery.
To build on host (client and server) you need follow:
* Move to 'modbus/host_cmds' folder
* Build with 'make'
Run an emulation on the host:
* Build client and server
* Move to 'modbus/emulate' folder
* Run server './led-server'
* To run web-site you can go to 'modbus/http_admin' and run built-in python http server `python3 -m http.server --cgi -d .` Then you can check the LEDs states on a browser.
* To run the modbus client. Go to 'modbus/emulate' and run './led-client -a 127.0.0.1 set 78' to set up led 78 to high state or './led-client -a 127.0.0.1 clr 78' to low state
Run an emulation on the ARM QEMU:
* Build the modbus client
* Setup the project as external in Embox `make ext_conf EXT_PROJECT_PATH=`. For example `make ext_conf EXT_PROJECT_PATH=~/git/embox_project_modbus_iocontrol`
* Configure Embox `make confload-ext_project/modbus/arm_qemu`
* Build Embox `make`
* Run Embox `./scripts/qemu/auto_qemu`
* To run the modbus client. Go to 'modbus/emulate' and run './led-client -a 10.0.2.16 set 78' to set up led 78 to high state or './led-client -a 10.0.2.16 clr 78' to low state
* Additionally you can check state in your browser if visit page with 10.0.2.16 address
Run on a STM32F4-discovery board
* Build the modbus client
* Setup the project as external in Embox `make ext_conf EXT_PROJECT_PATH=`. For example `make ext_conf EXT_PROJECT_PATH=~/git/embox_project_modbus_iocontrol`
* Configure Embox `make confload-ext_project/modbus/stm32f4_discovery_demo`
* Setup you network settings in 'conf/start_script.inc' file
* Build Embox `make`
* Upload image on the board
* To run the modbus client. Go to 'modbus/emulate' and run './led-client -a "board IP" set 3' to set up led 3 to high state or './led-client -a "board IP" clr 3' to low state
* Additionally you can check state in your browser if visit page with "board IP" address