More fun with RS232-C

I need to do some RS232-C communications from a java program. My initial investigations suggest that java support for serial port connections is at best rudimentary and that the dedicated solutions are mostly old and poorly maintained.

I odn’t need all that much sophistication from the solution so I may be able to get away with treating ‘\.\COM10’ as a file type device and simply streaming bytes to and from it. I’m currently putting together a setup here at home that will help to play with the alternatives.

I bought a null modem adapter on the way home at a local computer shop (I was mildly surprised they still stocked them, but they had a broad selection of RS232 adapters).

Turned out that the pin 2/3 swap wasn’t the issue after all though.

I’m using some old multi-port hardware I have lying around and the four port adapter that I’ve got plugged into my ubuntu linux machine labels its ports 1->4 but they map ttyUSB3->ttyUSB0 in linux. Once I played musical serial ports it became clear that was the problem and I could move forward.

Since I need two sides to the interaction, I started spinning together a simple non-blocking responder in C++ on the linux side. Once that is done I can experiment with java based solutions driven from the windows side.

Looks like tonight I may be at the point where I can try some more interesting communications than two copies of putty shoving keyboard characters at each other. If all goes well I may try plugging my serial adapter into one of my raspberry pi controllers as well to see if it will be recognized and run there…that would make for a very nice test target.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.