Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 05:23 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite terminal woes (via Chromebook)

     Page 1 of 2    
Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 06:53pm 15 Aug 2022
Copy link to clipboard 
Print this post

Forked from https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=15100 to keep the threads clean.

Background
Accessing PicoMite via terminal apps on Chromebook.  Initial teething issues ironed out by making sure baud rate is selected and in most cases, plugging in the device before starting the App (not sure if that is necessary or just a quirk of how Chromebooks mount the USB serial).

One thing persisted - in all Chrome terminal apps, once working, pressing the backspace key did not register anything.  To get backspace, you needed to press CTRL-Backspace.

In digging, I found that this was an issue / feature of the underlying Chromium applications for terminal access.  By default (and not user selectable) backspace sends  '\x7f' instead of ('\x08', aka ^H) as required.  

Some more digging and I find that SerialTerm is OpenSource, so I forked it on GitHub and made those changes.  

It works -- backspace functions as required.

I've now paid my Google Developer fee ($5) and will be adding PicoMite Term to the Google Web apps so that I can use this in schools with a functioning backspace key.

Interesting journey for day one back in the land of the mostly functional    

N
Entropy is not what it used to be
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 07:05pm 15 Aug 2022
Copy link to clipboard 
Print this post

Super. Thanks for digging deep. Does this mean it will be in the cromebook web app store (i.e., an extension)?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 09:20pm 15 Aug 2022
Copy link to clipboard 
Print this post

  lizby said  Super. Thanks for digging deep. Does this mean it will be in the cromebook web app store (i.e., an extension)?


What a can of worms I've opened....

Google have retired the ChromeOS functionality to package a web app as opposed to an extension in Chrome.  As a result, I have fixed this and can make the files available as a zip. Manually in ChromeOS Chrome "chrome://extensions/" will allow you to Load Unpacked -- which means load a local  / personally made etension.

So it works.

But - according to my dive into Google Chrome developer land, during 2023 a chrome update will kill that off -- but its not clear if this is for all OSes including ChromeOS - and that is assuming that the update is processed.

For me, this is "OK" as I can get schools to manually load the ChromeAPP from files I make available to them -- but I suppose its a gamble how long it will continue to work.

Happy to post a zip -- you can then poke around in the source if you want.

I now hate Chromebooks....

N
Entropy is not what it used to be
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 09:35pm 15 Aug 2022
Copy link to clipboard 
Print this post

Please do post the zip.

I'm pretty happy with my 3 ebay used Chromebooks which cost me between $42 and $49, and glad to see PicoMite development available on them. It would have been a pain not having backspace work, since I make a lot of typing errors.

I did not succeed in getting Linux to work, which I had mistakenly thought would be needed to get a terminal to run so I could program the PicoMite. All three devices are quite old, but I can't see that that makes a difference for most of what I want to do with them.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 09:40pm 15 Aug 2022
Copy link to clipboard 
Print this post

  lizby said  Please do post the zip.

I'm pretty happy with my 3 ebay used Chromebooks which cost me between $42 and $49, and glad to see PicoMite development available on them. It would have been a pain not having backspace work, since I make a lot of typing errors.

I did not succeed in getting Linux to work, which I had mistakenly thought would be needed to get a terminal to run so I could program the PicoMite. All three devices are quite old, but I can't see that that makes a difference for most of what I want to do with them.


Will post - my development Chromebook also from ebay - same price.

Bipes.net.br/ide has an online IDE that can connect to the PicoMite -- select Pi Pico and connect -- it works well (except it has the same problem with the backspace) - but at least its online.

I'm swapping emails with the developers of Bipes to see if we can get just the editor availble  and fix the backspace key -- that way it will work for the PicoMite.

Will add the zip to this thread tomorrow ;-)

Cheers
N
Entropy is not what it used to be
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 10:24pm 15 Aug 2022
Copy link to clipboard 
Print this post

As a final touch tonight:  https://googlechromelabs.github.io/serial-terminal/ is the official Google Labs for Web Serial terminal -- it works, but also has the issue (SHIFT-BACKSPACE) in this case.

Have contacted them and forked their Git.  

Will update when / if I get it working (the BACKSPACE that is) it seems to work "as is" (sent the baud low enough first)

N
Entropy is not what it used to be
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 10:48pm 15 Aug 2022
Copy link to clipboard 
Print this post

  Nimue said  baud low enough


Mine is working, though without extensive testing, at 115200.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 10:50pm 15 Aug 2022
Copy link to clipboard 
Print this post

  lizby said  
  Nimue said  baud low enough


Mine is working, though without extensive testing, at 115200.


My brain can only handle 56k at the moment - so that's my default.

Have forked the Git and contacted the rep owner to see about the \x08 escape code.

I really went down the rabbit hole today on this one.

Shedders, really really good to be back with you.

N
Entropy is not what it used to be
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 11:21pm 15 Aug 2022
Copy link to clipboard 
Print this post

Final piece on this -- the Google developers assure me "its working like it should" and offer me this:  "My best guess is that the code on the Pi is not interpreting ^? as backspace"

At this point its one for Peter / @matherp -- does  ^? mean anything for the interpretation of BACKSPACE..

Its late and too much fun has been had.

Nos da all.

Cheers
N
Entropy is not what it used to be
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 12:08am 16 Aug 2022
Copy link to clipboard 
Print this post

  Nimue said  does  ^? mean anything for the interpretation of BACKSPACE


I'm not sure what they mean by that. On my chromebook, with this code

dim string ch: do: ch=inkey$: if ch<>"" then: print asc(ch);" ";: endif: loop

<backspace> returns 127 (DEL); <Ctrl+backspace> returns 8; <Shift+backspace> returns 127.

I don't know what "^?" might have to do with MMBasic.

Swapping the returned values for <backspace> and <Ctrl+backspace> would seem likely to fix this problem for Serial Term.

(I'm pretty sure that I had previously seen <backspace> acting as <Delete> in some other application, but I can't replicate that now.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 12:13am 16 Aug 2022
Copy link to clipboard 
Print this post

^? isn't special but ^ is often used to indicate 'control' control-H works as destructive backspace. control-? does nothing.
Any standard terminal program will have the backspace key programmable.
In Teraterm, it's the delete key that gets programmed:



Good luck with trying to get them to change it.

Jim
Edited 2022-08-16 10:16 by TassyJim
VK7JH
MMedit   MMBasic Help
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 705
Posted: 01:06am 16 Aug 2022
Copy link to clipboard 
Print this post

The backspace thing has always been a thorn in my side ...
I just tried ' SCREEN ' and it has the problem ..
IIRC ' MINICOM ' also .
( This is on a Raspberry Pi ( FWIW ) )
my site
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3641
Posted: 07:13am 16 Aug 2022
Copy link to clipboard 
Print this post

On Linux, apps may be affected by the stty settings (use stty -a to see them), especially of erase.

For me, the default makes backspace do what I expect but YMMV.

John
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 10:05am 16 Aug 2022
Copy link to clipboard 
Print this post

Final update after a long and deep dive.

It transpires that the Google team behind the ChromeOS use someone else's library called "xterm" to provide serial emulation under JavaScript. The Google team wont change this and referred me back to them.

The xterm library is well used to provide web interfaces to USB serial and is seen as the de-facto standard replacement for the old Chrome Apps.  The team behind xterm made the decision that the backspace key will send the DEL character unless it is SHIFTED.  So to get "backspace" as we understand it in these terminal emulators it is hard coded that you need SHIFT-BACKSPACE  (or in some cased CTRL-BACKSPACE).   [Not really sure over the reason behind this, but apparently its been in xterm like this for years, so they wont change it for reasons of not knowing who is relying on the way it currently works]

Fortunately the Google code is opensourced so I forked it and changed the default from SHIFT-BACKSPACE to just BACKSPACE.

I threw it up at: http://nerklegroup.co.uk/terminal/ eventually I am likely to tweak this some more so any comments greatly recieved.

Tested on PC, Mac and ChromeBook -- BACKSPACE works as expected.

N
Entropy is not what it used to be
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3641
Posted: 04:29pm 16 Aug 2022
Copy link to clipboard 
Print this post

Chromebook doesn't have stty or the like?

John
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 05:34pm 16 Aug 2022
Copy link to clipboard 
Print this post

When working in the Program Editor on a PicoMite while connected with Serial_Term it's helpful to have these codes from the manual handy, since the chromebook doesn't have function keys:


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 06:09pm 16 Aug 2022
Copy link to clipboard 
Print this post

I'm trying to get a handle on a workflow for the Picomite on chromebook. I tried Nimue's terminal, but "Add a port" didn't show any port available, and clicking "Connect" didn't cause anything to happen.

I restarted Serial_Term, connected, and tried AUTOSAVE (which had worked for just typing in a few lines), but Ctrl+V didn't work to paste (I had proven that I had copied text successfully by having a file open in CodePad, copying it with Ctrl+A, Ctrl+C, opening a new CodePad window, and using Ctrl+V to paste it in).

What magic will give me a port to open in the nerklegroup terminal?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3641
Posted: 06:36pm 16 Aug 2022
Copy link to clipboard 
Print this post

Or does a Chromebook have something akin to xmodmap?

As with stty erase it can change any key combination to be a code you choose.

John
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 06:53pm 16 Aug 2022
Copy link to clipboard 
Print this post

  JohnS said  Or does a Chromebook have something akin to xmodmap? [or stty]


Those aren't questions I am able to answer. Chromebook is predominately for people who don't want to and don't have to look under the surface. I have very little experience with it. I tried to install access to Linux so I could use such things as stty, but failed as it turned out to be much more complicated than I anticipated (and maybe my older used chromebooks lacked some features which make it easier on later models).

But Nimue's pointing out of how to get a terminal working provides much of what I wanted, and with the ability to shape the terminal's handling of special characters and key combinations, chromebook can probably be made into a good tool for programming a PicoMite. I just have to get that terminal to see the PicoMite as Serial_Term did.

And maybe there are character conversion utilities available.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 07:21pm 16 Aug 2022
Copy link to clipboard 
Print this post

Not sure if its relevant here but:

Our Chromebooks all have the Linux subsystem installed.  (some ludicrous ICT support reason I am sure).

They are all so old that they are no longer receiving Google updates.

After connecting the device (don't mount it in Linux) you will need to refresh the web page so that the "Connect / Add" features can find the port the USB has been assigned.  

We find that limiting the baud to 56k helps with these slower devices (but that could just be heresay).

This has worked in a school setting today - but to be honest, its not great  -- the TeraTerm experience via Windows is super smooth and almost bullet proof in comparison.

N
Entropy is not what it used to be
 
     Page 1 of 2    
Print this page
© JAQ Software 2024