OK
The pipe is started in systemctl
A proxy is set up:
…
pi@raspberrypi:~/RpiNtripBase $ more baseProxy@.service
[Unit]
Description=Socat TCP-proxy for the serial port of the base
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=10
ExecStart=/usr/bin/socat -d -d TCP-LISTEN:2102,fork,reuseaddr FILE:/dev/ttyACM0,b%i,raw
[Install]
WantedBy=multi-user.targe
…
and the injection & str2str server to ntripcaster is started
…
pi@raspberrypi:~/RpiNtripBase $ more str2str-injectrtcm1008.service
[Unit]
Description=str2str with RTCM 1008 injected
After=network.target
After=ntripcaster.service
[Service]
Type=simple
Restart=always
ExecStart=/bin/bash -c “/usr/bin/socat -u TCP:localhost:2102 - | /usr/bin/python3 /usr/local/bin/rtcmadd1008.py | /usr/local/bin/str2str -out ntrips://:testi@localhost:2101/STALL”
[Install]
WantedBy=multi-user.target
…
But
If the sys.stdin.buffer.read(n) does not go further before getting n bytes
Then it must have been asking only for 0 or 1 bytes for packet_data ??
As next line:
crc24_data = sys.stdin.buffer.read(3)
has also been executed and is not waiting
and we have now gone down to
message_number = (packet_data[0] << 8) + packet_data[1]
message_number >>= 4
where we got the IndexError
So if there would have beeen a packet with:
1BYTE
Preamble
2BYTES
6 bit Reserved
10 Bit for length (this time 0 or 1)
3BYTES
CRC data
Maybe could be possible? Maybe not? But would explain what happened.
Maybe it is best if I just wait and see for a day or a week if this IndexError shows up again. To see how often this might happen and hopefully get more details of the crime and criminals…