-
Serial Connection over browser
06/05/2020 at 17:10 • 0 commentsI recently was able to use the experimental features in chrome to make a serial connection to my Arduino Uno. The first thing I had to do was turn it on by going to `chrome://flags` and enabling Experimental Web Platform features. Next I had to write some code to talk to my device and fortunately there is an excellent tutorial at codelabs where you can work your way through a glitch example using a BBC micro:bit, a nifty little learning device. "But Coach Andrew,
---------- more ----------I thought you said you wanted to communicate with an Arduino not a micro:bit?" Oh, I did but the fundamental part is using the browser to communicate with a connected device.
Browsers were designed to render text, specifically using the Hyper Text Markup Language [HTML] and what is great about browsers is that you can use them on many different devices with many different Operating Systems and expect pretty much the same experience. While presenting only images and text might be the primary focus of a browser it does have the capability to execute scripts and people have been doing all kinds of fascinating things with these scripts so glitch is going to help us learn what scripts are useful to get us going.
After following along and putting the useful code in the proper javascript files I was able to understand what was essentially my paper, marker, scissors, and tape. I took most of the script.js file and added it to the other files in my project. This gave me access to connect/disconnect and read/write. Then I had to test it out.
I just went crazy at first and tried to shove an entire hex file onto my board. Lights flickered and the console informed me that things were happening but somewhere on the other end I was not finishing the lap. Discouraged but not defeated I went to one of my coaches. Coach Ed. Coach Ed asked if I had attempted one of the tried and true first tests of many projects;
Hello World
On my way, with a excitement in my heart, this was something I was confident I could do. Now that we can can break down the steps into the simplest of pieces, we are ready to say hello from the browser.
-
Chromebooks - Chromeduino
07/05/2019 at 20:19 • 0 commentsSince my earlier struggle with BlocklyDuino and the python server I thought maybe I might discover some amazing techniques to communicate with arduino from ChromeDuino. To access a working version I had to find a chromebook and thankfully we have one in the house. On the chromebook I add the app from the chrome web store, set the server to http://barnabasrobotics.com:8888, and attempted to upload the intro file. On the nano I had connected to the chromebook I saw the Rx SMD flicker like last night's fireworks but unfortunately the behavior did not seem to change. So something is happening but without any feedback I am not sure what happened. As far as ChromeDuino was concerned, it worked with the message "Upload Complete! Have a nice day! :) "
This did not help me much. I opened the Serial Com port and the lack of messages there confirmed the upload failed but with a stubborn desire to get it to work and undying hope I tried a different server. Sadly I received the same results.
-
Digging into the existing options
07/05/2019 at 19:26 • 0 commentsWith my goal being something along the lines of allowing students to directly upload to arduino from a curriculum portal, today I will try to at least upload from a web browser. Let's start with BlocklyDuino since visual programmers can reduce the barrier of entry and are used more frequently in younger classrooms. You can try BlocklyDuino out here and you will see an upload option. Here it expects a local web server running at localhost:8080 (127.0.0.1:8080) and more specifically a small python server that will
- attempt to find arduino on the host
- attempt to find the connected USB
- parse out the command
- send the converted c code to arduino
This file had to be edited to work properly on linux, arduino had to be installed, and the user had to be added to the appropriate arduino groups (lock and dialout) I could not connect to the USB on SilverBlue and my assumption is because I am sandboxed behind the devices so I am going to try this on a normal Fedora workstation where arduino is already installed and I have successfully uploaded files in the past.
....
Discovered that Fedora 30 drops python 2 so BlocklyDuino is is out of date. Tried to convert to Python 3 and was almost successful. There were too many changes to the http.server module s I moved over to an Ubuntu 18.04 machine. Once I had the pyhton server loaded I realized I had to
sudo apt install arduino
and add user to the `dialout` group. Almost there and bam I hit a bad file selected -> ! "Processing can only open its own sketches and other files ending in .ino or .pde" which looks like a Java (Arduino IDE) error message showing
java.lang.NullPointerException thrown while loading gnu.io.RXTXCommDriver
Well now, I am not sure which laptop I actually got further but it is apparent that uploading to a USB from the browser is difficult. After saying that, I guess my search moves to how to communicate to a usb device from the browser.
-
grounding my thoughts on the project
07/03/2019 at 21:17 • 0 commentsI have been struggling with Arduino uploading from Chromebooks in a school network. Technical issues elevate discouragement in the classroom so I am looking to improve the experience for students and instructors. The arduino web editor presented me with challenges that have encouraged me to look for other options and while I attempt to put resources into a common location I thought it might be beneficial to have them all work together. One piece at a time I am learning about many technologies that may or may not cohere.
Currently chromeduino only works as a Chrome app on chromebooks but, late to the game, I have learned that support for this was deprecated / discontinued 2 years ago. You can look this up in a web search and most articles like this one on Ars Technica suggest that Progressive Web Apps are the future and since I am, like I said, late to the game, the future is already here. Sigh.
As I am learning about podman, and containers in general, on my recent install of Fedora Silverblue I thought I would give caterpillar a try. Caterpillar is an "experimental project" [that] "investigates whether it is feasible to automatically port Chrome Apps to web sites".
I did not get very far and the project makes no promises. So... here I am pondering my next steps.
My goal is to have "try it" break outs or on-page sections that allow students to not only follow along with curriculum but upload it to their device. This is exciting to me and might be a ridiculous way to solve a simple problem but that is the direction I am headed. Until then, I will eat the elephant one bite at a time learning about all the exciting tools in the open source universe.