Skip to content

Releases: Moddable-OpenSource/moddable

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:

Moddable SDK 3.9.2

24 May 17:10
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 June on our usual monthly schedule. Release notes will be provided at that time.

Moddable SDK 3.9.1

04 May 22:59
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between April 1, 2023 and May 4, 2023.

Highlights of this release include:

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
    • 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 xst command line tool. In all other environments, it is disabled by default and can be enabled by setting the mxExplicitResourceManagement build 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 mxAliasInstance is 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)
    • fetch implementation updated to handle responses with content-length of 0. #1080 (reported by @NextWorldLab)
    • ECMA-419 mqttclient implementation 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 Digital and DigitalBank updated to use ESP-IDF constants to check for pin availability for better portability across the ESP32 silicon family
      • Uses i2s_write_expand for 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 creation section 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_SUBPLATFORM to 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 build section of manifests. This avoids a dependency on paths, which is particularly useful for device ports.
    • Fixes for incr...
Read more

Moddable SDK 3.8.7

20 Apr 23:38
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 May on our usual monthly schedule. Release notes will be provided at that time.

Moddable SDK 3.8.0

11 Apr 04:08
Compare
Choose a tag to compare

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
    • ESP8266
    • 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
  • 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
    • 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
  • 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)
    • 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, and all (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_PORT and XSBUG_LOG environment 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
  • 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:

Moddable SDK 3.7.6

07 Mar 18:56
Compare
Choose a tag to compare

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)
  • Devices
    • Add support for M5Atom S3 Lite (contributed by @kitazaki)
    • Add PulseWidth to 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
    • MQTT client keep-alive fix (contributed by @tve)
    • MQTT.js client ID options fix (contributed by @tve)
    • SPI on ESP32 and ESP8266 defaults active to low (conformance) #1051 (reported by @tve)
  • 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
    • Add typings for console module (contributed by @chigix)
    • Add typings for secure socket module (contributed by @chigix)
  • 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.

Moddable SDK 3.7.0

07 Feb 20:49
Compare
Choose a tag to compare

This release contains changes to the Moddable SDK made between January 2, 2023 and February 1, 2023.

Highlights of this release include:

  • New sensor drivers for ADPS-9960 (ambient light and proximity), PZEM-004T (energy), and AMG88xx (GridEYE) infrared temperature sensor
  • ESP32 built-in Ethernet support
  • Faster builds on Windows

February Community Call

The monthly Moddable Community Call is this Thursday, February 9th at 4:00 PM PST. Join us live on Zoom to learn more about this month's release, hear about our experience to the FOSDEM open source conference in Belgium, and chat with the Moddable team.

Release details

  • ECMA-419
    • New APDS-9960 sensor driver (Ambient Light Sensor, Proximity, Gesture)
    • New PZEM-004T energy monitor sensor driver with two example apps - command line and GUI
    • New AMG88xx (GridEYE) infrared array temperature sensor
    • lwip versions of TCP and UDP sockets use task-safe API wrappers for greater reliability (based on issue reported by @mshioji)
    • lwip TCP defers error report until pending data read (matches macOS and Linux behavior)
    • TCP write failures due to disconnected socket trigger onError rather than throwing (consistent error handling for client code)
    • HTTP, MQTT, and WebSocket clients report error when TCP constructor throws (based on issue reported by @ralphwetzel)
    • MQTT client
      • timeout when connecting (reported by @mshioji)
      • invokes onError if connection acknowledgment fails (invalid password)
      • defaults to port 1883 (was using 80)
    • HTTP Client
      • read without argument reads all available
      • If error occurs, invoke callback on pending requests
      • Report completion of current request before error that only impacts pending requests
      • onClose renamed to onError for consistency.
      • onDone uses ECMA-419 completion callback semantics to report success and failure
    • TLS client invokes onError on remote disconnect
    • I2C read return value when reading into a buffer is now number of bytes read (conforms to specification) on ESP8266, ESP32, and Pico
    • Update first argument to callbacks in async I2C and SMBus to be null or Error instance to match ECMA-419 spec (which matches Node.js)
    • SPI constructor on ESP8266 and ESP32 throws if port is undefined #1005
    • PulseWidth input property names updated to match Digital names where possible
    • PulseCount on ESP32 now initializes triggered field to eliminate occasional zombie instances
    • GT911 and FT6206 touch drivers conformance fixes - return empty array on last touch up event and undefined until next touch down
    • BMP180 and BMP280 sensors conformance fixes to improve error handling (reported by @kitazaki)
    • BMP280 sensor driver provides useful default configuration (reported by @mshioji)
    • BMP280 sensor driver update to work with I2C read conformance fix
    • TMP102 temperature sensor conformance fixes and don't orphan I2C instance on error
    • LIS3DH accelerometer sensor error handling fix to avoid orphaning I2C instance
    • HC-SR04
      • proximity sensor conformance fixes
      • trigger pin optional
      • add example using multiple HC-SR04 sensors
    • SMBus based sensor drivers updated to eliminate use of deprecated SMBus function names
    • Updated sensor summary document (contributed by @Sineos)
  • Modules
    • Network
      • Ping - update implementation to use private fields to eliminate unintended interactions with client code, better error handling, pass packet identifier to callback, ignore non-ping packets instead of failing
      • TCP socket on macOS reference count fix if error during resolve
      • Remove experimental HTTP suspend support (use ECMA-419 HTTPClient instead)
      • MQTT client
        • Will fix (incorrect length)
        • No callbacks after close
      • WebSocket client
        • No callbacks after close
        • Report errors (e.g. Protocol Upgrade fail) through error callback rather than throwing (so client code can recover)
    • Neopixels driver allows runtime override of build-time configuration
  • Tools
    • Parallel execution of cl for faster Windows builds
    • Optional parallel processing of NMAKE files in Windows Moddable SDK tools build using parallel_build.bat. See the Windows Getting Started Guide for details. - Fix calculations when wav2maud upsamples to avoid generating invalid file
    • mcrun supports -x option to redirect xsbug connection
    • Enable metering in xst for oss-fuzz to catch runaway tests (contributed by @raphdev)
    • Free up system memory in testmc by reducing number of keys (original value based on test262, which needs far more)
    • serial2xsbug on Linux now reliably initializes serial connection to fix intermittent xsbug connection failures (contributed by @tve)
    • Use MACOS_ARCH environment variable to support building universal tool binaries
    • Consistently set minimum macOS version to 10.7
    • Fix Windows build of xst
  • Devices
    • ESP32-C3 build updates to work with ESP-IDF changes for RISC-V #975 & #996
    • ESP32
      • Built-in Ethernet support #844
      • Wi-Fi and Ethernet co-existence
      • Support for WT32-ETH01 development board, platform identifier esp32/wt32_eth01
      • Fix ESP32-S2 build by adding Pulse Width Input stub (not supported by hardware)
    • Pico
      • Remove port from I2C constructor options (can be inferred from pins)
  • XS
    • Fixes for issues found with fuzz testing using Fuzzilli and oss-fuzz. Thank you to @Agoric for their ongoing assistance with this effort.
    • Weak references are garbage collected sooner
    • Add metering macros to xs.h
    • Fix integer overflow in TypedArray constructor (caused by undefined behavior in release builds only)
    • ArrayBuffer.prototype.slice conformance fixes to eliminate vulnerability with buffer size
    • Fix garbage collector trashing behavior
    • Fix buffer overflow in host's fxFindModule implementations with long module paths
  • Tests
    • In-depth tests for original networking modules
      • SNTP client
      • HTTP client
      • DNS resolver
      • WebSocket client
      • MQTT client
      • Ping client
  • TypeScript
    • Add blank text/index.d.ts file to quiet Visual Studio warning (contributed by @tve)

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.

Moddable SDK 3.6.0

11 Jan 05:46
Compare
Choose a tag to compare

This release contains changes to the Moddable SDK made between December 1, 2022 and January 2, 2023

Highlights of this release include:

  • Git repositories may now be included directly in project manifests – no more manually cloning repositories
  • View debug traces in your development terminal instead of xsbug – great for headless development
  • New development boards – M5Atom S3 and Adafruit ESP32-S3 TFT Feather
  • New sensors – APDS9301 (ambient light), VL6180 (proximity and ambient light), HC-SR04 (proximity)
  • ECMA-419 TLS client
  • Server Sent Events support using standard Web EventSource API

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.

Preview of New Tool to Manage Moddable SDK Set-up

We've been working with the xs-dev project to make it easier to install and update the Moddable SDK. xs-dev automates the install and update of the Moddable SDK and embedded toolchains, so you don't have to follow the instructions yourself. It saves a lot of time and eliminates potential mistakes.

We hope to soon recommend xs-dev as the best way to manage your Moddable SDK set-up. Before we do that, we'd like some more developers to give it a try. We're interested in hearing about what worked, what could be easier to understand, and anything that went wrong. If you have a few minutes, take a look and give it a try. We're particularly interested in set-up on machines that have never had the Moddable SDK installed before. Thank you!


  • ECMA-419
    • New APDS9301 Ambient Light sensor driver and examples for use with interrupt and polling.
    • New VL6180 time-of-flight Proximity and Ambient Light sensor driver and example. (Requested by @mshioji who provided initial testing and debugging help. Thank you.)
    • New HC-SR04 ultrasonic Proximity sensor driver and example
    • TLS client socket implementation
    • HTTPS client socket implementation (combines TLS and HTTP clients)
    • fetch API implementation supports HTTPS
    • Experimental new Pulse Width input I/O class. Implemented on ESP32 for use by HC-SR04 ultrasonic range sensor
    • Implementation of Web EventSource API to receive Server Sent Events using ECMA-419 HTTP & HTTPS
    • FT6206 constructor uses sensor instead of i2c to match all other sensors
  • Tools
    • Project manifests may now include remote Git repositories. The repository is automatically cloned by mcconfig and mcrun when building. Details and examples in the Manifest documentation.
    • Option to redirect debug console output to the terminal rather than to xsbug. See documentation on -l option for set-up instructions. Supported on builds for simulator and ESP32 builds on all platforms.
    • ESP8266 build on Windows build supports -x option (@ralphwetzel)
    • First run of xsbug on Linux doesn't throw on missing preferences file #981 (reported by @tve)
    • Don't filter in xsbug's "find lost file" dialog on Linux #988 (reported by @tve)
    • Output more version information on ESP32 build for diagnostics (#996)
    • Linux build sets the shell to /bin/dash to avoid issues with echo newline interpretation in other shells #979 (reported by @tve)
    • Check for ESP-IDF install by looking for idf.py instead of an environment variable (more reliable). (Reported by @ralphwetzel)
  • Devices
  • Modules
    • AudioOut and Mixer classes provide properties to get samplerate, streams, bitPerSample and numChannels
    • AudioOut on ESP32 clears output on stop to avoid glitch on restart
    • Optimize BLE client GATT dispatch and look-up; reduce GC impact
    • Fix OneWire build on ESP32-C3 (#996)
    • Correct st127x driver name to sx127x #990 (reported by @tve)
    • Allow version 13 in sx127x driver #990 (reported by @tve)
  • XS
    • Fixes for issues found with fuzzing (thank you @Agoric)
    • xst optimizations to improve fuzzing performance
    • Simplify memory management JSON.parse and JSON.stringify for easier clean-up on exception
  • Examples
  • Documentation