Releases: Moddable-OpenSource/moddable
Moddable SDK 4.2
This release contains improvements to the Moddable SDK made between September 9, 2023 and October 2, 2023.
Moddable SDK 4.2 is a substantial update. Highlights of this release include:
- ESP-IDF v5 is here! After a major effort with great community support, we've merged ESP-IDF v5 support to the main branch. (more)
- Developers working with ESP32 will need to update their ESP-IDF (update instruction links below).
- xsbug, our JavaScript debugger, has received a major update to speed your development. (more)
- New breakpoints - conditional, counter, trace, and function name - give you more control.
- A new interactive console lets you evaluate expressions, set values, and call functions -- making it much faster to gain insights into running code without having to change the source code, rebuild, and re-deploy.
- mcpack, our new embedded packager based to make embedded JavaScript development more accessible to developers working on the web platform. (more)
- Uses
package.jsonto drive build, allowing easy use ofnpmand other JavaScript ecosystem tools - Analyzes project code to automatically generate a Moddable
manifest.jsonoptimized for the project - Experimental! Please share your experiences to help evolve
mcpack
- Uses
News
- Save the date! 🎉Ecma TC53 is holding a workshop to discuss proposals and consider options for Embedded JavaScript standardization including new APIs, interoperability, packaging, and Hardened JavaScript. 🎉
- 📆December 6
- 📍Apple Park
- 🧑🏽💻Everyone with relevant expertise welcome
- GitHub Copilot – Members of the community have shared their experiences and opinions about using Github Copilot for embedded JavaScript. Check out the discussion to see how it might help your development.
October Community Update
The monthly Moddable Community Call is now a monthly Moddable Community Update! We'll share more about this soon. Sign up to receive an email notification when new community updates are published.
Release Details
- Devices
- ESP32
- ESP-IDF v5 support is here!
- You must upgrade your ESP-IDF, as builds with ESP-IDF v4 stop with an error message.
- Update instructions are available for macOS, Windows, and Linux.
- The Moddable SDK currently targets ESP-IDF v5.1.1 for all ESP32 family microcontrollers
- There are no changes to the JavaScript APIs on ESP32, so no script changes should be required(!!).
- This release supports the following models in the ESP32 family: ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6, and ESP32-H2.
- The Moddable SDK has been updated to use the latest APIs in ESP-IDF v5 (deprecated APIs are nearly all removed)
- Improvements in the RMT APIs allow the Neopixels module to support multiple strands (on separate GPIO pins)
- New device breadboard build platform targets with displays (mostly ILI9341 and one GC9A01). Great for breadboard prototyping.
esp32/qtpyc3_ili9341esp32/qtpyc2_ili9341esp32/qtpys3_ili9341esp32/xiao_esp32c3_ili9341esp32/xiao_esp32s3_ili9341esp32/esp32h2_ili9341esp32/esp32c6_gc9a01
- ESP-IDF v5 support is here!
- nRF52
$(UF2_VOLUME_NAME)now handled correctly on on Windows (reported by @NextWorldLab) #1207- Include
pwmin Windows build - Improved build messages when building for targets that aren't Moddable Four
- Build improvements to support nRF52 builds of Node-RED MCU using the MCU plug-in (contributed by @NextWorldLab)
- Raspberry Pi Pico
- New device breadboard build platform targets. Great for prototyping.
pico/ili9341_i2s(includes speaker output)pico/qtpy_ili9341
- New device breadboard build platform targets. Great for prototyping.
- ESP8266
- ESP32
- Tools
- xsbug has received a major update
- Enhancements to breakpoints for faster debugging
- Conditional breakpoints - break only when a JavaScript expression evaluates to rue (e.g
this.dx > 3) - Counter breakpoints - break after a counter reaches a specified threshold (e.g. on the 10th time, every 60th time, the first 3 times)
- Function name breakpoints - break on all calls to a specified function name across all source files (e.g.
onReadable) - Trace breakpoints - instead of breaking, these trace the evaluation of a specified JavaScript expression to the debug console (e.g. `x = ${x}`)
- Breakpoints may now be disabled
- Conditional breakpoints - break only when a JavaScript expression evaluates to rue (e.g
- Interactive debug console (REPL)
- Expressions can be evaluated in-scope when stopped in the debugger
- View properties
- Set values
- Call functions
- See the xsbug documentation for more information
- Enhancements to breakpoints for faster debugging
- mcpack is our new embedded packaging tool for embedded devices. It makes standard, modern embedded JavaScript development more accessible to JavaScript developers working with npm and Node.js.
mcpackis a front-end to existing Moddable build tools likemcconfigandmcrunmcpackstarts frompackage.jsonand analyzes your project's dependencies to automatically generate a Moddable SDKmanifest.jsonmcpackdetects the use of Moddable SDK built-in modules and automatically adds them to the generated manifest.mcpackdetects the use of well-known globals --setTimeout,fetch,URL,Worker, etc -- and automatically includes the necessary modules in the generated manifest and initializes the global variables.mcpackdetects the use of top-level await (TLA) and automatically generates the needed manifest settings to enable TLAmcpackintroduces the "moddable:" namespace for built-in modules. The prefix is optional, so built-in modules may be accessed as "timer" or "moddable:timer".mcpackuses the runtime key "moddable" (registered with WinterCG) to allow package.json to include runs that apply only to Moddable SDK builds.mcpackallows Moddable SDK manifest fragments to be embedded in package.json or to be referenced externally, allowing full access to all capabilities of manifest.json.- There is a suite of example projects available that demonstrate how to use
mcpack. Check out the readme to learn how to get started withmcpack. mcpackis experimental. We expect it to evolve based on community feedback. Please give it a try!mcpackis not yet fully documented. If you have questions or suggestions, please ask them in our Discussions forum on GitHub.
- New flags to control debugger launch behavior with
mcconfigandmcrun.-dfor default debugger (launch xsbug),-dnto not launch debugger,-dlto launch xsbug-log, and-dxto launch xsbug.-lis still supported for xsbug-log, but will eventually be removed. New flags are available on macOS and Linux; Windows is coming soon. mcrunimprovements to help installing to ESP32 USB-native devices- Simulator (
mcsim)- Would sometimes launch the project twice, confusing debuggers. Fixed to only launch target project once.
- Release build fix (
breakOnStartFlagonly available in debug builds)
- Rename
DISPLAYandROTATIONbuild variables toCOMMODETTOBITMAPFORMATandPOCOROTATIONto eliminate conflicts on some Linux distributions - nRF52 builds can debug over serial too (in addition to existing USB support)
- ESP32 installation improvements to add prompts for button presses when necessary (devices without auto-programming capability)
- Raspberry Pi Pico
xsbug-lognow supported for Raspberry Pi Pico Linux buildsmcconfignow able to build PIO source files included in a manifest. This simplifies integration of PIO support and minimizes binary size. (inspired by @linfan in discussion #1220)- Build neopixel and i2s_audio pio modules only if included in project
- pio and supporting source files compiled directly from external directories (i.e.
pico-extras)
- xsbug has received a major update
- Modules
- Manifests
- To more thoroughly support automatic manifest includes by
mcpack, many existing module manifests were updated and a number of new module manifests were added. The goal is to ensure that every module can be built by simply including its manifest (rather than directly including the modules in a project manifest). This is now true, with just a few exceptions.- In making the changes several errors were corrected, resulting in smaller binaries in some cases.
- While the changes were made with care, it is possible that some uses were overlooked. If you run into problems building existing projects, please report an issue.
- BLE client and server manifests now have
errorcase for unsupported platforms to generate earlier failure with clearer message
- To more thoroughly support automatic manifest includes by
- ECMA-419
- Poco refactored for better compatibility. The
commodetto/PocoCoremodule is now the foundation and thecommodetto/Pocomodule contains the drawing primitives. This revises a change in Moddable SDK 4.0 made to reduce...
- Manifests
Moddable SDK 4.1
Moddable SDK 4.1
This release contains improvements to the Moddable SDK made between August 9, 2023 and September 9, 2023.
Highlights of this release include:
- PSRAM and larger flash support on more ESP32-S3 boards
- Web Worker memory configuration now matches manifest's
creationfor consistency - simpler and more powerful - XS 14.2 improves debugging of async/await code, adds async support for Explicit Resource Management, and prepares for new debugging capabilities
News
- Moddable Four brings modern Embedded JavaScript to a coin-cell powered development board. If you missed the launch, catch up with our August Community Call. Hear about Moddable Four in-depth, with a focus on energy management to get the longest possible battery life for your project.
- ESP-IDF v5 support is preparing to land. In the next week or two, we'll merge our idf-v5 branch to main, so everyone will be using the latest from Espressif (v5.1.1). We've collaborated with the community to ensure this is a seamless upgrade. Help us out by giving the branch a try before the merge, to ensure is working for you.
- Node-RED MCU Edition now supports secure HTTP and MQTT connections (
https://andmqtts://), including client certificates, thanks to work on the ECMA-419 TLS socket over the last couple months.
September Community Update
The monthly Moddable Community Call is now a monthly Moddable Community Update! We'll share more about this soon. Sign up to receive an email notification when new community updates are published.
Release Details
- Devices
- ESP32
- Enable PSRAM and use all flash
- Adafruit QT Py ESP32-S3
- Adafruit ESP32-S3 TFT Feather
- Lilygo T-QT ESP32-S3
- Lilygo T-Display-S3
- M5Atom S3
- M5 Stack Core S3
- XIAO ESP32-S3
- USB CDC support for Adafruit QT Py ESP32-S3 - smaller code size and cleaner integration
- Windows builds can now deploy and debug ESP32 projects over USB. Reported by @NextWorldLab. #1181
- Generate build error on use of obsolete
MODDEF_XS_RESTARTONESP32 feature
- Enable PSRAM and use all flash
- nRF52
- xsbug debugging over serial (alternative to USB). See documentation for details.
- Flashing firmware over serial using DFU. See documentation for details.
- ESP8266
- I²C build fix to resolve file name confusion (two source files with the same name). Reported by @dtex.
- ESP32
- XS 14.2
- Stepping of
awaitand async functions in the debugger improved - Explicit Resource Management
- Asynchronous support (stage 3 proposal) is now implemented
- Fixes to synchronous Explicit Resource Management based on new test262 tests
- Key garbage collection now only performed on forced garbage collection (via API) and when the key table is full. This is done to reduce the overhead of garbage collection of keys. (Note: this feature is disabled by default on embedded targets)
- New
xsImport()andxsImportNow()APIs to better support synchronous and asynchronous module loading from native code. Resolves issue with top-level await in embedded builds using the "strip" feature to minimize the code size of XS. - Updates to integer math static methods to match latest proposal, including addition of
Math.irandom()and removal ofMath.idivmod(). String.prototype.normalizefix for type confusion bug triggered by read-only strings (XS_STRING_X_KIND). Issue found by Fuzzilli fuzz testing (thank you @Agoric).- Enhancements to XS's debugging protocol to support planned debugging enhancements (stay tuned)
- Stepping of
- Modules
- Web Workers now use manifest creation object to configure worker's virtual machine memory. Supports all configuration options and is consistent. Motivated by discussion with @linfan68 in #1195
- The previous Worker configuration object is still supported but deprecated. If you use it, you'll see a runtime warning. Please update your code.
- ECMA-419
- MQTT client keep alive based on last write (previously last read). Reported by @tve and @mshioji
- TLS
- Fix race condition in TLS socket that caused multiple readable callbacks to be queued
- Now supports configuring the server-name indication with
serverNamefield of constructor's options object. Motivated by Node-RED MCU Edition request from @mshioji.
- BM8563 Real-Time Clock driver. Contributed by @stc1988. Used in M5Stack Core S3 port.
Headersclass moved todata/headersto be more generally available (previously infetchmodule)- New
readString()method on Flash object to read UTF-8 strings from flash directly into JavaScript string
- Web Workers now use manifest creation object to configure worker's virtual machine memory. Supports all configuration options and is consistent. Motivated by discussion with @linfan68 in #1195
- Tools
- xsbug
- Promises Settled instrumentation added to xsbug to show total number of Promise resolve and reject handlers invoked per second. Useful to get a sense of how busy system is handling promises.
- "Break on start" in xsbug works again in the simulator (was broken for projects without "setup/" modules)
- xsbug
- Examples
- ECMA-419
- https client example now traces errors to the console in case of request failure
- The ECMA-419
manifest_io.jsonno longer includesmanifest_base.json. This required updates to the manifests of many ECMA-419 examples which depended onmanifest_base.jsonbeing included. Thank you to @stc1988 for identifying several of these. #1201
- Resource example updated with comments to explain expected behavior
- cryptoblockciphers example updated to reflect changes to buffer use in lower level APIs
- ePaper mini travel-time example (ESP8266) updated to download JSON of directions to flash to reduce RAM use. Motivated by report from @sebastien-burel #1206
- ePaper travel-time and mini travel-time apps now URI encode their arguments to eliminate errors from Google Maps service #1206
- ECMA-419
- Documentation
- nRF52 documentation fixes and clarifications. Reported by @NextWorldLab. #1199
- Correct spelling errors across all documentation
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter at @moddabletech
Moddable SDK 4.0
This release contains improvements to the Moddable SDK made between July 7, 2023 and August 9, 2023.
Highlights of this release include:
- Nordic nRF52 port
- Support for nRF52 development boards from Moddable, Nordic, Adafruit, Sparkfun, Seeed Studio, and makerdiary
- Graphics enhancements to support Moddable Four's low-power display including frame buffer mode, rendering to grayscale, and dithering
- Smaller default code footprint
News
The Moddable SDK is now at version 4.0! This release features a completely new port to Nordic's nRF52. We wanted to bring standard, modern JavaScript to ultra-low power microcontrollers and the nRF52 is one of the best. A single coin cell battery can power an nRF52 product for a year or more. The nRF52 has a generous 256 KB of RAM and a 64 MHz ARM Cortex-M4 CPU that delivers remarkable JavaScript performance.
Developing with nRF52 development boards is just like working with other silicon platform supported by the Moddable SDK. The development tools and APIs are the same. Of course, we've brought industry standard ECMA-419 IO together with our suite of ECMA-410 Sensors and Real-time Clock drivers. There are also new APIs so your projects can optimize energy use.
The nRF52 has built-in BLE. The Moddable SDK's BLE client and server APIs (central and peripheral) work on nRF52 just like they do on ESP32.
Our nRF52 port supports many popular development boards already. Moddable has just launched Moddable Four, an nRF52 development board with a fast, low-power screen, accelerometer, jog dial, and coin cell battery holder. Moddable Four is a great, low-cost choice for developers looking for an all-in-one hardware solution to get started with Embedded JavaScript on ultra-low power microcontrollers. Read all about it on the Moddable blog and check out the detailed specs on the Moddable Four product page.
xs-dev, the tool many Moddable developers are using to easily set-up the Moddable SDK, has already been updated to support the nRF52 port. Thank you, @HipsterBrown!
August Community Call
The monthly Moddable Community Call is Thursday, August 17 at 3:00 PM PDT. Join us live on Zoom. We'll focus on the new nRF52 support in Moddable SDK 4.0 using Moddable Four. Join us to learn how to build energy-efficient projects using Embedded JavaScript.
New: Sign-up to receive an email reminder about our monthly community calls.
Release Details
- New development boards
- Nordic nRF52
- Moddable Four (
nrf52/moddable_four)- New Moddable low-power device with display, accelerometer, jog-dial, led, button, and CR2032 coin-cell socket
- Moddable Four IO (
nrf52/moddable_four_io)- Moddable Four with ECMA-419 IO
- Nordic nRF52840 DK (
nrf52/dk)- Nordic nRF52840 Development Kit (pca10056)
- ItsyBitsy (
nrf52/itsybitsy)- Adafruit ItsyBitsy format device with LED and button
- Sparkfun Pro nRF52840 Mini (
nrf52/sparkfun)- Sparkfun Pro nRF52840 Mini device with LED, button, JST power connector and Qwiic connector
- Xiao (
nrf52/xiao)- Seeed Studio Xiao format device with RGB LED and button
- Xiao ILI9341 (
nrf52/xiao_ili9341)- Seeed Studio Xiao format device with connections for ILI9341 display
- makerdiary nrf52 (
nrf52/makerdiary_nrf52)- USB-Stick style device with RGB LED and button
- Moddable Four (
- Espressif ESP32 family
- LilyGo T-QT-S3
- ESP32-S3 with small screen and two buttons
- LilyGo T-QT-S3
- Raspberry Pi Pico
- Pico WaveShare ws_round split to have version with and without touch
- Nordic nRF52
- Modules
- Graphics & UI
- Piu Image class broken out into separate module to reduce default footprint of Piu. Include
$(MODDABLE)/modules/piu/MC/colorcell/manifest.jsonto use it in projects. - Piu no longer includes JavaScript bindings for the Poco renderer. This reduces the default code footprint of Piu. Include
$(MODDABLE)/examples/manifest_commodetto.jsonto use them in projects. - Poco and Piu now report rendering errors when using frame buffer mode
- Poco drawFrame (color cell) disabled when pixel format isn't RGB565LE (the only format supported)
- Poco rendering fixes for monochrome (1-bit) bitmaps
- Piu Image class broken out into separate module to reduce default footprint of Piu. Include
- Networking
fetch()implements HTTP redirect, including redirect from HTTP to HTTPS (reported by @mshioji)- ECMA-419 HTTP Client fixes for chunked transfer-encoding (reported by @mshioji)
- Crypt data now includes PEM versions of CA certificates (previously DER only)
- TLS module supports globally registered CA certificates (experimental, may be changed or removed)
- BLE Server
- No longer sends "undefined" when
onCharacteristicReadreturnsundefinedindicating no value is ready - Optional notification after each advertisement sent (nRF52 only)
- No longer sends "undefined" when
- GIF Decoder
- Renders directly to 8-bit gray pixels
- Works on Windows
- ECMA-419 LIS3DH accelerometer driver conformance fixes
- Instrumentation
- Instrumentation fields unused on a given platform are no longer shown
- New
Instrumentation.map()andInstrumentation.name()APIs simplify programatic access to instrumented values. See documentation and updated example.
- Removed out-dated, experimental ECMA-419 Wakeable pins
- Graphics & UI
- Examples
- New ECMA-419 Analog input example
- New Piu Examples
- LS013B4DN04 display driver
- Supports optional dithering using either Atkinson (default) or Burkes algorithms
- Supports Commodetto frame buffer mode - uses more memory but faster and more compatible
- Support to manage DISP to power display
- Support for PULSE pin to retain display image when not refreshing
- Note added to aborthook example about unhandled rejected promise reporting #1186 (reported by @linfan68)
- XS
- Left-shift implementation casts to address warnings from UBSan
- XS linker now does more complete job of automatic stripping of unused
GeneratorandAsyncGeneratorsupport as well as the module loader. This reduces the footprint of XS for many projects when using automatic stripping. - Native stack overflow check works on Windows 7 (!) now too
- Devices
- Instrumented ESP32-S3 and ESP32-C3 builds redirect serial output to USB
pins/i2con Raspberry Pi Pico now automatically selects required port- M5Atom and M5Stack devices with built-in Neopixels now defer instantiation of Neopixels driver until first used to avoid conflicting with projects that use external Neopixels. #1188. (reported by @kairos0ne)
pins/analogworks on ESP32-S2 and ESP32-C3
- Testing
- testmc on Windows now supports loading test fixture modules
- Tools
- Use search path to run serial2xsbug to be consistent with other tools (contributed by @meganetaaan)
- TypeScript
- Minor correction to SNTP type declaration (contributed by @meganetaaan)
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter at @moddabletech
Moddable SDK 3.9.7
This release contains improvements to the Moddable SDK made between June 1, 2023 and July 7, 2023.
Highlights of this release include:
- New development boards supported including the M5Stack CoreS3
- Additional display and touch controller support
- Enhanced TypeScript support
- New abort hook gives scripts control of unhandled exceptions
News
- Moddable @ Sensors Converge - Moddable took part in the Sensors Converge 2023 trade show in Santa Clara, California. We demonstrated how a display with thoughtfully designed visuals adds value to sensors and sensor data. Our own Andy Carle took to the stage to talk about how industry standard sensor drivers can grow the market for sensor hardware. Read about our demonstrations and Andy's talk on our blog.
- ECMA-419 2nd Edition - The 2nd Edition of ECMA-419, ECMAScript® embedded systems API specification, was recently approved by the Ecma General Assembly! This is a major update to the standard that underpins much of the Moddable SDK. Nick Hehr shared an excellent summary on Twitter. You can read the full text of the standard on the Ecma site. Significant parts of ECMA-419 are already supported in the Moddable SDK today. We'll be writing more about this in the coming weeks and months.
- Securing your IoT product - Everyone knows they need to secure their IoT products. But it isn't always obvious what needs to be done. Our new IoT Security blog post shares practical advice based on Moddable's experience working with clients to secure their products.
- June community call replay - The replay of our June community call is available now. It features a great talk by the co-founders of Juniper Garden introducing their new Twig an agricultural monitoring IoT product.
- SDK documentation - All Moddable SDK documentation is now available for reading on the Moddable web site. This is much faster to browse than GitHub. The documentation is formatted using the GitHub markdown to HTML converter, so it will look the same whether you are browsing on the Moddable web site or our repository on GitHub. There's an incredible amount of detailed documentation available. If you haven't taken a look in a little while, now's a great time.
July Community Call
The Moddable community call is taking a summer vacation for July. It'll be back in August.
Release Details
- New development boards
- Waveshare RP2040-LCD-1.28 Raspberry Pi Pico using round GC9A01 display -
pico/ws_round - LilyGo TDisplay S3 utilizing 8-bit parallel display. Great set of tweets from @mkellner documenting the bring-up.
- M5Stack CoreS3. Contributed by @magenetaan. This is a large undertaking. It is usable but not yet complete. The details are here. Help testing and completing the port would be appreciated. Thank you to @kairos0ne for testing help.
- Lolin C3mini (ESP32-C3)
- Lolin C3Pico (ESP32-C3)
- XIAO ESP32S3 (ESP32-S3)
- Waveshare RP2040-LCD-1.28 Raspberry Pi Pico using round GC9A01 display -
- Modules
- ILI9341 (MIPI) display driver supports writing to register 255. This enables support for additional display controllers (e.g. GC9A01)
- GalaxyCore GC9A01 display driver
- Hynitron CST816S capacitive touch driver
- PWM support for Raspberry Pi Pico using
pins/pwmmodule - Add
Time.delta()to calculate differences inTime.ticksvalues correctly and efficiently. Suggested by @tve. #1162 fetch()now accepts an object literal for headers. Improves web compatibility.pins/servomodule works on more ESP32 family silicon devices including ESP32S3. Contributed by @washishi. #1144- ESP32 PDM audio input defaults to I2S unit 0. This is required in more recent ESP-IDFs (but used to work).
- Enable VFS on all ESP32 family builds (adds ESP32-C3 and ESP32-S3). Reported by @tve. #1164
- Runtime
- New abort hook allows scripts to catch fatal errors. See new
js/aborthookexample for details and example uses. Suggested by @linfan68. #1139 - Devices that play a start-up sound now wait for the audio output to be completely closed to eliminate resource conflicts with projects that immediately play audio.
- Instrumented ESP32-C3 builds log to serial / UART
- New abort hook allows scripts to catch fatal errors. See new
- ECMA-419
- BME68x ECMA-419 sensor driver now correctly handles all I/O errors
- SMBus ECMA-419 I/O provides
read()andwrite()methods from I2C. Reported by @tve. #1153 - ECMA-419 some Digital input implementations allowed write and some Digital outputs implementations allowed read. These now consistently throw. Reported by @bartmichu. #1129
- XS JavaScript engine
- xs macros disabled when using xsmc are now marked as poisoned when building with GCC to generate errors early (suggested by @tve)
- Add
xsmcToReference(), but don't yet require its use in place ofxsToReference() - Fix for "XS returns the wrong result for expressions that assign to array length". Reported by @gibson042. #1123
- xsbug debugger no longer displays internal implementation global properties
- xsbug debugger correctly displays class closures
- New option to canonicalize
NaNvalues. JavaScript permits multiple representations of NaN beacuse it uses IEEE-754 for floating point values. Scripts that look at the binary representaion of NaN may observe different results depending on the host plaform. This flag enforces a single binary representation of NaN across all XS ports, preventing scripts from observing different binary representations of NaN. This is valuable when deterministic execution is required. Enable by settingmxCanonicalNaNbuild flag. - Fixes for issues identified by fuzz testing with Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this work.
- TypeScript
mcconfigandmcrunnow correctly build TypeScript modules that use a namespace prefix (e.g.embedded:). Reported by @tve. #1137- Update default language target to es2022 target. This allows TypeScript code to use the native private field support in XS. Reported by @tve. #1138
mcconfignow properly builds a module that consists of a .js implementation, a .c implementation, and a .d.ts TypeScript declaration file. Reported by @tve. #1140- Fix extension of
commodetto/PixelsOut.d.tsso it is only a declaration, not an implementation System.resolvehas no return valueweightargument toOutline.stroke()is optional- More type declarations
- Integer math proposal methods implemented in XS. Contributed by @tve.
- One Wire module. Contributed by @tve.
- DS18X20 (One Wire temperature sensor) module. Contributed by @tve.
- Tools
- Environment variables defined in manifests for mods are consistent with host builds. Reported by @tve. #1024
- mcsim simulator now can display round screens on macOS
- Eliminate dependency on debug tools for all Moddable SDK builds.
- Moddable SDK tools builds now create only release tools by default. To build debug tools use
make debug. - Moddable SDK builds now always locate tools using the active search path. There are no more paths hard coded into the Moddable SDK build results. This gives flexibility in where tools are installed.
- Documentation
- Update "XS in C"
- Preload document now notes that preloaded objects cannot be passed directly to
JSON.stringify()and suggests workaround. Reported by @tve and earlier by @takeru. #1145 & #340 - Web Worker documentation has additional details on memory allocation motivated by feedback from @tve. #1146
- xsbug documentation links to resources on using and understanding the performance profiler
- Document subtleties of values provided by
Time.ticksand how to correctly use them. - Document how to remove a setup module installed by a host. This addresses a frequently asked question.
- Tests
- Add test for
Timer.repeat()called with single argument Reported by @salarizadi. #1135
- Add test for
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter at @moddabletech
Moddable SDK 3.9.4
This release contains improvements to the Moddable SDK made between May 4, 2023 and June 1, 2023.
Highlights of this release include:
- MP3 decoder
- MP3 audio streaming
- Audio playback support for Raspberry Pi Pico (including MP3)
- High quality Text-to-Speech with ElevenLabs.io
- Support for more ESP32-S2 and ESP32-C3 development boards
- XS 14.1 - garbage collection of keys and support for Symbols as WeakMap Keys
June Community Call
The monthly Moddable Community Call is Wednesday, June 14 at 3:00 PM PDT. Join us live on Zoom to learn more about this month's release and chat with the Moddable community.
New: Sign-up to receive an email reminder about our monthly community calls.
Our special guests this month are Daniel Ashcroft and Lawrence Kincheloe, founders of Juniper Technology. They are preparing to launch Twig, an agricultural monitoring IoT product with an open hardware design that gives users complete control of their data. Twig is their first product, created for hobbyists and explorers. Daniel and Lawrence will share the philosophy behind their product, their unusual approach to manufacturing, and how the Moddable SDK helps them bring their vision to market.
July release
Because of summer travel plans, our July release of the Moddable SDK will be delayed until approximately July 10.
Release details
- Devices
- M5Stack Fire
- M5Stack Core2 now enables PSRAM, increasing available RAM by 16x
- Support for Adafruit QT Py-S2 development board
- Support for WEMOS S2 Mini development board
- Support for Espressif's ESP32-C3-DevKitM-1 development board
- Support for Espressif's ESP32-C3-DevKit-RUST-1 development board
- Audio
- MP3 audio decoder integrated with a JavaScript API. The implementation uses the libmad MCU fork by Earle F. Philhower, III.
- MP3 Resource streaming API to play MP3 from flash memory.
- MP3 HTTP streaming API to stream MP3 from HTTP and HTTPS sources.
- New SomaFM example application for continuous MP3 radio streaming (thank you to @stc1988 for assistance identifying memory issues #1111)
- Text-to-speech streaming API for the ElevenLabs.io engine with secure MP3 streaming.
- audioOut using I2S now supported on Raspberry Pi Pico (including new MP3 support)
- audioIn simulator implemented. Sources audio from a Wave file.
- Microcontroller runtimes
- MCP7940 Real-time Clock implements digital trim adjustment to compensate for clock drift
- Initialize time/date via SNTP if unavailable from debugger or RTC. Gives better default behavior for release & instrumented builds. (reported by @meganetaaan) #1094
- Enable growable keys in XS by default to avoid running out of keys (reported by @linfan68) #1103
- ESP32 USB now implements the debugger serial connection over both CDC-JTAG and TinyUSB
- ESP32-S2 requires TinyUSB
- ESP32-S3 can use either
- ESP32-C3 requires CDC-JTAG
- Fully initialize UART configuration on ESP32 platforms to fix intermittent failures with PSRAM enabled
- TLS
- ECMA-419 TLS socket implements read into existing buffer
- Bump default TLS version to 1.2. Contributed by @jethrowharton.
- ECMA-419 Analog input on ESP32 only performs calibration once #1120
pins/monitorworking on Pico to deliver callbacks on digital input change- Mods working on Pico
- Tools
- TypeScript support for mods by setting-up tsconfig.json in manifest_mod.json. (reported by @linfan68) #1104
mcrunfor ESP32 sources ESP-IDFexports.shto provide identical Python environment asmcconfig.mcrunreports specific error message when attempting to build a project that includes native code #1098mcconfigoutputs recursively merged manifests asmanifest_flat.json. This is useful for debugging manifest mistakes and for tools that operate on manifests.
- XS 14.1
- Keys can now be garbage collected
- Collects keys created by scripts; does not collect keys used in byte code
- Enabled in
xstcommand line tool - Disabled in MCU builds where dynamically creating and discarding keys is very rare
- Support enabled by
mxKeysGarbageCollectionflag
- "Symbols as WeakMap Keys" is now implemented - completes support for ECMAScript 2023
- xsbug now displays contents of TypedArrays and ArrayBuffers (suggested by @tve). Up to 1024 elements are displayed.
- Fixes
- Fixed "XS returns the wrong result for expressions that assign to array length" (reported by @gibson402) #1123
- Fixed "toFixed(0) sometimes returns a trailing dot" (reported by @tve) #1124
- Revert
BigIntchange that caused incorrectaddcalculation on some platforms - Fixes for issues identified by fuzz testing with Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this work.
- Keys can now be garbage collected
- Documentation
- Documentation on ESP32 family boards with USB connections - how to port and develop
- Mods document links to discussion of how to install a mod without using mcrun. #1105
- The
xsLog()function is now described in the XS in C documentation (suggested by @tve)
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter at @moddabletech
Moddable SDK 3.9.2
This is an interim release of the Moddable SDK to support specific projects.
We will publish a release at the start of June on our usual monthly schedule. Release notes will be provided at that time.
Moddable SDK 3.9.1
This release contains improvements to the Moddable SDK made between April 1, 2023 and May 4, 2023.
Highlights of this release include:
- XS 14 with ECMAScript 2023 and Explicit Resource Management support
- Wemos S2 mini and Adafruit QT Py ESP32-S2
- Bosch BME680 sensor support
- Automatic flash partitioning for ESP32
May Community Call
The monthly Moddable Community Call is this Friday, May 12 at 8:00 PM PDT. We hope this time will be convenient for our community members in Asia and parts of the United States. Join us live on Zoom to learn more about this month's release and chat with the Moddable community.
Our special guest this month is Shinya Ishikawa, creator of the award-winning super-kawaii Stack-chan robot. Ishikawa-san recently taught Stack-chan how to have conversations using ChatGPT. Join us to learn how Ishikawa-san achieved this amazing milestone using the Moddable SDK.
Community News
- Our ESP-IDF 5 preview has been updated to Moddable SDK 3.9.0. Please help test this ahead of planned cutover to ESP-IDF 5.1. Details are in our release notes for Moddable SDK 3.8.0.
- A new book on Node-RED MCU Edition has been published in Japan. Written by Ayachika Kitazaki, Masahiro Shioji, and Yashushi Tauchi, this is a great place to get started with this visual IoT programming environment powered by the Moddable SDK.
- An ESP32 module for working with SD Cards in the Moddable SDK has been published by @salarizadi. The SD Card is accessible through the File module, so it is very easy to get started with.
- There's a new port of the popular Cron module from Node.js now available for the Embedded JavaScript. Cron makes it easy to schedule callbacks at specific intervals (e.g. each Tuesday and Thursday at 3 PM).
- Stack-chan, the award-winning super-kawaii robot implemented in TypeScript and powered by the Moddable SDK, has its own Discord server! Check out the announcement and invitation from @meganetaaan.
If you have a community news item for our next update, please let us know.
Release details
- XS
- XS 14 has arrived with support for the ECMAScript 2023 standard. This includes new convenience methods for working with Arrays and TypedArrays. The new "by copy" methods are helpful for embedded developers to simultaneously move and transform arrays from frozen immutable flash memory into RAM.
- ECMAScript 2023
- Array Find from Last
- Adds
findLastandfindLastIndexto both Array and TypedArrays
- Adds
- Change Array by Copy
- Adds
toReversed,toSortedandwithto Array and TypedArrays - Adds
toSplicedto Array
- Adds
- The only new feature in ECMAScript 2023 that is not implemented in XS is Symbols as WeakMap keys. It is rare to use WeakMaps (and to some extent even Symbols) on embedded devices. Still, we are investigating how this might be supported.
- Array Find from Last
- Improved conformance
- As part of updating to ECMAScript 2023 we have also run the latest test262 against XS and fixed issues identified by recently added tests
- Of note, new tests related identified issues with the expected ticks with async generators that have been fixed
- Explicit Resource Management proposal. XS has implemented this Stage 3 proposal early to explore how it may be useful in managing resources on embedded devices and how it may be integrated into ECMA-419. It is enabled in the
xstcommand line tool. In all other environments, it is disabled by default and can be enabled by setting themxExplicitResourceManagementbuild flag. - For uses of XS in non-embedded environments, the alias feature to allow changes to objects stored in immutable flash memory is unused. Aliasing is now disabled at build time when
mxAliasInstanceis not set. This reduces the surface area available for exploits and improves performance marginally. - Other fixes
- Fixed match failure in certain Regular Expressions that contain nulls #1089 (reported by @salarizadi)
- Fixes for issues identified by fuzz testing with Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this work.
- Modules
- New ECMA-419 sensor driver for the popular Bosch BME680 for air pressure, temperature, and humidity. (Requested by @Sineos, @mshioji, and others)
- New ECMA-419 peripheral driver for Renesas X9C Series digital potentiometers (contributed by @dabdoue)
- New ECMA-419 peripheral driver for Tontek TTP223 capacitive touch switch (contributed by @dabdoue)
fetchimplementation updated to handle responses with content-length of 0. #1080 (reported by @NextWorldLab)- ECMA-419
mqttclientimplementation fixed to correctly handle messages received with 0 in low byte of length. phoddie/node-red-mcu#112 (reported by @colinl) - Fix stall in SNTP client on receipt of certain malformed packets
- Empty outline paths no longer crash #1092 (reported by @salarizadi)
- WAVStreamer and SBCStreamer modules updated to fix edge case that sometimes caused them to allocate more buffers than needed. Improves memory stability when streaming.
- OTA module manifest added for easier integration into projects
- debug module manifest added for easier integration into projects
- DFRobot oxygen sensor module specifier corrected to
embedded:sensor/Oxygen/SEN0322
- Devices
- M5Stack Core2 port updated to use 16 MB flash (previously limited to 4 MB) and improve quality of audio playback by outputting 32-bit samples (instead of of 16-bit samples)
- ESP32
- Wi-Fi and Ethernet modules updated so that both can be active simultaneously #1079 (reported by @bartbutenaers)
- ECMA-419
DigitalandDigitalBankupdated to use ESP-IDF constants to check for pin availability for better portability across the ESP32 silicon family - Uses
i2s_write_expandfor 32-bit output to eliminate memory buffer used for expanding samples - Added MIXERBYTES to audio output configuration to allow projects to tune the size of memory buffers used to render audio
- Improvements to build flow for programming USB-only development boards
- Support for programming and debugging ESP32-S2 over USB
- Port for Adafruit QT Py ESP32-S2
- Port for Wemos S2 mini
- Device ports for ESP32 now include
creationsection in manifest to allow for easier support for ESP32 development boards with different RAM sizes - Fix paths in ports for M5 Atom S3 #1096 (contributed by @NextWorldLab)
- Tools
- Flash partitioning for ESP32 may now be performed by mcconfig, eliminating the need for most projects to manually partition flash. Flash partitions are created for mods, files, and Over-the-Air updates if that feature is used in the project. Details are available in the announcement and documentation.
- Manifests for ESP32 device ports may now set
C_FLAGS_SUBPLATFORMto define additional flags for builds of C files in the Moddable SDK. Documentation here. Useful in relatively obscure circumstances like working around silicon bugs. #1069 (motivated by report from @beckerzito) - mcconfig now resolves relative paths in the
buildsection of manifests. This avoids a dependency on paths, which is particularly useful for device ports. - Fixes for incr...
Moddable SDK 3.8.7
This is an interim release of the Moddable SDK to support specific projects.
We will publish a release at the start of May on our usual monthly schedule. Release notes will be provided at that time.
Moddable SDK 3.8.0
This release contains improvements to the Moddable SDK made between March 1, 2023 and April 1, 2023.
Highlights of this release include:
- More memory for ESP32 and Pico projects
- New examples for connecting to AWS IoT services
- New DFRobot SEN0322 Oxygen sensor driver
- Web Worker message passing more reliable, debuggable, and configurable
- New device support: Adafruit Trinkey QT2040
- Updated to Raspberry Pi Pico 1.5 SDK
A preview of our upcoming support for ESP-IDF 5 is now available.
April Community Call
The monthly Moddable Community Call is this Monday, April 17 at 11:00 PM PDT. We hope this time will be conveinent for our community members in Europe and Asia. Join us live on Zoom to learn more about this month's release and chat with the Moddable team.
You may have heard about Node-RED MCU Edition, a reimplementation of the Node-RED runtime that runs on microcontrollers. It brings this popular low-code environment and its visual editor to microcontroillers for the first time. We'll be joined by Peter Hoddie, creator of Node-RED MCU Edition, to talk about how this project is building on the XS JavaScript engine and Moddable SDK to help to strengthen the Moddable SDK and the ECMA-419 standard.
Release details
- Devices
- Raspberry Pi Pico
- Support for additional development boards
- Adafruit Trinkey QT2040
- XIAO RP2040 with ILI9341 - generic 2.4" and 2.8" display
- Updated to Pico SDK v1.5
- Build instructions now pull specific branch (Pico SDK changes won't break Moddable SDK builds) #1031 (suggested by @stc1988)
- SSD1306 display driver support
- Wi-Fi disconnect messages reported correctly #1057 (reported by @Frida854)
- Many fewer warnings during compilation
- Support for additional development boards
- ESP8266
- Improved initialization of GPIO
- Eliminate noise from analog input by changing Wi-Fi configuration phoddie/node-red-mcu#101 (reported by @colinl)
- OneWire reliability improvements phoddie/node-red-mcu#93 (reported by @colinl)
- Changing GPIO modes doesn't reassert GPIO mux
- Bigger default virtual memory allocation and JavaScript stack for devices with more RAM (inspired by many developers reporting out-of-memory errors)
- ESP32 - virtual machine size 154 KB, JavaScript stack 8 KB
- Raspberry Pi Pico - virtual machine size 128 KB, JavaScript stack 8 KB
- Raspberry Pi Pico
- Modules
- Reduce JavaScript and native stack used by network modules (changes inspired by reports by @colinl, @dabdoue, @mshioji)
- Use arrow function instead of
.bind - Use for loop in place of forEach, etc.
- Defer callbacks to end of turn
- Use arrow function instead of
- Web Worker #1046 (request from @beckerzito, input from @tve)
- Throw on errors when marshalling of message (out of memory, object cannot be marshalled) rather than aborting
- Throw when message posting fails (out of memory)
- Debug builds throw when posting a message blocks for 1 second (likely a deadlock); behavior may be overridden with TASK_QUEUEWAIT define in manifest
- Task message queue length may be configured with TASK_QUEUELENGTH define in manifest (default remains 10)
- xsbug messages use their own message queue to avoid conflict with project message queue (more reliable JavaScript debugging with Web Workers)
- Documentation updated with configuration options
- New ECMA-419 Oxygen Sensor driver for DFRobot's SEN0322 with example. (contributed by @dabdoue)
- ECMA-419 FT6206 touch driver
- Improved error handling in constructor
- Sync with id change from #1065
- WavStreamer constructor allows caller to override settings (contributed by @meganetaaan)
- WavStreamer and SBCStreamer now allow duration of data to buffer to be specified #1061 (proposed by @meganetaaan)
- BLE (NimBLE stack) triggers onCharacteristicNotifyEnabled on indication subscription (not just on notification subscription) to match other platforms
- FT6206 touch driver (original) recognizes additional vendor ID for compatibility with M5Stack Core2 revision #1065 (contributed by @Fuji-P)
- Windows implementation of Timers issues callbacks in correct thread #1058 (reported by @jethrowharton)
- Windows implementation of Socket reports errors correctly
- Reduce JavaScript and native stack used by network modules (changes inspired by reports by @colinl, @dabdoue, @mshioji)
- Tools
- xsbug-log
- Display warning when run before executing
npm install - Aways listens on port 5002 (ignores XSBUG_PORT)
- Now supported for ESP8266 builds
- Remains running after device disconnects to allow reconnect (reset button)
- Reports error if xsbug is running when xsbug-log is launched (both cannot be used at the same time)
- Display warning when run before executing
- mcrun fix on Windows #1047 (reported by @nickthiru)
- Building for embedded targets with mcconfig no longer kills running xsbug instance #1038 (reported by @bartbutenaers)
- Building for embedded targets with mcconfig now consistently kills serial2xsbug for the
deploy,xsbug, andall(default) targets. This is a good behavior for the common case of developing with a single embedded device. Future work will provide an override for development with multiple devices. - Fixes to use of
XSBUG_PORTandXSBUG_LOGenvironment variables (thank you to @ralphwetzel and @bartbutenaers for helping to isolate this) - xst disables lsan (leak sanitizer) when exiting because of
fxAbort()#1067 (contributed by @raphdev) - fontbm is no longer experimental
- xsbug-log
- Examples
- New AWS examples that demonstrate how to connect to secure HTTP and MQTT endpoints with a tutorial that explains how to set-up the required TLS keys. (contributed by @dabdoue)
- New ble/name-change-server example to change the device's name and indicate on the Service Changed characteristic (based on discussion with @scochet in #837)
- Tests
- Poco rendering tests assert expected screen dimensions
- Fix checksum renderer pixelsToBytes to use input pixels count
- Wi-Fi test fix for SSID and password maximum length
- XS
- Fixes for issues identified by fuzz testing. Thank you to @Agoric for their ongoing assistance with this work.
- Enable native stack overflow checks in ESP8266 and ESP32 runtime
ESP-IDF 5 Support Preview
Work is underway to migrate to ESP-IDF 5. This upgrade is significant, deprecating many of the I/O APIs that the Moddable SDK relies on. The work has been underway for some weeks now. It is currently working well, but it is not yet complete. We are posting a preview release so that community members can try it out, report issues, and contribute improvements.
The Moddable SDK with ESP-IDF 5 support is in the idf-v5 branch. Note that the branch supports ESP-IDF 5 only; there is no support for ESP-IDF 4.
Work completed:
- Install & update instructions
- Builds (debug, instrumented, release)
- Runs
- I/O updated to use new ESP-IDF APIs
- Audio Out (I²S, PDM)
- Audio In (I²S, PDM)
- Pulse Width
- Pulse Count
Work remaining:
- USB support
- RMT is using the deprecated APIs. Ideally we will move to the new APIs.
- Analog audio input and analog audio output. The APIs for these are not available in ESP-IDF 5.0. They are expected in ESP-IDF 5.1. This may cause us to wait for ESP-IDF 5.1 to be officially released before migrating the Moddable SDK to ESP-IDF 5.
- Test against all ESP32 silicon families
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter at @moddabletech
Moddable SDK 3.7.6
This release contains changes to the Moddable SDK made between February 1, 2023 and February 28, 2023.
This is a relatively modest release. The Moddable team has been busy with projects that use the Moddable SDK, so much of our work on the core Moddable SDK has been fixes and small features. Our community has been busy though, with many issue reports, fixes, and contributions. Thank you to everyone!
One of the projects that has kept us busy is the 2nd edition of ECMA-419, the ECMAScript® Embedded Systems API Specification. This standard underpins a growing number of the core Moddable SDK APIs. The 2nd Edition standardizes many new embedded JavaScript APIs, including many common network protocols, a host of new sensors, and real-time clocks. Much of the specification is already implemented in the Moddable SDK, so you may be using it already! We need all the help we can get reviewing the draft text of the standard. Please give it a look.
Another project we're excited about is xs-dev. xs-dev automates common Moddable SDK tasks like getting set-up, updating, running examples, and creating new projects. It is a step closer to becoming our recommended set-up method thanks to a contribution by the Moddable team this month. There's a great new documentation site for xs-dev that's worth checking out.
The Node-RED MCU Edition project is another embedded project that the Moddable team has been supporting. Built on the Moddable SDK and the 2nd Edition of ECMA-419, it brings the popular Node-RED environment to a wide-range of microcontrollers. Developers working on Node-RED projects are stress testing many edges of the Moddable SDK which has led to a variety of improvements and fixes.
March Community Call
The monthly Moddable Community Call is this Thursday, March 9th at 9:00 AM PST. Join us live on Zoom to learn more about this month's release and chat with the Moddable team.
We'll be joined by Nick Hehr, creator of xs-dev! Nick will talk about what's there now, what's planned for the future, and how you can help. Nick is a great speaker (check out his talk on Offline IoT from JSConf) and a TC53 invited expert contributing to ECMA-419.
Release details
- Documentation
- Add note about module specifier requirements for
setup/*modules. #1021 (requested by @tve) - Fix typos in ESP32 and Tools documents #997 (reported by @nickthiru)
- Add note about module specifier requirements for
- Devices
- Add support for M5Atom S3 Lite (contributed by @kitazaki)
- Add
PulseWidthto IO constructors in M5Atom Matrix, M5Stack, M5Stack Core2, and M5Stick C Plus host provider instance (contributed by @NextWorldLab) - Use more compatible baud rate for debugging M5Stack Core2
- M5Atom S3 flash defaults to DIO for compatibility (contributed by @NextWorldLab)
- ESP8266
- Simplify message queue implementation
- Stability fix for ECMA-419 TCP socket when closing
- URL module now runs
- ILI9341 driver with 8-bit SPI path support for ESP32-S3, ESP32-S2, and ESP32-C3
- ECMA-419
- Examples
- Use manifest for http.js rather than including directly
- BLE scanner example traces address for devices that do not have a name in their advertising packet
- Modules
- Poco renderer now consistently divides render buffer for double buffering
- Poco renderer stores origin/clip stack at end of display rather than in pixels to avoid overwriting pixels waiting to transmit asynchronously
- If Wi-Fi mode not set, default to station mode. #1047 (reported by @nickthiru)
- Tools
- mcrun reports an error when attempting to include JavaScript modules that reference native code. (reported by @tve)
- Correct default upload port for ESP8266 on macOS Ventura
- mcconfig and mcrun
- generate error on attempt to use fontbm when not installed
- trace path of cloned git repositories
- TypeScript
- XS
- Key array can now grow at runtime
- Fix two issues identified by UBSan
- Temporary option to treat weak references as strong references for organic garbage collections. (Workaround for Agoric runtime)
- Fixes for issues found with fuzz testing using Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this effort.
- Allow slot heap to grow contiguously up (for specialized hosts, like xsnap)
Contact Us
If you have questions or suggestions about anything here, drop by our Gitter to chat, start a new Discussion on our GitHub repository, or contact us on Twitter at @moddabletech.