You are not logged in.
Hi All,
I have a device here that speaks rs232. I would like to dissect each packet individuality, and then place the decoded packet into a listbox, much the same way as wireshark does this.
I can imagine I am not the first person that must decode a RS232 protocol. Is there a library or program that can do this?
I'm sorry for my english, I am not a native speaker.
Best regards,
Cedric
Last edited by cdwijs (2013-05-21 11:21:49)
Offline
RS-232 is a physical layer standard and does not have a concept of "packets". If you are connected to a device that transmits data by RS-232, you can usually get the bitstream from /dev/ttyS<something>, but you will have to figure out what kind of protocol it uses before you can tell whether a compatible library or program exists.
Many, maybe most connection protocols over RS-232 are one-offs. What kind of device is it?
Offline
Thanks Trend,
It's indeed a one-off. Its a probe for the MDB bus, used for vending. To complicate things I do not have the protocol description :-)
The probe converts the MDB signals to ascii chars, and add a timestamp. The packets are all seperated from each other by some idle time.
What I'm looking for is a way to do a search and replace on the received data.
Regards,
Cedric
Offline
Huh, that's funny -- I was reading about MDB just the other day because I was looking for a good definition of "multidrop" and couldn't figure out how vending machines were supposed to be relevant.
If you can figure out which /dev/ttyS* device it is when plugged in, you should be able to read the character data straight from there using your programming language of choice. (Run `tail -f /dev/ttyS<n>` and generate some data for the probe to report -- repeat for all values of <n> until one of them starts spewing ASCII characters at you.) Beyond that, you're pretty much on your own unless you can find more information on the link protocol -- maybe try contacting the probe's manufacturer, if the company is extant (and you're not working for their competitors)?
Offline
I have just found out com2tcp. This is written to make a virtual comm port on computer A, then convert it into TCP, and then send it to computer B, and then convert it back into a comm port on computer B.
http://sourceforge.net/projects/com0com/
If i use this, then I can use wireshark to see the communication between computer A and B, and then write a decoder for wireshark. I think this is easyer than wrting a terminal program, as all the infrastructure is in place, and already tested and documented.
Has somebody already done this?
Regards,
Cedric
Offline