Wasmino is an Arduino core fully compatible with the Arduino IDE. It allows you to compile your Arduino sketch to WebAssembly and run it in a browser, all using the Arduino IDE.
The Arduino IDE usually requires a physical board, which can be cumbersome. For example in a classroom setting: holding up an Arduino board showing the entire class a LED blinking is not very doable. This is where Wasmino can be used.
Wasmino can also be used as a stop-gap during the first few classes, giving students time to purchase an actual Arduino board.
Other solutions exist such as 123D Circuits. Wasmino is different as it is integrated with the Arduino IDE, providing a seamless experience - using Wasmino is just like using an actual Arduino board. Migrating to a physical board is also as simple as selecting another board in the Arduino IDE. I believe this is valuable in a classroom setting. Wasmino is also open-source, while most alternative solutions are not.
Needless to say, this project is in a very early stage - feedbacks welcome. Also if you can think of other use cases, let me know!
Great work! And fun timing - this similar project https://github.com/jandelgado/fastled-wasm popped up on Reddit today. It simulates the FastLED library running on an arduino.
There’s also some similar work here: https://github.com/wokwi/avr8js although this does not use wasm, rather it emulates the AVR instructions from the built hex object.
Wow, really great stuff! I wrote something similar for my high school a few years ago (back when I was less experienced with programming -- ack!). I used a library called JSCPP to interpret the C++ directly in the browser.
It included analogRead() and Serial functionality; maybe it can give you some ideas regarding the UI.
This is certainly a neat project, and an accomplishment in its own right.
> The Arduino IDE usually requires a physical board, which can be cumbersome.
But this is the part that makes me a bit uncomfortable. One reason I got into Arduinos a few years ago was that I felt I was getting entirely detached from interacting with any physical aspects of engineering, and learning that, however clumsily (including occasionally burning my fingertips or destroying an unfortunate LED or capacitor) was an interesting part of electronics.
I feel that taking the whole experience virtual is sort of missing the point (Like teaching driving instructions classes in GTA ;-), and as a software engineer, I constantly tried to resist the inner urge to pull every project back into a software direction (No, the project does not need to run an OS, or run on a GHz clocked CPU, or need a ton of storage…).
I completely agree with you that Arduino is incomplete with out the actual hardware. Especially given that Arduino and Arduino clones are incredibly cheap these days. This is more of a fun project which I hope would be useful in specific scenarios.
This looks like a very useful project! It might also be very interesting for testing input-/output-heay code without needing to get a board, very nice.
I was really hoping for WASM running on the Arduino! For the PineTime project we were discussing using WASM to run apps on the smart watch, so that they were running in some safe sandbox that couldn't crash the device.
Tinkercad has a free (as in beer) Arduino simulator tool with a decent number of peripherals. There is a drag and drop interface to make your breadboard and you can even (primitive) dmm and scopes to run tests. I teach Arduino classes (when not affected by covid-19) at my local library to kids and adults with little to no background and I sometimes do a class on using this tool.
I was excited to see this project on HN today. I see a lot of value of Wasmino in that it runs in the browser: it lowers the bar considerably for starters. I remember when I started that the amount of different boards you could buy was overwhelming and being able to try things out before going in the rabbit hole of selecting the right components and boards might definitely helps out some software developers that do not have a strong background in electronics or electrical engineering and make them excited to work in the field of embedded software.
A side project of mine that has become more serious last year is quite similar (https://www.studiotechnix.com/). My tool has the same caveats as Wasmino in that the CPU is modelled as "infinitely fast" and only "time functions" progress time. It is inherent to the method of simulating software coupled to physical models of hardware. Even with these assumptions, simulation can uncover a lot of functional faults / logic reasoning flaws in the embedded application. Testing on real hardware is of course still needed, but iterating on your design in simulation is much faster than on the real hardware. And it provides an easy way towards test automation which is much harder to setup with real hardware.
14 comments
[ 3.1 ms ] story [ 20.9 ms ] threadThe Arduino IDE usually requires a physical board, which can be cumbersome. For example in a classroom setting: holding up an Arduino board showing the entire class a LED blinking is not very doable. This is where Wasmino can be used. Wasmino can also be used as a stop-gap during the first few classes, giving students time to purchase an actual Arduino board. Other solutions exist such as 123D Circuits. Wasmino is different as it is integrated with the Arduino IDE, providing a seamless experience - using Wasmino is just like using an actual Arduino board. Migrating to a physical board is also as simple as selecting another board in the Arduino IDE. I believe this is valuable in a classroom setting. Wasmino is also open-source, while most alternative solutions are not.
Needless to say, this project is in a very early stage - feedbacks welcome. Also if you can think of other use cases, let me know!
There’s also some similar work here: https://github.com/wokwi/avr8js although this does not use wasm, rather it emulates the AVR instructions from the built hex object.
It included analogRead() and Serial functionality; maybe it can give you some ideas regarding the UI.
Here's the source: https://github.com/dpengineering/giffer-reborn
And you can try it here: https://dpengineering.github.io/giffer-reborn/
> The Arduino IDE usually requires a physical board, which can be cumbersome.
But this is the part that makes me a bit uncomfortable. One reason I got into Arduinos a few years ago was that I felt I was getting entirely detached from interacting with any physical aspects of engineering, and learning that, however clumsily (including occasionally burning my fingertips or destroying an unfortunate LED or capacitor) was an interesting part of electronics.
I feel that taking the whole experience virtual is sort of missing the point (Like teaching driving instructions classes in GTA ;-), and as a software engineer, I constantly tried to resist the inner urge to pull every project back into a software direction (No, the project does not need to run an OS, or run on a GHz clocked CPU, or need a ton of storage…).
I'm one of the developers of https://github.com/keyboardio/Kaleidoscope - We've ended up putting together a 'virtual' Arduino core (https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio...) that compiles to native code, so that we can run a simulator and test suites with gtest and gmock. (https://github.com/keyboardio/Kaleidoscope/tree/master/testi... / https://github.com/keyboardio/Kaleidoscope/runs/1632368671?c... ) It's super-useful, but a browser-based sim might be even better for this.
https://www.tinkercad.com/learn/circuits
A side project of mine that has become more serious last year is quite similar (https://www.studiotechnix.com/). My tool has the same caveats as Wasmino in that the CPU is modelled as "infinitely fast" and only "time functions" progress time. It is inherent to the method of simulating software coupled to physical models of hardware. Even with these assumptions, simulation can uncover a lot of functional faults / logic reasoning flaws in the embedded application. Testing on real hardware is of course still needed, but iterating on your design in simulation is much faster than on the real hardware. And it provides an easy way towards test automation which is much harder to setup with real hardware.