User avatar
jbeale
Posts: 3884
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

develop for Pico using (older) Chromebook?

Sat Apr 10, 2021 10:42 pm

I am able to use Thonny on a Pi, an Intel Linux box, and Windows 10 to develop in MicroPython for the Pico. So far, so good.
What if I want to use a Chromebook- an older model, which does not seem to like Crostini?

I found that Beagle Term does see the Pico as a serial device, and it shows all the print() output from my Python program running on it.
https://chrome.google.com/webstore/deta ... bgoggdpoea

Does that mean it should be possible to somehow use Thonny or an equivalent on the Chromebook... ?

A similar post implies this is recently possible if you are able to use Crostini. viewtopic.php?t=301252

I see that there is a Chrome extension called "Micropython" but it appears to only work with the BBC micro:bit (?)
https://chrome.google.com/webstore/deta ... o?hl=en-GB

fruitoftheloom
Posts: 27097
Joined: Tue Mar 25, 2014 12:40 pm

Re: develop for Pico using (older) Chromebook?

Sun Apr 11, 2021 8:22 am

jbeale wrote:
Sat Apr 10, 2021 10:42 pm
I am able to use Thonny on a Pi, an Intel Linux box, and Windows 10 to develop in MicroPython for the Pico. So far, so good.
What if I want to use a Chromebook- an older model, which does not seem to like Crostini?

I found that Beagle Term does see the Pico as a serial device, and it shows all the print() output from my Python program running on it.
https://chrome.google.com/webstore/deta ... bgoggdpoea

Does that mean it should be possible to somehow use Thonny or an equivalent on the Chromebook... ?

A similar post implies this is recently possible if you are able to use Crostini. viewtopic.php?t=301252

I see that there is a Chrome extension called "Micropython" but it appears to only work with the BBC micro:bit (?)
https://chrome.google.com/webstore/deta ... o?hl=en-GB

If you Chromebook is to old to support Cristoni, probably best to "unlock" and install Linux, as it is likely near end of official support.

https://chromium.googlesource.com/chrom ... #supported
I am a volunteer, take what I advise as advice not the utopian holy grail.

User avatar
jbeale
Posts: 3884
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: develop for Pico using (older) Chromebook?

Sun Apr 11, 2021 2:34 pm

Mine is an "Acer Chromebook 15 C910-C453" which still runs fine. For the model name Acer C910, it looks like Auto Update Expiration is only two months from now, sad to say. I have other options but I was also asking the question in general. A lot of people might want to use a Chromebook for this and not be able to change the OS. For example our local schools have standardized on Chromebooks and every student has one. I believe they're fully locked down in general, but it might be an easier sell to the district IT people to get a Chrome extension approved for those doing a computer course, than opening up Crostini.

hippy
Posts: 10310
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: develop for Pico using (older) Chromebook?

Mon Apr 12, 2021 12:09 am

Chromium, so I guess Chrome too, has some sort of magic which allows USB serial devices to be accessed from a web page, and Chrome Extensions and Apps are able to do that. I tried Beagle Term - It installed and loaded on my Pi found my serial link but isn't talking to my Pico- works when the correct /dev/ttyACM* is selected and Thonny is closed

Unfortunately I don't have a Chromebook, Chrome Apps don't now seem to run on anything else, and I haven't got that magic to work from a web page, and none of the pages which ought to work do. Though I haven't invested much time on that.

I'd like to see a MicroPython which offers a REPL over Telnet, even SSH. I'm sure there must be some way it could be a web page server which is actually a REPL console accessible using any modern browser.

Update : This now works for me - https://bipes.net.br/aroca/web-serial-terminal - I have written web page IDE's and that should allow downloads and Thonny style operations.

User avatar
jbeale
Posts: 3884
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: develop for Pico using (older) Chromebook?

Mon Apr 12, 2021 2:48 am

Thank you for that tip, it is quite interesting and I was unaware of this feature. Sure enough running Chromium on my Pi4, and with Thonny closed, I was able to turn on "Experimental Web Platform features" and then use https://bipes.net.br/aroca/web-serial-terminal/ to open the serial port "Board in FS mode (ttyACM0) - Paired" to the Pico, so that much works. Even better, trying this on my actual Chromebook does work for access to the Pico REPL. I can cut and paste text to and from the serial terminal view of the Pico REPL, so that is a good first step.

Thus far I had relied on Thonny to handle editing a program, running it, and saving it to the Pico's Python filesystem area either under its own name or as 'main.py' so it can run at poweron. I can edit text files anywhere so I don't need Thonny for that, but can running and saving .py files be done from the Micropython REPL, or is there some background magic that happens through some other channel to make that work?

hippy
Posts: 10310
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: develop for Pico using (older) Chromebook?

Mon Apr 12, 2021 12:16 pm

jbeale wrote:
Mon Apr 12, 2021 2:48 am
I can edit text files anywhere so I don't need Thonny for that, but can running and saving .py files be done from the Micropython REPL, or is there some background magic that happens through some other channel to make that work?
That I believe is best done by entering the Raw REPL mode, Ctrl-A to enter. Works with 'minicom' (Ctrl-A twice) but Thonny traps that as a Thonny keyboard shortcut. That allows code to be pasted and executed invisibly, so you can send something like ....

Code: Select all

s = """... my program ..."""
with open("myfle.py", "w") as f:
  f.write(s)
You can also do that at the standard REPL. That's what I did, send commands one at a time over the serial link, don't show what's echoed.

To get a file from the file system, something like -

Code: Select all

with open("myfile.py", "r") as f:
  print(f.read())
I recall there's some 'ubinascii.hexlify' encoding or protocol functionality which MicroPython includes and uses to support binary file transfer which isn't as limiting as the examples above. The 'ampy' and 'rshell' source should reveal how they do it.

So, a rather late TL:DR; it should be possible to save to, load from, a Pico using a web page editor, command the Pico to execute editor code, just like Thonny. It shouldn't take much effort to turn such a web page into a Chrome App for the ChromeBook if that's preferred, or a Chrome Extension.

Now doing it all; that's a different matter.

User avatar
jbeale
Posts: 3884
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: develop for Pico using (older) Chromebook?

Mon Apr 12, 2021 3:37 pm

Thank you, this is excellent information. I'm reading up on 'rshell' now, which I wasn't aware of. It does look like the various parts exist to put this together. Having a Thonny-like webpage, in the way that https://bipes.net.br/aroca/web-serial-terminal/ is a VT100-like webpage, seems useful enough that I'm surprised someone hasn't already done it. But I guess most developers have access to regular Win/Mac/Linux boxes and not just Chromebooks.

hippy
Posts: 10310
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: develop for Pico using (older) Chromebook?

Tue Apr 13, 2021 11:56 am

hippy wrote:
Mon Apr 12, 2021 12:09 am
Chrome Apps don't now seem to run on anything else
Having said that, when scrolling through my Start Menu on my Pi Desktop I noticed a section for "Chromium Apps" which included "Beagle Term" I just installed and an old "zoom" I had forgotten about.

So it seems some sort of 'Chrome App' is supported to some extent on non-Chromebooks. And that is extremely useful because it means such apps can be developed without a Chromebook, on a Pi, and should just work on a Chromebook.

rafaelaroca
Posts: 1
Joined: Mon May 10, 2021 1:17 am

Re: develop for Pico using (older) Chromebook?

Mon May 10, 2021 1:35 am

Hi! I have seen some comments about a web based serial terminal at bipes website.

BIPES is also a quick and simple tool for Pico development using older chromebook or older computers. It is fully web based, and allows Python or block based programming directly from the browser, without the need of any software installation:

About:
http://www.bipes.net.br/

Use it:
https://bipes.net.br/beta2serial/ui/

(Select Raspberry Pi Pico on the top right select box, to see blocks specific to RPi Pico)

A quick demonstration video:
https://www.youtube.com/watch?v=Tl3IhwwoYqY

hope it is useful

best regards!
Rafael
BIPES Project

User avatar
jbeale
Posts: 3884
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: develop for Pico using (older) Chromebook?

Wed May 12, 2021 3:59 am

Thank you Rafael for the BIPES project. I have tried this page out and (after flailing around through several ways it didn't work, which I still don't understand) I did eventually get it to work with a Pico board, and I was able to run a test block-style program, and see the Python code also. Nice work!

Return to “MicroPython”