FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
367 views 0 comments
by anonymous
Hi Teltonika,
I most likely discovered a bug that hinders us using your product.
We use the RTU955 with a USB Serial adapater forwared via TCP (sodog). It seem the interface calls (ioctl) are not setup for raw transparent mode. I used strace and could see that e.g. IGNBRK is not set. This was actually the trigger for looking deeper into the issue as our protocol we are using above that USB serial <-> TCP connection is using 03h. We use all 8 bits of a byte and can not afford to put a base64 encoder on the microcontroller on the other end.
Please respond ASAP on how we can proceed.
Thank you.
 

2 Answers

0 votes
by anonymous

Hello, 

Regarding the requirement you are looking for it may require some custom development may be in the hardware or firmware side. It would be best if you discuss it with your sales account manager for such changes.

Our SDK is open for public Software Development Kit - Teltonika Networks Wiki (teltonika-networks.com)

Regards,
Mellow

+1 vote
by anonymous

Hi,

if this is a bug or a new feature might be a philosophical question as I could not find in any documentation how the character translation is setup in USB serial mode. On the other hand the physical RS232 connection is setup in raw mode. I would assume that most customers would expect the same from an USB serial device.

I could not find the source code of the (most probably proprietary) sodog daemon which is responsible for this situation. But I could find a workaround using the RTUs user script functionality which I would like to share for those who might run into the same situation. The code looks like this:

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

echo -e "#!/bin/sh\nwhile true; do\n stty -F /dev/ttyUSB0 raw > /dev/null 2>&1\n stty -F /dev/ttyUSB1 raw > /dev/null 2>&1\n stty -F /dev/ttyUSB2 raw > /dev/null 2>&1\n stty -F /dev/ttyUSB3 raw > /dev/null 2>&1\n stty -F /dev/ttyUSB4 raw > /dev/null 2>&1\n stty -F /dev/ttyUSB5 raw > /dev/null 2>&1\n sleep 10\ndone\n" > /tmp/usbSetter.sh

chmod 755 /tmp/usbSetter.sh

/tmp/usbSetter.sh &

exit 0

It will create on startup a shell script /tmp/usbSetter.sh and starts it as independent "daemon". This daemon will set every 10s every of the USB serial devices into raw mode (ignoring any errors). This works now flawless with any binary protocol running over USB serial.

This at least gives us a working solution for now. But I would really like to have this implemented into sodog. I understand that changing sodogs behaviour into raw mode might break something for other customers which might depend on the exisiting translation (e.g. if a real console is connected to it or an old school printer). I suggest making a forced raw mode as a checkbox available in the GUI, while leaving it unchecked as a default. In this way nothing changes on existing installations but at the same time allows one to use raw mode (as with RS232) whenever needed.

Any feedback is welcome.
Thank you.