Skip to content

Releases: Moddable-OpenSource/moddable

Moddable SDK 4.4

07 Feb 03:00
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between January 3, 2024 and February 1, 2024.

Highlights of this release include:

  • Moddable Display. Our latest hardware is also our most beautiful. Fully supported in this release.
  • Web Streams. Help explore the feasibility and potential of this powerful web standard on embedded devices.
  • OpenAI text-to-speech provides another high quality option that's easy to add to projects.
  • Bosch BME68x Visualizers for round displays (works in the simulator too). Learn how to use outline graphics to creatively visualize sensor data.
  • Many low-level improvements for nRF52 ports. The port that powers our ultra-low energy Moddable Four is more capable than ever.

New Hardware: Moddable recently launched the Moddable Display product line. Moddable Display is the beautiful way to bring your latest embedded JavaScript project from the workbench to the real world.

Documentation: All of the Moddable SDK documentation is available to read on moddable.com. We recently moved the site to a new hosting provider so browsing the documentation is fast.

Reminder: ESP-IDF v5.1.2 is now recommended for ESP32 development. Please see the January 2024 Release Notes for details on how to update.

Release Details

  • Moddable Display
    • Build build targets to support all Moddable Display products
    • Documentation
  • New Bosch BME68x Visualizers for sensor (temperature, humidity, pressure) on round display
    • Check out the video demo
    • Core host with four different visualizers implemented as mods
    • Great example of using outline rendering to build an advanced UI
    • See readme for details and build instructions
  • Experimental web streams implementation for embedded (!!)
    • Effort to study feasibility of standard web streams on embedded
    • Modified version of WHATWG reference implementation
    • Includes examples using fetch(), ECMA-419 Digital IO, and ECMA-419 touch sensor
    • Conformance verified at better than 99% using Web Platform Tests.
    • See the readme for more information
  • Modules
    • OpenAI text-to-speech support using streaming MP3 audio. (Contributed by @stc1988)
    • New AW3641 flash-light driver (with example). Works with M5Stack Core-S3. (contributed by @NW-Lab)
    • ls013b4dn04 display driver support for 180 degree rotation
      • Works with Moddable Four and Moddable Display 4
        • Jog dial adjusts direction based on screen rotation
        • Accelerometer adjusts direction based on screen rotation
    • structuredClone() fix for TypedArray under XS 14.3
    • Implement TextDecoder special case for invalid UTF-8 data on flush (for compatibility with Web Streams tests)
    • Streaming JSON parser
      • Major documentation update with cookbook and reference sections
      • Eliminated timezone dependency in unit tests
    • MQTT client
      • Keep-alive improvements to eliminate mistaken disconnects
      • Uses elapsed-time rather than time-of-date for keep-alive timeouts
    • Support TLS device certificates for Node-RED MCU Edition
  • ECMA-419
    • TCP socket on macOS no longer tries to look-up IP addresses using DNS. Fixes connection failures.
    • TLS socket now uses normative module specifier embedded:io/socket/tcp/tls
    • HTTP server (listener) example fix for missing request body (reported by @stc1988) #1298
    • MQTT client
      • Now accepts buffer for read() (in addition to number, as before)
      • Keep-alive improvements to eliminate mistaken disconnects
      • Uses elapsed-time rather than time-of-date for keep-alive timeouts
  • XS
    • xst (XS test tool)
      • Uses fdlibm for certain functions of the Math object to guarantee exact results across all platforms test (details). fdlibm is recommended, but not required, by ECMA-262.
      • Supports Fuzzilli on Linux builds (for cloud fuzzing!) (contributed by @raphdev)
      • On macOS and Windows now supports Memory and Undefined Behavior sanitizers (contributed by @raphdev)
    • Bug fixes for issues detected by fuzzing
      • Fix infinite loop in Regular Expression's with nested greedy quantifiers
      • Fix crash calling super() from within an arrow function
      • If SharedArrayBuffer allocation fails, there was a potential to crash on the next garbage collection. Fixed.
      • Consistent out-of-memory handling via fxAbort()
        • JavaScript parser previously threw exception
        • dtoa library previously ignored allocation failures
    • xsbug
      • Crash on surrogate pairs split across buffers fixed
      • REPL now ignores debugger statements, as it does other breaks
  • Devices
    • ESP32
      • Fix sample rate validation on ESP32 audio (reported by @stc1988) #1287
      • Fix audio build on Windows when using ESP32 analog audio (reported by @NW-Lab) #1275
      • Configure output slot for I2S audio on ESP32 (contributed by @stc1988) Fixes #1236
    • nRF52
      • Support for Serial 7E1 and 7O1 modes
      • Optional pull-up on receive pin for serial
      • Supports multiple devices on the same I²C bus
      • Report address of mods flash partition from mcconfig using -t modLocation
      • Free SPI buffers on close()
      • Instrumented builds working again
    • Fix date to conversion for New Year's Day on ESP8266, nRF52, Raspberry Pi Pico, and QCA4020 (off by one error in modGmTime).
  • Tools
  • Documentation
    • Timer
      • Added details of this in callbacks
      • Detailed description of initial and repeat intervals
  • Examples
    • Timer example updated with schedule and unschedule
    • Moddable Four first-run app doesn't try to sleep in debug builds (deep sleep is unavailable in debug builds)
  • TypeScript
    • Typings for embedded:network modules (contributed by @tve)
    • Typings for Header and URL (contributed by @stc1988)

Contact Us

If you have questions or suggestions about anything here, please reach out:

Moddable SDK 4.3.8

03 Jan 23:34
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between December 1, 2023 and January 2, 2024.

Highlights of this release include:

  • Streaming JSON parser
  • LTR-553ALS driver for combined Proximity and Ambient Light sensor (ECMA-419 compatible)
  • nRF52 watchdog timer support

Important: ESP-IDF v5.1.2 is now recommended for ESP32 development.

  • If you used xs-dev to install the Moddable SDK, execute xs-dev update --device esp32
  • Otherwise, follow the update instructions for macOS and Linux and Windows.

Release Details

  • Contributed
    • New streaming JSON parser reduces RAM required to process JSON responses by 10x or more. Invaluable when working with web services that return large, bloated JSON responses. Extensively documented. Includes examples demonstrating different uses including simple property name (key) filtering, pattern matching, and advanced context-aware filters. (Contributed by @markwharton)
  • Devices
    • New ECMA-419 LTR-553ALS sensor driver (Proximity and Ambient Light). (Contributed by @stc1988) This sensor is built into the M5Stack Core3.
    • Built-in ESP32 touch pad support builds with ESP-IDF v5. (reported by @ntGus) #1263
    • Support Watchdog Timer on nRF52 devices (set "USE_WDT":"1" in "build" section of manifest)
  • Embedded Runtime
    • Rework message handling (modMessage) to minimize blocking while processing messages. At most, only messages present at start of service are now processed. (reported by @beckerzito) #1257
    • Only enable unit test support for xsbug:// when debugging is enabled
    • For ESP32, separate out soft-reset (MODDEF_SOFTRESET) support from unit test (MODDEF_TEST) to allow it to be used in more scenarios. Call modSoftReset() from C to request a soft reset at next turn. #1267
  • Modules
    • HTTP server reads through all of ignored request body for maximum compatibility (reported by @tve) #1270
    • HTTP server accepts boxed string (String object) as response body (reported by @tve) #1269
    • ECMA-419 TCP Listener had incorrect destructor function in host hooks leading to crash when terminating virtual machine (reported by @tve) #1267
  • XS JavaScript engine
    • Improvements to adding private field to object in ROM. These are related to stamping private fields (see "Returning overriding object").
      • If object is petrified (fully immutable), adding private field fails with an exception (previously crashed)
      • If object is alias-able, adding private field succeeds
    • XS host hooks modified to support native dispatch table
      • signature field replaces sweeper (unused). Signature indicates the type of the dispatch table that follows.
      • Any fields following signature are defined by the object
      • Use xsGetHostHooks(), xsGetHostHooksIf(), or xsGetHostHooksValidate() to retrieve host hooks for for an object
    • Fix undefined behavior in strtod2() when converting long string literals flagged by UBSAN on oss-fuzz. (Thanks to David M. Gay for review and refinement)
    • String.fromArrayBuffer() and ArrayBuffer.fromString() now correctly handle null characters (reported by @tve) #1271 (thanks to @Frida854 for reporting a problem in the initial implementation #1279)
  • Examples
  • Documentation
    • Describe Files class error handling (contributed by @tve)
    • Document behavior of HTTP server close() (contributed by @tve)
    • Explain handling of Strings in HTTP (contributed by @tve)
    • Recommend install of icon pack when using WSL2 (works around GTK bug). (contributed by @kallistisoft) #1272

Moddable SDK 4.3.4

04 Dec 20:56
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between November 6, 2023 and November 30, 2023.

Highlights of this release include:

  • New animated Piu round-balls example for circular displays
  • New circular display simulator (WaveShare Pico RP2040)
  • Support for M5Dial and M5Stamp S3 devices
  • LittleFS now available on Raspberry Pi Pico

Release Details

  • Devices
    • ESP32 Family
      • Add support for M5Dial device (contributed by @stc1988)
      • Add support for M5Stamp S3 device (contributed by @stc1988)
      • Watchdog timer working again on ESP32 Family devices. Was temporarily broken by upgrade to ESP-IDF 5. (Contributed by @tve)
    • Raspberry Pi Pico
    • nRF52
  • Modules
    • ECMA-419
      • ECMA-419 Serial implementations all default the format to "buffer". This was previously "number" on some platforms. Tracks an update to ECMA-419. EcmaTC53/spec#41 (Reported by @HipsterBrown). Projects that rely on the default format being "number" need to be updated.
      • ECMA-419 HTTP Client consistently updates writable count to fix edge case write failures with TLS. (reported by @sburel)
      • ECMA-419 GT911 touch driver implements get configuration to allow Piu to use its interrupt
      • MQTT.js module implementation now uses URL module
      • ECMA-419 WebSocket module implementation now uses URL module
      • ESP32 family devices running a debug build now reserve the Serial transmit and receive pins used for debugging. If a script attempts to use these pins, it generates an exception. Inspired by report #1226 by @ralphwetzel.
    • ElevenLabs text-to-speech supports additional parameters (contributed by @stc1988)
  • XS
    • Fix typeof operator for host (native) functions to return "function"
    • Module loader now only calls resolve hook once for each unique module specifier in a Compartment
    • Module loader wasn't always decrementing loaded module count, leading to preposterous loaded module count
    • Fix crash in XS debugging support when launching a second time (very rare).
  • Examples
    • New Piu round-balls example for circular displays -- balls bounce of the edges of a circle
    • Fix capitalization of GIF and QRCode paths in Moddable Four First run app to build on case-sensitive file systems
    • httpserverputfile example now uses config.file.root for portability. (Reported by @kallistisoft) #1246
    • Giphy app only opens Flash module instance once. This allows it to work on ESP-IDF 5 which no longer supports memory mapping the same region multiple times. (reported by @stc1988) #1258.
  • Instrumentation
    • Fix instrumentation memory leak when root VM allocated more than once
    • Instrument additional cases of floating point math in add, subtract, and multiply
  • Tools
    • mcrun supports -t build option to build mod without deploying or running
    • New "WaveShare Pico RP2040" device simulator provides round screen (for use with piu/round-balls example)
    • ESP32 makefile on macOS & Linux supports experimental -t buildArchive to build the archive with Moddable SDK objects but not build and link the ESP-IDF host (for specialized scenarios like building the Moddable SDK into an ESP-IDF application)
    • XS Linker fixes #1209 again ("0" and "@" confusion). This original fix was broken when fixing #1232. Both #1209 and #1232 are now fixed. Thanks to @linfan68 for re-reporting.
  • Tests
    • Add warning if Resource slice test on fails on Windows because Moddable SDK was checked out with Windows line endings instead of Unix line endings
  • Documentation

Moddable SDK 4.3.0

06 Nov 20:36
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between October 2, 2023 and November 5, 2023.

This release contains many enhancements for mods, one of the most unique and popular features of the Moddable SDK. Highlights of this release include:

  • The XS performance profiler now works with mods, so you can profile all the JavaScript code in your project (including the examples in our book.
  • Arrow functions are incredibly popular with JavaScript developers for their compact syntax. They are so popular that developers often use them when their primary feature -- automatically binding to this -- isn't needed. We've reduced the memory use arrow functions that don't access this so embedded JavaScript developers can use them with the smallest possible overhead.
  • ESP-IDF v5 support has deepened with improvements to several more modules since rolling out last month in Moddable SDK 4.2. Thank you to the developers who reported issues and helped with fixes.

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
  • The Node-RED MCU Plug-in by @ralphwetzel is live. It has some great new features include:
    • Support for Node-RED v3.1.0
    • Support for Moddable Four and other nRF52 powered devices

November 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

  • Modules
    • Servo driver fix for ESP-IDF v5. Contributed by @meganetaaan.
    • ESP32 audio out no longer uses deprecated is2_write_expand, configuring the IDF driver to do the expansion instead. Reported by @meganetaaan. #1227
    • Improve PSRAM support ESP32 family devices with sdkconfig updates to consistently set CONFIG_SPIRAM_USE_MALLOC
    • ILI9341 (MIPI) display drivers
      • command() API supports all byte buffers now, not just ArrayBuffer
      • Experimental ESP32 ILI9341 parallel display driver updated to work with ESP-IDF v5.
    • SSD1306 driver builds in all cases again (change to destructor failed in some cases). Reported by @stc1988 and @PLCMercenary. #1239
    • ECMA-419
      • Restore serial driver bypass on ESP32. Reported by @meganetaaan. #1226
      • Moddable Four host provider instance now includes PulseCount, SPI, and LIS3DH sensor driver.
    • Raspberry Pi Pico
      • Neopixel driver uses ws2812.pio from Pico SDK for easier maintenance
      • Raspberry Pi Pico build now uses PICO_SDK_DIR instead of PICO_SDK_PATH. Contributed by @stc1988.
    • Outline rendering fix for ESP32-S3. Cannot use program memory (IRAM) for rendering buffer (works on ESP32). Reported by @meganetaaan who also helped isolate the problem. #1239
  • XS JavaScript engine
    • Reduce memory use by arrow functions that do not use this. This optimizes a common pattern of JavaScript developers: use of arrow functions when the this binding is not needed.
    • Array destructuring now correctly caches the iterator's next. Reported by @gibson042 #1223
    • Regular Expression maximum qualifier was not always applied correctly. Reported by @Jinyn01. #1238
    • RegExp.prototype.source now only escapes \ if necessary, consistent with web engines. Issue found when testing fix for #1238.
    • Fix bug in linker when building mods that caused symbols to be omitted. Many thanks to @stc1988 for reporting this obscure bug. #1232
    • Debugging support no longer triggers a spurious breakpoint when inspecting a property implemented by a getter.
    • Fixes for issues identified by fuzz testing with Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this work.
      • Fix use of uninitialized variable in rarely used path in module loader
      • String.prototype.replace and String.prototype.replaceAll changed to eliminate uninitialized variable warning from UBSan (the uninitialized value was never used)
      • dtoa (widely used library to convert floating point numbers to strings) updated to eliminate use of an uninitialized variable. There is no evidence this bug ever caused a conformance issue or created a vulnerability in XS. Many thanks to David M. Gay for the patch.
      • In certain memory configurations, passing a search string to String.prototype.replace or String.prototype.replaceAll that was longer than the string to be searched read from unintended memory which could crash if that memory was unmapped.
  • TypeScript
    • Fixes to wifi and pins/digital type declarations
  • Examples
  • Documentation
    • ESP32 documentation now lists all supported members of the ESP32 family
    • Fix link to BLE Remotes blog post in BLE HID peripheral example. Contributed by @stc1988.
    • Mods documentation describes the current archive format used for mods, as well as a basic introduction to the Atom/Box file structure archives use.
    • Linux portion of Getting Started document updated based on developer feedback
  • Tools
    • mcrun (build tool for mods)
      • Suppress output of default check module when pixel format is set to x (unknown -- typically used for projects without a display)
      • Suppress output of empty config module when no configuration properties are defined for the mod
      • For nRF52, adds support for serial connected devices
      • For ESP32, now discovers serial ports consistently with mcconfig
    • XS Profiler now supports profiling mods. This required assigning profile IDs to functions in mods during of remapping process.
    • mcconfig reports an error if it detects it is building a mod, and recommends use of mcrun instead. Inspired by report from @kallistisoft.
    • xs linker (xsl) now preloads modules prefixed with lockdown/ last when preloading. This allows modules to perform operations to prepare the environment immediately before lockdown, after all ordinary preloaded modules have run.
    • xs test tool (xst) makes lockdown() and harden() available when running test262 harness to support more Hardened JavaScript tests

Contact Us

If you have questions or suggestions about anything here, please reach out:

Moddable SDK 4.2.1

11 Oct 19:24
Compare
Choose a tag to compare

This is an interim release of the Moddable SDK to support specific projects.

We will publish a release at the start of November on our usual monthly schedule.

Release notes will be provided at that time.

Moddable SDK 4.2

03 Oct 00:53
Compare
Choose a tag to compare

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.json to drive build, allowing easy use of npm and other JavaScript ecosystem tools
    • Analyzes project code to automatically generate a Moddable manifest.json optimized for the project
    • Experimental! Please share your experiences to help evolve mcpack

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_ili9341
        • esp32/qtpyc2_ili9341
        • esp32/qtpys3_ili9341
        • esp32/xiao_esp32c3_ili9341
        • esp32/xiao_esp32s3_ili9341
        • esp32/esp32h2_ili9341
        • esp32/esp32c6_gc9a01
    • nRF52
      • $(UF2_VOLUME_NAME) now handled correctly on on Windows (reported by @NextWorldLab) #1207
      • Include pwm in 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
    • ESP8266
      • modGPIO.h needs to be included when build ECMA-419 IO. (reported by @dtex) #1212
  • 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
      • 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
    • 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.
      • mcpack is a front-end to existing Moddable build tools like mcconfig and mcrun
      • mcpack starts from package.json and analyzes your project's dependencies to automatically generate a Moddable SDK manifest.json
      • mcpack detects the use of Moddable SDK built-in modules and automatically adds them to the generated manifest.
      • mcpack detects 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.
      • mcpack detects the use of top-level await (TLA) and automatically generates the needed manifest settings to enable TLA
      • mcpack introduces the "moddable:" namespace for built-in modules. The prefix is optional, so built-in modules may be accessed as "timer" or "moddable:timer".
      • mcpack uses the runtime key "moddable" (registered with WinterCG) to allow package.json to include runs that apply only to Moddable SDK builds.
      • mcpack allows 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 with mcpack.
      • mcpack is experimental. We expect it to evolve based on community feedback. Please give it a try!
      • mcpack is 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 mcconfig and mcrun. -d for default debugger (launch xsbug), -dn to not launch debugger, -dl to launch xsbug-log, and -dx to launch xsbug. -l is still supported for xsbug-log, but will eventually be removed. New flags are available on macOS and Linux; Windows is coming soon.
    • mcrun improvements 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 (breakOnStartFlag only available in debug builds)
    • Rename DISPLAY and ROTATION build variables to COMMODETTOBITMAPFORMAT and POCOROTATION to 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-log now supported for Raspberry Pi Pico Linux builds
      • mcconfig now 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)
  • 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 error case for unsupported platforms to generate earlier failure with clearer message
    • ECMA-419
      • HTTP client
        • Don't require input HTTP headers to be normalized to lowercase (reported by @tve) #1218
        • Handle HTTP 204 and 205 (no content) responses (reported by @tve) #1219
      • Digital bank
        • Fix deadlock in close() uncovered by ESP-IDF v5
    • Poco refactored for better compatibility. The commodetto/PocoCore module is now the foundation and the commodetto/Poco module contains the drawing primitives. This revises a change in Moddable SDK 4.0 made to reduce...
Read more

Moddable SDK 4.1

11 Sep 20:51
Compare
Choose a tag to compare

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 creation for 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:// and mqtts://), 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_RESTARTON ESP32 feature
    • 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.
  • XS 14.2
    • Stepping of await and 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() and xsImportNow() 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 of Math.idivmod().
    • String.prototype.normalize fix 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)
  • 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 serverName field 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.
    • Headers class moved to data/headers to be more generally available (previously in fetch module)
    • New readString() method on Flash object to read UTF-8 strings from flash directly into JavaScript string
  • 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)
  • Examples
    • ECMA-419
      • https client example now traces errors to the console in case of request failure
      • The ECMA-419 manifest_io.json no longer includes manifest_base.json. This required updates to the manifests of many ECMA-419 examples which depended on manifest_base.json being 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
  • 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:

Moddable SDK 4.0

11 Aug 18:57
Compare
Choose a tag to compare

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
    • Espressif ESP32 family
    • Raspberry Pi Pico
      • Pico WaveShare ws_round split to have version with and without touch
  • Modules
    • Graphics & UI
      • Piu Image class broken out into separate module to reduce default footprint of Piu. Include $(MODDABLE)/modules/piu/MC/colorcell/manifest.json to 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.json to 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
    • 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 onCharacteristicRead returns undefined indicating no value is ready
      • Optional notification after each advertisement sent (nRF52 only)
    • 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() and Instrumentation.name() APIs simplify programatic access to instrumented values. See documentation and updated example.
    • Removed out-dated, experimental ECMA-419 Wakeable pins
  • 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 Generator and AsyncGenerator support 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/i2c on 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/analog works on ESP32-S2 and ESP32-C3
  • Testing
  • 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:

Moddable SDK 3.9.7

10 Jul 22:11
Compare
Choose a tag to compare

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
  • 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/pwm module
    • Add Time.delta() to calculate differences in Time.ticks values correctly and efficiently. Suggested by @tve. #1162
    • fetch() now accepts an object literal for headers. Improves web compatibility.
    • pins/servo module 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/aborthook example 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
  • ECMA-419
    • BME68x ECMA-419 sensor driver now correctly handles all I/O errors
    • SMBus ECMA-419 I/O provides read() and write() 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 of xsToReference()
    • 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 NaN values. 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 setting mxCanonicalNaN build 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
    • mcconfig and mcrun now 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
    • mcconfig now 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.ts so it is only a declaration, not an implementation
    • System.resolve has no return value
    • weight argument to Outline.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"
      • Use xsmcVars() in xsmc* examples and to include xsmcDefine() Reported by @tve. #1141
      • Note formatting options available supported by xsLog()
      • Correctly document arguments to xsmcCall()
    • 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.ticks and 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

Contact Us

If you have questions or suggestions about anything here, please reach out:

Moddable SDK 3.9.4

07 Jun 16:26
Compare
Choose a tag to compare

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
  • Audio
  • 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/monitor working 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
    • mcrun for ESP32 sources ESP-IDF exports.sh to provide identical Python environment as mcconfig.
    • mcrun reports specific error message when attempting to build a project that includes native code #1098
    • mcconfig outputs recursively merged manifests as manifest_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 xst command line tool
      • Disabled in MCU builds where dynamically creating and discarding keys is very rare
      • Support enabled by mxKeysGarbageCollection flag
    • "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 BigInt change that caused incorrect add calculation 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.
  • 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: