Serial Communication with Palm OS - Part 2/4
On Ubuntu 18.04 and the commandline
Most modern PC or Laptops do not have a serial-interface anymore. But there are useful USB-Serial-converters on the market. I used a "USB 2.0 to RS232 converter cable with PL2303-Chipset" in this case. It worked without any problem with Ubuntu 18.04 and out of the box.
After the "USB 2.0 to RS232 converter cable" is plugged in, it should be shown up in "dmesg":
sudo dmesg | grep "tty"
In my case "/dev/ttyUSB0" was the correct port.
"jpnevulator" is a suiteable serial-port-sniffer for Linux and can be installed via:
sudo apt-get update && sudo apt-get install jpnevulator
First thing to do, is setting the baud rate to the value, we are usung in the palm-application "SerialComm" - theoretically, it can be any common value (upto 115200) for a serial communication. But keep in mind: The higher the value, the higher the error rate of faulty bits. For this example, we will use: "9600 [bits per second]":
stty -F /dev/ttyUSB0 9600(It is alreay defined in the SerialComm-Application, see: Serial Communication with Palm OS - The Palm OS Applicatio)
In the next example, the value "/dev/ttyUSB0" should be replaced with the value from "dmesg".
In order to read continuously from the serial-port, just run:
sudo jpnevulator --ascii --timing-print --tty /dev/ttyUSB0 --read
- --ascii: translate the incoming-byte-data into readable ascii-code
- --timing-print: print a timestamp with very continues stream of byte
- --tty: use the following serial-port (in this case "/dev/ttyUSB0")
- --read: the modus in which the port is going to be used, in this case: "read"
All parameters, which can be used, can be found here: jpnevulator manual
To test the setup, a palm should be attached to the computer (over the serial port) und should execute a hotsync (no need for a real hotsync, the palm should should just send some data). Make sure nothing is blocking the port, like jPilot or something else. This should be the result:
If now the application "SericalComm" on a Palm (e.g. m100) is used and data is sent to the server (PC), it should look like this:
The next part (3/4) describes, how the data from the application can be read with Java on Ubuntu:
Serial Communication with Palm OS on Ubuntu 18.04 and Java