Is there a way to emulate a serial device on Linux? I presume it's a character device that you can read and write to? Anyone have insights into this?
Follow

@fikran Depends on what level.. at a high level its just a text stream.. i presume you want to emulate the physical pins and electrical signals.. emulating hardware for SPICE or something? you need to be more specific.

@freemo Yes! Long story short this is something I was reverse engineering a few years ago and figured I would look back into it. It’s a radio programming protocol that communicates over Serial. I got the basics working. However, one of the weird aspects of this is that it requires a hardware serial port on Windows 32-bit. USB serial does NOT work. Why? I don’t know… I was writing radio programming software in python, but got distracted and never came back to it.

I figured I would continue working on this but rather than using the actual radio, I would emulate the radio in software. This’ll also make testing easier, lest I brick a $2000 MSRP radio.

To that end, I need to emulate serial in software and pass it to Windows as COM1. You can do that on Linux with socat, but apparently the socat /dev/pts/{1,2} do not emulate the data flow pins (rst/dtr). In fact, trying to manipulate them results in an ioctl error.

Any ideas on how to do this?

If you’re interested, I wrote a blog post about this a few years back: http://web.archive.org/web/20190116130130/https://farhan.codes/2017/12/04/that-time-i-reverse-engineered-the-motorola-cbep-protocol/

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.