Using PiControl0 KB_RESET from within Docker

Topics about the Software of Revolution Pi
Post Reply
artur
Posts: 2
Joined: 31 Mar 2021, 12:26
Answers: 0

Using PiControl0 KB_RESET from within Docker

Post by artur »

Hi,

I'm trying to run the

Code: Select all

ioctl(this.piControl , 0x4b0c, null);
call from a docker container to reset the driver after as a modbus device connection does not recover automatically. Basically, emulate a `piTest -x` command.

When I run `ioctl(this.piControl , 0x4b0c, null);` naively with NodeJS it works fine, however, when I do it from within a Docker container it appears to corrupt the piControl file and I have to go in with a manual `piTest -x` command to fix it.


I've tried to add `SYS_TTY_CONFIG` to the container's capabilities.

I've tried `r+` and `w+` for file descriptor:

Code: Select all

this.piControl = fs.openSync("/dev/piControl0", "r+");
The `ioctl` commands returns a 0 in the container and does not error out.
User avatar
dirk
KUNBUS
Posts: 1924
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: Using PiControl0 KB_RESET from within Docker

Post by dirk »

Hi, maybe this Docker tutorial can help you
https://kunbus-gmbh.atlassian.net/servi ... c=22283296
Post Reply