WebREPL Javascript Library

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
murilopolese
Posts: 3
Joined: Tue Apr 03, 2018 12:06 pm

WebREPL Javascript Library

Post by murilopolese » Tue Oct 23, 2018 7:08 pm

Hello!

I believe WebREPL is one of the most fantastic things that happened in my life as a hobbyist, educator and professional involved with hardware development*.

Recently I've been attempting to create a standalone javascript library with what I understood from the WebREPL protocol and I'm looking for feedback, help, advice, hugs or a reason to stop doing it.

https://github.com/murilopolese/webrepl-client

My goal with this library is to be able to build web interfaces to interact with hardware without having to install additional software, drivers, daemons, browser extensions or plugins. Web interfaces enable easy development and distribution across a wide range of platforms (anything with a browser**), multiple versions of interfaces for the same hardware/firmware*** and simpler setup for customer applications, workshops and classrooms.

But all those things are actually what WebREPL does, not what my library does. I just didn't wanted to rewrite the whole WebREPL protocol every time. Although I owe big time to the code on https://github.com/micropython/webrepl, it's not that I can reuse its code that easy. Also it uses a very specific way of handling the messages that doesn't quite fit a "modern" javascript approach (whatever this means).

Here is a list of things I made already to illustrate why I think using WebREPL is awesome and where it comes the motivation. Some of them already use early implementations of this library, some use none but will start using from now on:

- Self hosted offline code experience for Kano's Pixel Kit: https://github.com/murilopolese/kano-pixel-kit-pixel32
- Quick and dirt editor for MicroPython: http://flying-circus-ide.herokuapp.com/
- A web interface to control a drawing machine http://fabulous-machines.herokuapp.com https://www.youtube.com/watch?v=DjyCUvQ2Cao
- Custom remote controls for robots, vehicles and other smart stuff https://www.youtube.com/watch?v=YUY0712q7UU https://www.youtube.com/watch?v=orERmnNw00w

* I wrote a little bit about this love relationship here: http://murilopolese.com/buildlog/2018-09-webrepljs.html (Excuse my pidgin English, though!)
** https://caniuse.com/#feat=websockets
*** This is such an important thing when talking about education: Deliver different approaches for learning the same thing without having to replace the hardware. But that is a separated story.

Post Reply