Closed dilyanpalauzov closed 2 years ago
I had to call strace -f
. This is the output of stdbuf -o0 -e0 strace -s2048 -f ../sources/inverter-cli/build/inverter_poller -d &> /home/pi/m.txt
-
m.txt
As can be seen, it contains:
[pid 5016] openat(AT_FDCWD, "/dev/hidraw1", O_RDWR|O_NONBLOCK) = 3
[pid 5016] ioctl(3, TCGETS, 0x76ba1d78) = -1 EINVAL (Неправилен аргумент)
[pid 5016] ioctl(3, TCGETS, 0x76ba1d70) = -1 EINVAL (Неправилен аргумент)
[pid 5016] ioctl(3, SNDCTL_TMR_START or TCSETS, {B2400 -opost -isig -icanon echo ...}) = -1 EINVAL (Неправилен аргумент)
[pid 5016] ioctl(3, TCFLSH, TCOFLUSH) = -1 EINVAL (Неправилен аргумент)
[pid 5016] stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2121, ...}) = 0
[pid 5016] write(1, "Mon Mar 7 17:08:12 2022 INVERTER: Current CRC: F8 54\n", 54Mon Mar 7 17:08:12 2022 INVERTER: Current CRC: F8 54
) = 54
[pid 5016] openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_APPEND, 0666) = 4
[pid 5016] _llseek(4, 0, [0], SEEK_END) = 0
[pid 5016] fstat64(4, {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x3), ...}) = 0
[pid 5016] ioctl(4, TCGETS, 0x76ba0e50) = -1 ENOTTY (Неподходящ ioctl за устройството)
[pid 5016] write(4, "Mon Mar 7 17:08:12 2022 INVERTER: Current CRC: F8 54\n", 54) = 54
[pid 5016] close(4) = 0
[pid 5016] write(3, "QPIRI\370T\r", 8) = 8
...
[pid 5016] write(1, "Mon Mar 7 17:08:13 2022 INVERTER: QPIRI: incorrect start/stop bytes. Buffer: (230.0 21.7 230.0 50.0 21.7 5000 5000 48.0 48.0 44.0 59.5 54.7 2 02 100 0 1 3 9 01 0 1 54.0 0 1 0000004 000\n", 187Mon Mar 7 17:08:13 2022 INVERTER: QPIRI: incorrect start/stop bytes. Buffer: (230.0 21.7 230.0 50.0 21.7 5000 5000 48.0 48.0 44.0 59.5 54.7 2 02 100 0 1 3 9 01 0 1 54.0 0 1 0000004 000
) = 187
It was a matter of setting qpiri=102
.
I compile
sources/inverter-cli/build/inverter_poller
and set in config/inverter.confdevice=/dev/hidraw0
. Then I callstdbuf -e0 -o0 strace -s2048 ../sources/inverter-cli/build/inverter_poller -d |&tee /root/m
. This is the output m.txtAs can be seen, under /dev no device is opened.