Page 1 of 1

Using PiControl0 KB_RESET from within Docker

Posted: 13 Jul 2021, 12:48
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.

Re: Using PiControl0 KB_RESET from within Docker

Posted: 27 Jul 2021, 10:36
by dirk
Hi, maybe this Docker tutorial can help you
https://kunbus-gmbh.atlassian.net/servi ... c=22283296