For an index to all my stories click this text.
Lately I have been looking into web-based programs that allow to program a Raspberry Pi Pico or ESP32. There are two block-programming based programs called Ioty and Bipes. They work a bit like MIT's App Inventor.
Another thing I have been looking at is Viper Ide. This is an editor for MicroPython programs. I normally use Thonny for creating programs in MicroPython. Thonny is a program that you download onto your computer and then run it. Just like all regular programs.
Viper IDE runs in your browser. You do not need to download anything. Just point your browser to https://viper-ide.org/ and start programming.
This all sounds fine, however I ran into a problem with these web-programs.
Webserial and Webusb
At one time or another you need to connect your microcontroller to your computer with a USB connection. This is to transfer the program from your computer to the microcontroller. And to use USB from your browser, the browser must be able to use Webserial or Webusb. So you can not use Firefox. Chrome does the job.
I am not running a Windows computer (anymore), my system runs Linux. So there is no Chrome browser but there is a derivative called Chromium.
And there I was stuck. Viper IDE told me that it wanted to connect but no compatible devices were found.
As Thonny operated flawless I knew there was nothing wrong with my USB ports. So there must be something wrong with the communication between the webbrowser and the microcontroller.
Safety first
Linux is an operating system that focuses on safety and user rights. Users can not access files, folders and ports without first getting the rights to access them from the administrator (root). And then root can grant access to only read or read and write. This may seem like an annoyance but it makes sure that nobody can get to your data, or delete it, without explicit permission.
And that is what here is the case. We have to grant the webbrowser access to the USB ports. That can be done as follows:
sudo snap connect chromium: raw-usb
This is the command for Kubuntu. Kubuntu is based on Debian so, I presume, this will work on most Debian derivative distributions.
It works
And now it works.
Chromium lists all USB ports and the Raspberry Pico was the first listed,
Play it safe
Although Linux is a really safe operating system it is always better to be safe then sorry. A lot of hackers are around who want to do nasty things on your machine. So what I do is to disconnect the USB port from the web-browser when I am done programming. The command for that is:
sudo snap connect chromium: raw-usb
That's all for now
Till next time
Luc Volders