[Solved] Reading VBus with very cheap RS485 USB-Dongle on Raspberry PI Zero (w) produces garbage data

555 views
Skip to first unread message

Benjamin Gniza

unread,
Oct 18, 2017, 11:39:45 AM10/18/17
to Resol Vbus
This is not a question but actually a post to help googlers having the same problem.

Environment:
Problem:
I was unable to get accurate data from the device. Using cat /dev/ttyUSB0 shows data, but vbusdecode is unable to decode it.
Using vbusdecode from here: https://github.com/martinvw/vbusdecode I was able to use the debug option "-d".
Vbusdecode debug displayed a lot of header CRC errors but sometimes it was able to decode some of the "Broadcast for Clearance" messages and even displayed the correct device-ID (0x7840 in my case)

Solution:
I found some posts here with people having similar problems where changing the tty-settings fixed the error. In my case the commandline to change the tty-settings got quite long because I just copied it from stty output posted from an other user. The only thing I had to change was the clocal-setting. In my case clocal needed to be set.
Here is the full string:
stty -F /dev/ttyUSB0 -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke

Hope this will someday help someone :)
Reply all
Reply to author
Forward
0 new messages