wvdakker / gtkterm

GTKTerm: A GTK+ Serial Port Terminal
GNU General Public License v3.0
104 stars 35 forks source link

[FEAT REQ] Ability to send any combination of line terminating characters `'\r'` and `'\n'`. #46

Open zfields opened 2 years ago

zfields commented 2 years ago

I was recently using GTKTerm to talk to an AT command prompt. However, I was unable to interface with it, because it requires lines to terminate with \r\n. As far as I could tell, GTKTerm only sends \r, so it would not respond.

It would be nice to have two checkboxes in the menu I could click to indicate my desired line terminator.

For example:

Line Termination: [X] carriage return (\r) [ ] new line (\n)

Jeija commented 2 years ago

Have you checked if maybe the "Macros" features could fit the bill for you use case (Configuration -> Macros)? For example, you could configure it such that pressing Ctrl+Return generates \r\n like so: image

Afterwards, don't forget to save your configuration to make it persistent when restarting GTKTerm.

Since your use case is probably pretty common, maybe we should add a feature as you suggested anyway?

zfields commented 2 years ago

Awesome! Thank you for the workaround! I had to use a different terminal yesterday... yuck.

Please, please add it as a feature! Cheers!

guitarpicva commented 2 years ago

Agree with OP. This is a real need for many hardware devices which interact with CRLF as the sentence terminator. Typically, terminals will allow CR or LF or CRLF as a user configurable choices. I have driven myself crazy having to remember to hit the F2 macro to send CRLF for come devices.

GTKTerm has been a really faithful partner in my embedded dev. work. Thanks so much!

NOTE: Return is not accepted as the shortcut on my RPi Linux system (RPiOS). That is why I had to use some other key.

bm16ton commented 1 year ago

Agreed, ive come accross a handful of devices that simply wont work with gtkterm because of line ending issues. Old esp8266 firmwares and I believe the arduino lib that creates fake nordic bluetooth uart devices are some. Im completely lost with gtk but did manage to add a newline and carriage return options, unfortunately it doesn't deselect the previous selection and haven't figured that out. My only other complaint is when using a lot of serial devices it requires to many clicks to change ports/port settings, say you dont know a baud rate its a ridiculous amount of clicks. I helped solved that a lil by adding an apply button in settings, tho a small bar at bottom of screen like the new search would have been preferable. Only other thing i can think of and its a nitpick is sometimes entire commands need to be entered in micro seconds, currently Ill type the command in say a text editor then copy/paste it in. If I ever figure out a quick select bar at bottom Id add a place to type and click submit. But hands down after trying every serial terminal I could find gtkterm is miles ahead, best feature is its ability to cope with and even reconnect to disconnected serial ports (IE usb). Every serial QT app and ive seen, most/all crashes and burns on unexpected removal. Back to line endings.For reasons I cannot explain when encountering a device incompatible with with gtkterm that only changing the newline settings on remote device seems to fix, I receive nothing, and since it happens so far and in between I never think of that as the issue, I assume its the firmware I just wrote etc.Im unaware of any reason newline settings would keep anything from printing. At least the old esp8266 firmwares showed text and simply required pressing enter twice.They used old telnet style with nl and cr reversed. One quick question when adding my nl/cr settings I wasnt sure If in newline mode I should just drop all CR's or replace them with NL, When replacing all seems fine tho I believe it was double spacing everything, when dropping CR's entirely Id get strange results when printing large amounts of data IE random tabs/spaces and sometimes the first charactor of each line would randomly disappear or be placed somewhere incorrect. Probly my sh**ty patch job.. Maybe someone more intelligent can figure out the deselect etc, heres my code https://github.com/bm16ton/gtkterm crap just realized I never updated this, It should work but is even uglier then my current version which will hopefully find on my hdd's somewhere.