Microcontroller programmable from chromebook, android, iOS,

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
stienman
 
Posts: 3
Joined: Sat Oct 09, 2010 11:35 am

Microcontroller programmable from chromebook, android, iOS,

Post by stienman »

I'm probably asking for pie in the sky here, but I'm running a weekly "Early Engineers" class which, among other things, will teach some programming with a microcontroller target. The age group is 8-11.

I had assumed I would find a microcontroller that would support programming from any device a student might bring. Last semester I used CircuitPython on a RP2040 board, and unfortunately could not find a good, easy way to program that from anything besides a PC. I could have put the chromebooks into linux mode, but I didn't want to have to configure each one individually and deal with their peculiarities. We only have 12 hours of class time.

What I'd prefer is a circuitpython/micropython web interface on, say, an esp32. You connect to the device wifi, open your browser and are dropped into a python editor with main.py. Something very simple and straightforward. This would work from any browser.

I have searched and haven't found anything like this.

Before I develop a crummy version of what I'd like to have - are there any other good options I should look into?

Note that the budget for the microcontroller is only $10-$15.

For a broader perspective, here's my syllabus:

Early Engineers 2022 Spring Syllabus

Understand a complex problem by breaking it up into smaller pieces, and learn how to apply electrical, mechanical, and software design skills to craft a solution!

Requirements: Laptop, chromebook, or tablet computer
Fee: $50

Feb 1 Engineering principles and class project
Feb 8 Snap circuits - Transistors
Feb 15 Multimeter basics - Measuring voltage, current, and resistance
Feb 22 Schematic and PCB design
Mar 1 Schematic and PCB design
Mar 8 Sensors
Mar 15 3D design principles - shapes: combining and subtracting
Mar 22 3D enclosure design
Mar 29 Programming: functions
Apr 5 Programming: arrays and data handling
Apr 12 Flow chart programming
Apr 19 Assemble, test, debug
Evening Extravaganza - show off your project!

Yes, it's quite a quick pace, but it's not meant to bring them up to novice level in 12 hours, rather to help them experience several different aspects of engineering, and at the end have something they made, including an assembled PCB, 3D printed enclosure, and simple program they can tweak at home long after the class has ended.

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Microcontroller programmable from chromebook, android, i

Post by Franklin97355 »

I'll check to see if there is a solution.

stienman
 
Posts: 3
Joined: Sat Oct 09, 2010 11:35 am

Re: Microcontroller programmable from chromebook, android, i

Post by stienman »

franklin97355 wrote:I'll check to see if there is a solution.
Thanks, I appreciate your time looking into this!

I'm just really surprised no one has done this yet for a micro. Certainly it wouldn't be the first time someone made a python web interface, though not on a microcontroller. While it requires a bit of code, the newer circuitpython devices have 4MB - 32MB of flash and can handle something simple.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Microcontroller programmable from chromebook, android, i

Post by adafruit2 »

circuitpython should be easy to program from a chromebook - tablets are much harder and don't have a way to type code in - how would you expect them to code on a tablet with a web ide?

stienman
 
Posts: 3
Joined: Sat Oct 09, 2010 11:35 am

Re: Microcontroller programmable from chromebook, android, i

Post by stienman »

Yes, I agree that typing code into a tablet is annoying, but I'm not expecting these students to develop thousand line long programs. Most of my students have tablets (Android, iOS, Amazon's peculiar version of Android), one has a chromebook, and two others have old laptops. Requiring higher end equipment prevents people from learning, particularly those most vulnerable to economic inequity. I want to lower the bar as much as possible while still teaching very basic engineering principes that include electronics, mechanics, programming, etc. It's hard to do that on a budget with a raspberry pi (assuming you can even find enough for the class), and connecting a larger display and keyboard to the device we're programming is also expensive for some - unless we also include the cost of a keyboard and screen large enough to be useful for programming.

So far I'm using MicroPython* on ESP32 and I have it set up to read a config file, and either set up an AP, or connect to a network. The OLED displays the SSID and the IP address of the device**.

I enable WebREPL, and a small webserver that serves exactly one page: an HTML file that contain

I'm serving one webpage, which consists of the MicroPython WebREPL client with the two javascript files minified and embedded into the HTML. The total size is 67kbytes, so not small, but manageable. I tried gzipping it and serving it as a gzipped file (reduces the entire file to under 20k) but ran into issues - probably not giving the right header - and I'm not going to chase it down unless the size really becomes an issue.

I've tested it with chrome on MacOS, but still need to test it with Safari on iOS, and Chrome on Android, Chromebook, and Windows.

Further I still need to develop a simple IDE that allows editing a python file in the browser. REPL is great, but it's not meant for python script editing. For starters I'll probably just have the webpage load a specific file into a <textarea>, then when a "save" button is pressed the contents of the textarea are posted to the server on the ESP32, which saves it to the file. This file would run on startup, so worst case scenario they can update the file and test it using the webrepl interface which will issue errors and give feedback about the script. I'd rather not have them reboot the device just to run the script.

It falls far short of a full IDE, but it's pretty much all I need for this level of teaching, and it allows far more people to participate than requiring everyone to have more than a tablet or phone, and install specific software into their device. Even chromebooks are annoying to use with micro and circuit python, I still haven't found a good way that works universally across chromebooks up to 3 years old, and doesn't require 20+ minutes of configuration per device, etc, etc, etc.

Anyway, assuming I can get the tablet and chromebook browsers to cooperate, this is how I'll proceed.

*Yes, I know this community prefers Circuitpython, but I can't run webrepl, nevermind a webserver, in the background while the student's script is running on CircuitPython. Horses for courses and all that...

** The device has:
- Custom PCB
- ESP32 WROVER E N16R8
- 13x13 color LED matrix
- 64x128 tiny OLED
- RTC clock/crystal/battery
- Stereo amplifier and two speakers
- DHT11 temperature and humidity sensor
- capacitive touch buttons (Free with order of PCB! ;)
- Two continuous rotation servos with wheels
- 3D printed enclosure
- Under $50

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Microcontroller programmable from chromebook, android, i

Post by tannewt »

stienman wrote: *Yes, I know this community prefers Circuitpython, but I can't run webrepl, nevermind a webserver, in the background while the student's script is running on CircuitPython. Horses for courses and all that...
Yet. :-) I've been playing around with MDNS and thinking about a web workflow for CircuitPython. I've laid out my ideas here: https://github.com/adafruit/circuitpython/issues/6174 Please chime in there how well it'd work for you.

Generally, I've been assuming that the editing device will have internet as well so that it can load more js. It shouldn't be hard to have a minimal version that can work offline.

Please also checkout code.circuitpython.org. Right now it only works with BLE but could also be the basis for the web workflow. I think the editor there is pretty decent on mobile.

User avatar
dougsellner
 
Posts: 4
Joined: Sat Dec 23, 2017 9:38 am

Re: Microcontroller programmable from chromebook, android, i

Post by dougsellner »

Regarding order: 2803384
I purchased 1 x Slamtec RPLIDAR A1 - 360 Laser Range Scanner[ID:4010] = $99.95
The state range is 12M however I barely get 1M range.

I asked customer support for an RMA to exchange for a working model but they insist that I post here for an RMA or swap - I really do want one that works tho.

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Microcontroller programmable from chromebook, android, i

Post by Franklin97355 »

@dougsellner Please post your issue in another topic and forum. The "other products from Adafruit" is a good choice. Thanks

User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

Re: Microcontroller programmable from chromebook, android, i

Post by westfw »


User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Microcontroller programmable from chromebook, android, i

Post by tannewt »

That's very cool! Thanks for the link.

User avatar
rmb
 
Posts: 11
Joined: Thu Mar 07, 2013 2:42 pm

Re: Microcontroller programmable from chromebook, android, i

Post by rmb »

I realize that I am late to the party but I also was looking for a multiplatform solution for programming a microcontroller. Code.org has a drag and drop programming environment using javascript that "should" work with adafruit's circuit playground. It is web based and should work across platforms. That bing said I could not get it to consistantly work in my classroom but our school network is a tragedy and I could never track down the reason for the inconsistancy.

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”