Opened 7 years ago

Closed 6 years ago

#8734 closed enhancement (fixed)

SerialConnect replacement

Reported by: pulkomandy Owned by: pulkomandy
Priority: low Milestone: R1
Component: Applications Version: R1/Development
Keywords: Cc: degea@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

BeOS R5 came with SerialConnect. Haiku has no replacement for it.

Moreover, the R5 version uses private APIs and can't be used in Haiku. Possible alternative in the meantime is minicom, but a native GUI app is better.

Attachments (1)

SerialConnect.zip (39.3 KB) - added by pulkomandy 7 years ago.
Preview version of SerialConnect

Download all attachments as: .zip

Change History (16)

comment:1 Changed 7 years ago by axeld

Given the wide spread use of the serial interface nowadays, I don't think it's worth the effort. Sure it would be nice, but as long as there are alternatives, I wouldn't bother.

comment:2 Changed 7 years ago by pulkomandy

Well, I use such tools daily both at home and at work. Not with old-fashioned serial ports, but with usb to UART converters. It has uses when working with microcontrollers.

I need it, so I'll work on it anyway. I don't mind moving it to an optional package if others think it's of no use.

comment:3 Changed 7 years ago by ttcoder

Cc: degea@… added

I'll stay tuned to here and TTY ..etc, both for tunetracker (the touchscreen industry's not quite transitioned to USB yet, and there's no transition to speak of re. audio switcher boxes) and for personal reasons (*cough* HP48 *cough*).

comment:4 Changed 7 years ago by axeld

I would certainly use it as well, but I don't think you and me make the typical user :-)

comment:5 in reply to:  4 ; Changed 7 years ago by siarzhuk

Replying to axeld:

I would certainly use it as well, but I don't think you and me make the typical user :-)

Some days ago Diver has show me the issue in the AbiWord BugZilla about someone's request for Haiku port. Those guys objected that "all 2 of 3 Haiku users should take care about porting on theirs own force". Well, I just want to say that I'm a third potential user of SerialConnect. So we are going to be 100% of Haiku users in this World. :-D

Well, now going serious. Isn't the SerialConnect just a special flavour of terminal application? May be some additions in the Terminal for creating special kind of TTY window/tab will be enough to have a "native SerialConnect replacement"?

comment:6 in reply to:  5 Changed 7 years ago by pulkomandy

Replying to siarzhuk:

Well, now going serious. Isn't the SerialConnect just a special flavour of terminal application? May be some additions in the Terminal for creating special kind of TTY window/tab will be enough to have a "native SerialConnect replacement"?

sort of. If you look at BeOS version, it's easy to notice it started as a copy-paste of Terminal code. However, you still need extra menus (baudrate configuration and so on), and you don't need some of the features (tabs, color profiles). This makes them different enough.

Sure, the main view uses a monospaced font and they both parse ANSI X3.64/ECMA-48 escape sequences. But, the parser for these sequences in our Terminal is quite a mess. So I started porting libvterm (needed some gcc2 compatibility changes) and will try to use it. If it works well, maybe we can use it in Terminal as well.

https://launchpad.net/libvterm

Right now I have the UI set up and a port of libvterm (compiled, not tested yet). I have to build a TermView relying on libvterm for parsing now, and add the BSerialPort based logic.

comment:7 Changed 7 years ago by kp3ft

SerialConnect, or something similar in Haiku, would be greatly useful for us at our FM radio station (and I'm sure for other stations). We've been using BeOS with TuneTracker to run our station every day 24/7 for the last eight years now, and will be switching to Haiku very soon. We need to connect a piece of equipment to the Haiku computer via a serial port for the sole purpose of logging incoming ASCII text. Presently we need to use a separate Windows computer running HyperTerminal. The disadvantage of SerialConnect in BeOS is that the text is not automatically written to a text file, but requires manual copy/paste, which is a problem if there is a power failure... all the logged text would be lost.

comment:8 Changed 7 years ago by axeld

For this you actually do not need SerialConnect (which is more or less just a Terminal that connects to the serial interface), but an application like stty to configure the port. Then you can just do a

$ cat /dev/ports/serial/0 > my-log-file.

Something like this should also work under BeOS. However, Haiku still does not have a working serial driver unless you have a USB serial adapter.

comment:9 Changed 7 years ago by kallisti5

just a quick blurb that PulkoMandy pushed his SerialConnect app upstream a few months ago: http://cgit.haiku-os.org/haiku/tree/src/apps/serialconnect

It needs some love but it's a great start :)

comment:10 in reply to:  8 Changed 7 years ago by kp3ft

Replying to axeld:

For this you actually do not need SerialConnect (which is more or less just a Terminal that connects to the serial interface), but an application like stty to configure the port. Then you can just do a

$ cat /dev/ports/serial/0 > my-log-file.

Something like this should also work under BeOS. However, Haiku still does not have a working serial driver unless you have a USB serial adapter.

Hi, thanks for your help. I'm not sure if this is the right venue for getting advice, but I've been testing out a BeOS machine so I can then duplicate it using a USB-Serial adaptor with Haiku. Unfortunately not having any luck. I've searched Google and BeOS documentation extensively for stty commands to figure it out myself first, but can't seem to get it to work. I tried the following:

Connected BeOS and Windows machines using serial ports and null modem, to verify successful connection. Ran SerialConnect on serial port 1 and it received ASCII text fine from Windows. Closed SerialConnect and ran in Terminal: stty 9600 -parenb -cstopb cs8 ; cat < /dev/ports/serial1

But, now no text received from Windows in the BeOS Terminal window. It must be opening the port, because there are no error messages when I run it in Terminal, and I tried running it when SerialConnect is running and it returns an error saying the port is busy. Is there something I'm doing wrong with the Terminal command?

also tried sending ASCII out to Windows HyperTerminal from BeOS, but no luck:

stty 9600 -parenb -cstopb cs8 ; cat > /dev/ports/serial1

Even tried rebooting and running the Terminal commands, but still no go.

Last edited 7 years ago by kp3ft (previous) (diff)

comment:11 Changed 7 years ago by ttcoder

Sounds like cat et al. are not as device-friendly in BeOS as they are in Haiku.. I remember trying cat (alone, without stty even) in Haiku and having success accessing the serial device at Dane's.. Though the second call would be better off using the "echo" command rather than cat, since in write mode the cat command will just sit there waiting for the user, so rather something like..

stty 9600 -parenb -cstopb cs8 ; echo "teststring" > /dev/ports/serial1

But if reading won't work, the above probably won't work either.

Re. not losing the contents of SerialConnect in case of a power failure, maybe (probably?) that window allows access to scripts and the "hey" command, in which case it's easy to write a script that captures the window contents every 10 seconds and writes it to a file.. Get in touch with Dane @ TT systems if interested.

comment:12 Changed 7 years ago by pulkomandy

Status: newin-progress

comment:13 Changed 7 years ago by pulkomandy

Hi there, I finished the first run of work on SerialConnect. You can now configure the serial ports and log the output to a file. I'd like if you can test this version and report on it before I add it to the Haiku image.

So here's a zip file for you. This is built usig the gcc2 compiler on a fairly recent Haiku nightly.

Changed 7 years ago by pulkomandy

Attachment: SerialConnect.zip added

Preview version of SerialConnect

comment:14 Changed 7 years ago by dsuden

Wow, I just tried it and it worked GREAT. Connected it with a broadcast switcher device and was able to communicate both ways with it, and log results to a file. Nice work!

comment:15 Changed 6 years ago by pulkomandy

Resolution: fixed
Status: in-progressclosed

SerialConnect is now available in nightly images.

Note: See TracTickets for help on using tickets.