Open oriziena opened 4 years ago
strange...
switched protocol to KW2 ... but now i am getting SIGPIPE whenever I manually request a value ...
e.g. command:
sudo /usr/local/bin/vclient -h 127.0.0.1 -p 3002 -c 'detail getVitoBetriebsartHK1,debug on,getVitoBetriebsartHK1'
detail getVitoBetriebsartHK1:
getVitoBetriebsartHK1: SEND 04;WAIT 05;SEND 01 F7 23 01 01;RECV 1 BA
RECV Timeout: 4000 ms
Retry: 3
Unit: BetriebsArt (BA)
Type: enum
Get-Calc: (null)
Set-Calc: (null)
Einheit: (null)
Enum Bytes: 00 Text: WW
Enum Bytes: 01 Text: RED
Enum Bytes: 02 Text: NORM
Enum Bytes: 04 Text: H+WW FS
Enum Bytes: 03 Text: H+WW
Enum Bytes: 05 Text: ABSCHALT
Enum Bytes: <default> Text: UNKNOWN
debug on:
getVitoBetriebsartHK1:
DEBUG:Wed May 13 16:40:31 2020 : Command: getVitoBetriebsartHK1
DEBUG:Wed May 13 16:40:31 2020 : Process 22126 tries to aquire lock
DEBUG:Wed May 13 16:40:38 2020 : Process 22126 got lock
DEBUG:Wed May 13 16:40:38 2020 : >FRAMER: open device /dev/ttyUSB0 ProtocolID 00
DEBUG:Wed May 13 16:40:38 2020 : Configuring serial interface /dev/ttyUSB0
DEBUG:Wed May 13 16:40:38 2020 : >SENT: 04
DEBUG:Wed May 13 16:40:38 2020 : >FRAMER: no preset result
DEBUG:Wed May 13 16:40:38 2020 : Waiting for 05
DEBUG:Wed May 13 16:40:40 2020 : <RECV: 05 (2000.0 ms)
DEBUG:Wed May 13 16:40:40 2020 : >SENT: 01
DEBUG:Wed May 13 16:40:40 2020 : >SENT: F7
DEBUG:Wed May 13 16:40:40 2020 : >SENT: 23
DEBUG:Wed May 13 16:40:40 2020 : >SENT: 01
DEBUG:Wed May 13 16:40:40 2020 : >SENT: 01
DEBUG:Wed May 13 16:40:40 2020 : >FRAMER: no preset result
DEBUG:Wed May 13 16:40:40 2020 : <RECV: len=1 04 (20.0 ms)
DEBUG:Wed May 13 16:40:40 2020 : <RECV: received 04
DEBUG:Wed May 13 16:40:40 2020 : 04 -> H+WW FS
DEBUG:Wed May 13 16:40:40 2020 : H+WW FS
H+WW FS
log:
20062] Wed May 13 16:33:27 2020 : TCP socket 3002 opened
[20062] Wed May 13 16:33:39 2020 : Client connected 127.0.0.1:59860 (FD:1)
[20062] Wed May 13 16:33:39 2020 : Child process started with pid 20118
[20118] Wed May 13 16:33:39 2020 : Command: detail getVitoBetriebsartHK2
[20118] Wed May 13 16:33:39 2020 : Command: debug on
[20118] Wed May 13 16:33:39 2020 : Command: getVitoBetriebsartHK2
[20118] Wed May 13 16:33:39 2020 : Process 20118 tries to aquire lock
[20118] Wed May 13 16:33:39 2020 : Process 20118 got lock
[20118] Wed May 13 16:33:39 2020 : >FRAMER: open device /dev/ttyUSB0 ProtocolID 00
[20118] Wed May 13 16:33:39 2020 : Configuring serial interface /dev/ttyUSB0
[20118] Wed May 13 16:33:39 2020 : >SENT: 04
[20118] Wed May 13 16:33:39 2020 : >FRAMER: no preset result
[20118] Wed May 13 16:33:39 2020 : Waiting for 05
[20118] Wed May 13 16:33:39 2020 : <RECV: 05 (170.0 ms)
[20118] Wed May 13 16:33:39 2020 : >SENT: 01
[20118] Wed May 13 16:33:39 2020 : >SENT: F7
[20118] Wed May 13 16:33:39 2020 : >SENT: 33
[20118] Wed May 13 16:33:39 2020 : >SENT: 01
[20118] Wed May 13 16:33:39 2020 : >SENT: 01
[20118] Wed May 13 16:33:39 2020 : >FRAMER: no preset result
[20118] Wed May 13 16:33:39 2020 : <RECV: len=1 00 (20.0 ms)
[20118] Wed May 13 16:33:39 2020 : <RECV: received 00
[20118] Wed May 13 16:33:39 2020 : 00 -> WW
[20118] Wed May 13 16:33:39 2020 : WW
[20118] Wed May 13 16:33:39 2020 : Command: quit
[20118] Wed May 13 16:33:39 2020 : Process 20118 released lock
[20118] Wed May 13 16:33:39 2020 : Received SIGPIPE
[20118] Wed May 13 16:33:39 2020 : Received SIGPIPE
[20118] Wed May 13 16:33:39 2020 : Received SIGPIPE
[20118] Wed May 13 16:33:39 2020 : Received SIGPIPE
[20118] Wed May 13 16:33:39 2020 : Received SIGPIPE
Same problem here. Sometimes it works, sometimes it does not.
If it fails I get a new process with high CPU load (in this case 18417).
ps aux|grep vcont
nobody 18301 0.0 0.5 4996 2692 ? Ss 17:31 0:00 /usr/local/sbin/vcontrold
nobody 18417 45.6 0.4 5004 2048 ? R 17:33 0:07 /usr/local/sbin/vcontrold
vcontrold sets a signal handler here:
while (1) {
sockfd = listenToSocket(listenfd, makeDaemon);
if (signal(SIGPIPE, sigPipeHandler) == SIG_ERR) {
And this is the output we see:
static void sigPipeHandler(int signo)
{
logIT1(LOG_ERR, "Received SIGPIPE");
// FIXME: And we do nothing here? Why do we handle it then?
}
I am no expert in this. But for me it looks like we have a problem if two processes try to work on the tty device ...
As far as I tested right now it happens only using vclient. Using telnet I never got a SIGPIPE. Reading here looks like vclient is gone away while vcontrold still tries to write to the socket.
I replaced line 946 in vcontrold.c
if (signal(SIGPIPE, sigPipeHandler) == SIG_ERR) {
by
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
and now it never crashs (even that the source of the problem is not solved).
hi,
I checked things multiple times but as soon as I try to use setaddr I am receiving 'Received SIGPIPE' and vcontrold is repeating that message unlimited times.
pls find attached the vito.xml and vcontrold.xml(see next post...)
version should be latest...
This happens with following example:
when I try to set this e.g. to WW only:
log output:
greetings and thanks for tips and help! ori