Connecting to old school RS-232
I have a piece of legacy hardware that communicates over RS-232. Currently it is hooked up via a DB25-USB null modem to a Mac which reads the incoming text (at 9600 8N1), processes it, and then spits back its own text over the same serial connection.
I would like to replace the Mac with an Omega2 with a mini dock.
The work done by the Mac is pretty light, so I should be able to recreate the processing on the Omega in PHP or Python.
I figure my first step is to try to connect to the Onion via serial cable using a dumb terminal. Can I use the DB25-USB null modem to connect from the terminal to the USB port on the mini dock? Will I be able to log in to the Omega’s console the way I currently do over WiFi?
With Omega2 in lieu of a Mac (thru USB-RS232 serial dongle)
to communicate with a device that is talking to outside world in RS232....
You can simply use Omega2's Rx/Tx LVTTL serial pins (once you disabled the console out on Rx/Tx.)
You can buy an inexpensive LVTTL serial to RS232 board such as this
to perform the signal level conversion.
I've made a little board that does exactly that! They key is the MAX3232 RS232 level shifter.
@Leif-Bloomquist Thats exactly what I’m looking for. Great job. Building that is beyond the capabilities of my geriatric hands, but if you ever decide to sell them, let me know!
So I'm almost there. Almost.
Inspired by some posts by Mr. Bloomquist, I managed to get my dumb terminal hooked up to the Omega2 through a null modem.
I'm able to send text to the terminal by echoing to /dev/ttyUSB0.
And I'm able to read text from the terminal by cating /dev/ttyUSB0.
But I'm having trouble figuring out how to route a full shell with login to the dumb terminal.
The closest I've come is by issuing the command ash >/dev/ttyUSB0 2>&1 from my shell connection over wifi. But this only echos what I type on the computer connected by wifi to the dumb terminal. It doesn't accept any input from the terminal.
I've tried to figure out how to also route stdin to the same ash session with no luck. But I know it can be done, as demonstrated in Mr. Bloomquist's photos linked above which show a login prompt on a C-64 and a TRS-80 100.
Is it simply a problem of not being able to figure out the correct shell command from the wifi connected terminal, or am I going about it entirely the wrong way?
Did you also have a look at his software? https://github.com/LeifBloomquist/ProjectOmega/blob/master/Scripts/login-c64-2400.sh
Seems to set the baud rate and start a new
ashshell with input and output redirection
#!/bin/ash stty -F /dev/ttyS1 2400 while : do echo "" >/dev/ttyS1 echo "" >/dev/ttyS1 echo "Onion Omega 2+ on Commodore 64!" >/dev/ttyS1 ash -l -c /bin/login </dev/ttyS1 >/dev/ttyS1 2>&1 done
That might not even be the best way to go about it - I hacked around a bit until I got something that worked. Pointed inittab to that script file.
More details and discussion in this thread: https://community.onion.io/topic/2239/commodore-64-supercharged-by-omega2-pictures