OK, here's the plan: I have a device that connects to the serial port and is controlled by short, plain ASCII strings. I'd like to write a script file to operate this device for a while until I can get around to porting its regular driver software to OS4. My question is simple. Can anyone here show me how to do this? How do I open it with the required settings, such as 1200 baud 8,n,1, and send a short string from a script. After every command, the device returns a single character to indicate success or failure. Parsing the return would be nice, but I'll run blind if I have to. I think it's possible, and probably not too difficult. I just don't remember how I used to do it.
In a script you can write to SER:. The speed and baud rate are set up by program control, I don't know how to do it from a script.
Note that if you have kernel debug output also going to serial, it will be at the speed set by U-Boot ("baudrate"). The speed etc of SER: may be different.
BTW, I'm using the serial port to control my HF comms RX, although it has a native GUI now. A WeatherFAX decoder is in the process of development.
Thanks. I had forgotten about the debug output. I wonder if that will confuse the device that I want to attach? It's an old X-10 controller called "LynX-10". No longer manufactured, but it sends and receives, so I used to use remotes around the house to trigger other scripts. Now, I just want to use it as a cyclic timer for watering houseplants. I dug up the source for the original Amiga drivers. It's all there, but I'm not sure it's worth porting, since the target hardware is no longer available. Hmm, so I'll add "disabling serial debug" to my list. Thanks! Lyle
it would be easier to knock up a small 68k program to do the job in amiblitz eg.
if openfile ("SER:9600/8N1",1) defaultoutput 1 defaultinput 1 print "command to send" while rtn$="" rtn$=edit$(1) wend popinput:popoutput select rtn$ case "0" print "success" case "-1" print "fasiled" end select closefile 1
Amiblitz might even have some commands to use serial.device directly...
Amiga user since 1985 AOS4, A-EON, IBrowse & Alinea Betatester
Thanks, but I don't have Amiblitz, and I've never used it. For short projects, I usually avoid new languages.
I wrote a suite of tools to do this with style about ten years ago. They are on Aminet as "ARexX-10.lha". It came as three executables: The "core" application that connected with the device and provided an ARexx hub for any applications that wanted access, a "remote" that simply gave a GUI window that showed activity and allowed control, and finally an app that would launch ARexx scripts when certain events were seen on the X-10 channels. Taken together, they worked really well. I automated a few homes with them. Unfortunately, they don't seem to work with OS4. Last night I considered porting them, but I have not yet done ANY ARexx work in OS4, and I'm not sure how same/different it would be. Since the hardware is no longer available, I would probably be developing for an audience of one. I really want to work on this automatic sprinkler system for our vegetable garden, and a script file provides FAR better control than the timers available in the garden store. So I connected the old X-10 interface, and it works! I've written a script to do "cyclic" watering for the daylight hours.. Now to decide whether I want to use drip irrigation, or go flashy with water fountains flying across the deck and landing in the potted tomato plants. Could be pretty showy!
Tomorrow I'll install the tubing. I'll see what might be done with dancing fountains.