Releases: Moddable-OpenSource/moddable
Moddable SDK 5.12.0
Moddable SDK 5.12.0 contains improvements made between September 11, 2025 and October 2, 2025
Zephyr RTOS Port Preview
Zephyr is an open source RTOS project hosted by the Linux Foundation. We like its lightweight runtime and rigorous design. Zephyr runs on hundreds of development boards across many major silicon families.
Moddable has begun porting the Moddable SDK to Zephyr. The initial focus is on silicon from STMicroelectronics. ST has an impressively broad portfolio of embedded microcontrollers with strong IO capabilities. ST silicon support is a common request. We're excited to publish a branch of the Moddable SDK with our Zephyr port in progress.
Our Zephyr blog post has all the details. We're looking for contributors to try out the port, track down bugs, help implement modules, and try it out on more silicon.
New ECMA-419 DNS-SD Preview
DNS-SD is a network protocol for devices to discover each other on the local network. It is widely used on computers, phones, and consumer electronic products. It is formally defined in RFC 6763 The Moddable SDK has long supported these protocols. More recently Ecma TC53 has proposed a standard API for DNS-SD that builds on the class patterns for embedded devices in ECMA-419. The ECMA-419 API is simpler to use, more flexible, and more powerful.
This release of the Moddable SDK contains the first implementation of the ECMA-419 DNS-SD API. The committee's work is not yet complete, so changes are possible. Please consider this a preview.
To work with DNS-SD, first create an instance of the service:
const dnssd = new (device.network.mdns.io)(device.network.mdns);Use that instance to claim a name on the local network:
const claim = dnssd.claim({
host: "example-server",
onReady() {
trace(`"example-server" claimed\n`);
}
});Once the name is claimed, you're ready to advertise services on the local network:
dnssd.advertise({
serviceType: "_http._tcp",
instanceName: "419 Web Server",
host: "example-server",
port: 8080
});Discovering DNS-SD services on the local network is just as easy:
dnssd.discover({
serviceType: "_http._tcp",
onFound(service) {
trace(`Found: "${service.name}" on ${service.host} @ ${service.address}:${service.port}\n`);
},
onUpdate(service) {
trace(`Update: ${service.name}\n`);
},
onLost(service) {
trace(`Lost: ${service.name}\n`);
}
});The API supports making multiple claims, advertising multiple services, and discovering multiple kinds of services.
We've got an all-new example that shows how to use all these features in more detail. The example works best on ESP32 and has also been tested on macOS. We've also added TypeScript type declarations.
Give it a try and let us know how it goes.
macOS Tahoe 26
We've verified that the Moddable SDK is compatible with the latest release of macOS. We've updated the icons of our xsbug and mcsim applications for the new OS.
ESP-IDF v5.5.1
The Moddable SDK has migrated to ESP-IDF v5.5.1 for all ESP32 family builds. The release contains improvements from Espressif, particularly BLE. As usual, no code changes are required for the vast majority of projects using the Moddable SDK. Updating takes just a few minutes:
- If you use xs-dev to install the Moddable SDK, execute
xs-dev update --device esp32 - Otherwise, follow the update instructions for macOS and Linux, or Windows.
Release Details
- ECMA-419
- New mDNS / DNS-SD service added
- New BLE Client and Server updated to reflect latest TC53 recommendations
- Update MCP23017 expander manifest and example (contributed by @stc1988)
- Contributed
- conversationalAI fix for typo in default voice. (contributed by @stc1988)
- Examples
- New ECMA-419 mDNS / DNS-SD example showing initialization, local name claiming, service advertising, and service discovery.
- Documentation
- XS in C updated to include
xsCallFunction*macros (requested by @rmontrosecbw)
- XS in C updated to include
- Tools
- Modules
- DNS serializer now also accepts a
Mapinstance fortxtrecord - Fix path for mbedtls on Windows for latest ESP-IDF (contributed by @rmontrose)
- DNS serializer now also accepts a
- XS JavaScript engine
- Linker no longer truncates strings longer than 64 KB
- TypeScript
- ECMA-419 mDNS / DNS-SD typings added
- ECMA-419 BLE Client and Server typings updated
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.11.0
Moddable SDK 5.11.0 contains improvements made between August 12, 2025 and September 11, 2025.
New ECMA-419 BLE Server
This release contains a completely new API for implementing Bluetooth Peripherals (also called BLE Servers). Our original Peripheral has worked well for many years, but has some shortcomings that we wanted to address. Moddable has proposed this API to Ecma TC53 to become part of the ECMA-419 standard.
The server API is mostly about describing the BLE services, characteristics, and descriptors that make up the device. Rather than a long list of APIs to call to define all those, a single JavaScript object fully describes the hierarchy of services, characteristics, and descriptors within a device. This results in extremely direct, readable code that makes creating and maintaining a BLE Peripheral much easier. Check out our heart-rate monitor server example to see how it works.
The server is implemented for both ESP32 using the NimBLE stack and macOS using Core Bluetooth. This is the first time we've supported Bluetooth server in the simulator. This has proven to be incredibly powerful for accelerating Bluetooth development, even with the limitations of Core Bluetooth.
The new BLE Server is still experimental, so you can expect changes. But it is working very nicely, so we wanted to share it now to get experience and feedback while it is still evolving.
New ECMA-419 BLE Client, secured
This release contains numerous improvements to our new BLE Client, most notably a first draft of support for security including pairing and bonding. The new health temperature example shows how easy it is to add security settings to your BLE client. Learn about our new BLE Client in July's release notes.
ESP-IDF v5.5.1
The Moddable SDK has migrated to ESP-IDF v5.5.1 for all ESP32 family builds. The release contains improvements from Espressif, particularly BLE. As usual, there should be no code changes required for the vast majority of projects using the Moddable SDK. Updating takes just a few minutes:
- 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, or Windows.
Note: Updating to the latest ESP-IDF using xs-dev is now more reliable. xs-dev now automatically determines the ESP-IDF version required by the Moddable SDK, so there's no need to update xs-dev to have it use the recommended ESP-IDF version. Of course you will need to update xs-dev to get these improvements ;) Thank you to @stc1988 and @HipsterBrown for their contributions to this improvement.
Release Details
- ECMA-419
- BLE Client
- 128-bit UUID strings correctly formatted
- Improve error reporting and out-of-memory handling
enableNotificationsdivided intosubscribeandunsubscribefiltersremoved from the constructor options object and itsservicesproperty is now at the root of the constructor options object- Added new example showing how to use ECMA-419 GAPClient for BLE discovery and then handoff to Web Bluetooth for GATT operations. This provides developers full flexibility on discovery, something that is expressly prohibited by Web Bluetooth.
- Implemented experimental security support – pairing and bonding. See secure health temperature example.
- HTTP Client
- Eliminate cascade of unnecessary floating-point operations when no content-length given on unchunked response
- BLE Client
- Modules
- Piu
- Save 8 bytes of memory on each Piu
Contentinstance by optimizing data structures
- Save 8 bytes of memory on each Piu
- Bluetooth / BLE – more comprehensive workaround for ESP-IDF bug where notifications are not delivered to client unless ESP-IDF BLE server code included in build
- Eliminate unnecessary floating-point operations in MP3 decoder
- Piu
- Devices
- M5StackCoreS3 now uses ECMA-419 touch sensor driver (contributed by @stc1988)
- Ethernet support on ESP32 devices enhanced to support WizNET W5500 and use code from ESP Component Registry. (contributed by @rmontrosecbw)
c_rand()on ESP32 and ESP8266 now returns non-negative signed values to matchrand()(previously could generate negative values which broke some native code)
- Examples
- ethernet-monitor updated to use working time server (contributed by @rmontrosecbw)
- Tools
- More flexible ESP-IDF version check
- Include expected ESP-IDF version in esp32/manifest.json; use that everywhere the ESP-IDF version needs to be checked
mcrunhas new-noCheckModuleoption to explicitly suppress generation of thecheckmodule. Replaces overload of-f x.
- XS
- Optimize JavaScript stack use by
Function.prototype.call,Function.prototype.apply, andFunction.prototype.bind. Eliminates one stack frame, which benefits Piu initialization and ECMA-419 callbacks. - Merge better fix for undefined behaviors in fdlibm
fmod - Fix native stack overflow on recursive
Set(found by Fuzzilli)
- Optimize JavaScript stack use by
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.10.1
This is an interim release with the following improvements:
- Expected ESP-IDF version now stored in only one location – the ESP32 device manifest
- Improve workaround for ESP-IDF v5.5 BLE bug to resolve link errors with some examples
Moddable SDK 5.10.0
Moddable SDK 5.10.0 contains improvements made between July 16, 2025 and August 12, 2025.
This is a relatively small release due to summer holidays and work on features that are not yet ready to publish.
ESP-IDF v5.5.0
The Moddable SDK has migrated to ESP-IDF v5.5.0 for all ESP32 family builds. The release contains many improvements by Espressif, particularly I²C and BLE. As usual, there should be no code changes required for the vast majority of projects using the Moddable SDK. Updating takes just a few minutes:
- 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, or Windows.
ESP-IDF I²C Upgrade, again
In Moddable SDK 5.10.0, we've brought back support for Espressif's new i2c_master API. With ESP-IDF v5.5, the majority of issues appear to have been resolved. We are still working around one bug.
New ECMA-419 BLE Client, continued
This release contains numerous improvements to our new BLE Client and Web Bluetooth module. Thank you to @stc1988 and @mshioji for sharing their suggestions and observations. Learn about our new BLE Client in last month's release notes. We've also integrated our new BLE Client into Node-RED MCU Edition.
Release Details
- ECMA-419
- BLE Client
- Fix characteristic completion callback on macOS
- Set
targetin constructor - UUID strings are lowercase (macOS)
- Report scan errors (ESP32)
- Ensure
enableNotifications()fully completes before the next queued operation starts (ESP32) - Disable Espressif's auto-reconnect (ESP32)
- Encode connection type into address to allow connecting to non-public addresses (ESP32)
- Fix 128-bit UUID strings (ESP32)
- Work around bug in ESP-IDF v5.5 NimBLE that disables notifications
- Improve out-of-memory failure handling (ESP32)
- BLE Client
- Modules
- Web Bluetooth
getCharacteristicsworks for find all (contributed by @stc1988)getPrimaryServicesandgetCharacteristicswork when passed no arguments- Eliminate double
newinpropertiesgetter (contributed by @stc1988) removeEventListenerfix for finding item (contributed by @stc1988)- Fix typo with
writeWithOutResponse(contributed by @stc1988)
- Migrate M5StackCoreTouch to ECMA-419 (contributed by @stc1988)
- Web Bluetooth
- Examples
- io/ble – uuids are lowercase
- Documentation
- Tools
mcpackreports module format requested when reporting invalid module format- Workaround undefined left shift in
fmod. This will likely change again in the next release to a more complete solution.
- Typings
- Add Base64 & Hex to
Uint8Array - Declarations for new ECMA-419 BLE client
- Add default export for URL module
- Add Base64 & Hex to
- Devices
- Added
creationto all ESP32 devices without one. These are required for optimal default memory partitions.
- Added
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.9.0
Moddable SDK 5.9.0 contains improvements made between June 12, 2025 and July 16, 2025.
Realtime AI Tools
Over recent months, we've updated our new Realtime AI Architecture with support for OpenAI, Google Gemini, Deepgram, ElevenLabs, and HumeAI. Our latest update isn't another AI service but support for "Functioning calling", sometimes called tools, where the AI service calls functions in your application to perform an action or retrieve information. Fortunately, the AI services have largely standardized how this is done, making it practical to support the same Function call interface in Moddable's Realtime AI architecture.
This release of the Moddable SDK includes a simple example to get you started. Check out the new ChatAudioIO-Tools example on ESP32, macOS, Windows, and Linux. The voice agent provides temperatures for locations in and around a home along with the ability to control the thermostat and air conditioning.
All new Bluetooth LE Central
This release contains a completely new API for implementing Bluetooth Centrals (also called BLE Clients). Our original Central has served us well for many years, but has some shortcomings that we wanted to address. Moddable has proposed this API to Ecma TC53 to become part of the ECMA-419 standard. The current draft API is available to read as part of the ECMA-419 4th Edition working draft.
We've created a suite of examples to help you get started with the new API. You can run these on ESP32 using the NimBLE stack or on macOS using Core Bluetooth. This is the first time we've supported Bluetooth in the simulator. This has proven to be incredibly powerful for accelerating Bluetooth development.
The new BLE Client is still experimental, so you can expect changes. But it is working very nicely, so we wanted to share it now to get experience and feedback while it is still evolving.
Web Bluetooth
This release also includes a new implementation of Web Bluetooth! This is built on our new BLE Client, making it available on ESP32 and macOS too. We've got an example to help you get started.
Web Bluetooth is a very high-level API, making it very pleasant to develop with. However, because it was designed for use in a web browser, it has many restrictions to protect the user's security. These don't always make sense on an embedded device In particular, the way a device is discovered isn't perfectly suited to embedded devices. Currently, the first matching device that is found is selected. This is imperfect and will evolve, but is sufficient for development.
ESP-IDF I²C downgrade
In Moddable SDK 5.8.0, the I²C support for ESP32 reverted from Espressif's new i2c_master to the previous I²C API due to a large number of issues reported. It appears the next ESP-IDF addresses at least some of these issues. Note that Moddable SDK 5.8.0 did not fully downgrade; specifically, the 419 I²C was downgraded but not the original Pins I²C. In Moddable SDK 5.9.0, both have been downgraded.
Release Details
- Modules
- Deepgram support in ChatAudioIO now uses A-Law encoding for the user input to reduce bandwidth signficantly
- ESP32 Ethernet driver replaces
VSPI_HOSTwithSPI3_HOST(reported by @rmontrosecbw) #1509 - New Web Bluetooth module
- DS18X20 temperature sensor driver does reset before copying scratchpad (reported by @mauroForlimpopoli) #1514
- XS
BigInt.prototype.toStringrewritten to be up to 30x faster- Added
xsNewFunction*macros to xs.h to invoke constructors directly - Fix undefined left shift in the fdlibm implementation of
fmod - Add
fxAsyncFromSyncIteratorFailedto snapshot table
- ECMA-419
- HTTP Client implements
headersMaskto parse only HTTP response headers that will be used - New BLE Client
- HTTP Client implements
- Examples
- New examples for ECMA-419 BLE Client and Web Bluetooth
- Tools
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.8.0
Moddable SDK 5.8.0 contains improvements made between May 12, 2025 and June 11, 2025.
Realtime AI
This release sees our Realtime AI support continuing to expand with Deepgram joining our ChatAudioIO architecture. Deepgram's Voice Agent API provides realtime conversational AI support with a focus on enterprise applications.
Deepgram is noteworthy for being the only Realtime AI API using WebSockets to support binary transfer of audio data. This uses 25% less network bandwidth than the Base64 encoding used by everyone else; and requires less memory and CPU power to serialize and parse. Put another way, Deepgram is the lightest realtime AI service, which makes it a great choice for microcontroller projects.
Deepgram joins OpenAI, Google Gemini, ElevenLabs, and Hume AI in our ChatAudioIO. Imagine a single API that lets you easily build interactive voice chatbots with any of five leading AI services and do that efficiently on a low-cost microcontroller. And we're not done yet. Moddable has exciting updates planned. Stay tuned.
ESP-IDF I²C downgrade
Last month, the Moddable SDK's I²C support for ESP32 migrated to Espressif's new i2c_master API. Unfortunately, we have too many reports of issues from this change, including random read and write failures, and crashes when I²C and the JTAG USB connection are used simultaneously. Consequently, we've reverted the changes in this release. We will monitor the Espressif releases for improvements and try to report the issues encountered to Espressif.
Release Details
- Modules
- ChatAudioIO - add support for Deepgram AI service
- WebStorage – return
nullfor missing elements to match HTML5
- ECMA-419
- Analog input on ESP32 again works for multiple inputs (reported by @mshioji)
httpclientpasses response's status text toonHeadersfetchandEventSourceuse status text provided byhttpclientEventSourcehandlesidproperty and missing options to constructor- Revert I²C API migration on ESP32 from previous release
- Devices
- XS
RegExp.escape()now supported. This is part of ES2025.- Immutable
ArrayBufferconformance improvements with latest test262 - Import more math functions from fdlibm (for hosts that cannot use the platform mathlib)
String.prototype.fromCharCodeconformance fix on integer input- Fix obscure marshalling native stack overflow (found by Fuzzilli)
- Fix
awaitlookahead token for arrow function with expression body (found by oss-fuzz) - Check meter on several more
Arrayfunctions to trigger timeouts (found by oss-fuzz)
- Examples
- mini-drag example reports incompatibility with ECMA-419 touch driver
- Tools
- New M5Atom S3 simulator for mcsim (contributed by @stc1988)
mcconfigpath corrected on builds of ESP32 on Linux whenUSE_USBis1(device using TinyUSB for xsbug connection)
- TypeScript
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.7.0
Moddable SDK 5.7.0 contains improvements made between April 4, 2025 and May 12, 2025.
Realtime AI
Moddable continues to grow and enhance our AI support through our RealTime AI initiative. This month brings new integration of a new service, significant new features in our ConversationalAI application, and a simple new example to get you started adding AI agents to your embedded projects.
Eleven Labs integration
We updated our ChatAudioIO architecture with support for the latest ElevenLabs API, coincidentally named Conversational AI. The Moddable SDK has long supported streaming text-to-speech with ElevenLabs, and we find it has some of the most natural-sounding AI-generated speech out there. With our latest update, you can easily hear it for yourself and effortlessly compare it with the voice from other services. This support comes on the heels of our addition of HumeAI last month.
Choose AI service and voice in ConversationalAI application
Our amazing ConversationalAI application has been enhanced to allow the user to customize each AI agent by selecting an AI service to use (Hume, Google Gemini, OpenAI, or ElevenLabs) and the voice to use. This makes it incredibly easy to choose the service that works best for the agent and pair it with just the right voice. Your choices are saved in preferences, making them persistent across restarts.
To change the voice and service, tap the gear icon on any agent. The list of voices varies by service. For services that provide details about each voice, such as ElevenLabs, the UI shows them as tags, making it easy to find the kind of voice you are looking for.
New example
Our conversationalAI example app wraps a beautiful, interactive user experience around our ChatAudioIO library. All that UI code makes it difficult to appreciate just how simple it is to add an interactive AI-powered voice chat to your project. To help with that, we have a new example that is about as small as possible. Here's the entire app – notice that most of it is event logging:
const chat = new ChatAudioIO({
specifier: "humeAIEVI",
voiceName: "Sunny",
instructions: "You're a hostile fisherman with a salty sense of humor. You dislike people and care even less for fish.",
onStateChanged(state) {
trace(`State: ${ChatAudioIO.states[state]} ${this.error ?? ""}\n`);
},
onInputTranscript(text) {
trace(`User: ${text}\n`);
},
onOutputTranscript(text) {
trace(`Agent: ${text}\n`);
},
});
chat.connect();And it works with Hume, Google Gemini, OpenAI, and ElevenLabs.
ESP-IDF I²C upgrade
Espressif has been in the process of migrating to a new I²C API called i2c_master. The previous and new APIs cannot coexist in the same runtime, and the ESP Camera support uses the newer API. Consequently, we have migrated all I²C support to the new i2c_master API, including ECMA-419 I²C and the original pins I²C. The new API has some advantages, particularly when working with multiple devices simultaneously. However, it is not 100% functionally compatible. Of note, its support for stop bit handling and the read and write quick commands is limited. It appears this may be addressed in ESP-IDF v5.5.
We do not expect major issues in the transition; however some incompatibilities are possible given how widely used I²C is and how many variations there are. If you run into issues, please report them.
Node-RED MCU Edition
This release fixes a long-standing bug in the make system that prevented the Node-RED MCU Edition plugin from working with devices connected by native USB to macOS and Linux. This prevented many ESP32-S3 devices from working. This has been resolved.
In addition, fixes to the nRF52 build on Windows will soon allow nRF52-=powered devices to work with Node-RED MCU Edition on Windows as well!
TypeScript upgrade
We've updated our TypeScript support to default to ECMAScript 2024. That allows you to use more recent JavaScript language features, such as resizable ArrayBuffer, in your TypeScript projects. This should not have any compatibility issues, unless you had manually added type defintions for these functions to your project.
ESP-IDF v5.4
Moddable SDK 5.5 migrated ESP32 support to ESP-IDF v5.4 last month. If you develop for the ESP32 family, you'll need to update your ESP-IDF. Instructions are in last month's release notes.
Release Details
- Contributed
- conversationalAI
- Select AI service in UI
- Select agent voice in UI
- conversationalAI
- Modules
- ChatAudioIO
- Add support for ElevenLabs service
Humesupports selecting voice by name- Rename
humeAPIKeytohumeAIKeyfor consistency #1481 (reported by @stc1988) - Fix
sendText sendFunctionResultnow requires function name argument too- New
CONNECTEDstate to know when service is fully ready to use - Gemini Live now supports live output transcription (but not yet input – waiting on Google)
- Add array of state names at
ChatAudioIO.statesfor debugging / logging
- Timer
- Remove obsolete
modTimerGetID Timer.clear()never throws, consistent with web platform'sclearTimeout(useful for emulating web APIs)
- Remove obsolete
- Commodetto Outline
- Handle stroke line weight as number or integer
- Handle SVG
zcommand transform()method
- Piu Outline – avoid unnecessary recalculation of outline bounds
- Web Storage - new module provides WebStorage
localStorageusing ECMA-419 3rd Edition'sembedded_storage/key-value
- ChatAudioIO
- ECMA-419
- UDP
- HTTP Client now properly handles new request issued from
onDone()callback fetch()module supportsPATCHmethod and works withEventSourceEventSourcemodule supports body length of 0- HTTP Server now handles HTTP 101 response correctly by assuming respond body length of 0. This fixes WebSocket server support. (reported by @cmidgley) #1491
- Audio In and Out allow repeated
start()andstop()
- Devices
- ESP32
- Add support for M5Atom Lite Echo Base, M5Atom S3 Echo Base (contributed by @kitazaki)
- Add support for M5AtomS3R (contributed by @stc1988)
- I²C now uses newer
i2c_master_*APIs - Camera
- Image controls framework (brightness, contrast, etc) for ESP32 and macOS (experimental for 4th Edition)
- No longer deactivates I²C (not needed with
i2c_master_*APIs)
ILI9341_P8driver providesframeRategetter- More fixes for lack of GCC atomics on RISC-V targets
fxAbortlogs error message on unhandled exception
- nRF52
- ESP32
- XS JavaScript Engine
- New
xsmcSetStringX()andxsSetStringX()to eliminate string copies - Fix
RegExpwith empty disfunction #1484 (reported by @gibson042) - Use
C_*macros consistently - Include
fx_iterator_fromin snapshot table of native functions - Fix crash in
mutabilites()with huge multibyte function names - JSX support now handles
-in attribute name
- New
- TypeScript
- Bumped to
ES2024(latest available) to get new features like resizableArrayBuffer - Typings for
ChatAudioIO - Rename
embedded:audiotypings to be consistent with standard
- Bumped to
- Examples
- New simple
ChatAudioIOapp – great starting point for your projects - ECMA-419
httpserverexample needs to useserver.portforEventSourceconnection
- New simple
- Tools
cmakefiles for ESP32 build updated to quiet warnings about minimum version- More parallelism in ESP32 build on macOS & Linux
- Set
XSBUG_HOSTandXSBUG_PORTon macOS & Linux when launchingserial2xsbugon USB-native devices (e.g. ESP32-S3). Fixes Node-RED MCU Edition plugin integration for these devices. (reported by @mshioji) - Fix crash in
clearTimerinxst(reported by @ChALkeR) #1490 - Add TypeScript's
dstdirectory to.gitignorelist (contributed by @stc1988) - Workaround
idf.py add_dependencynow failing if dependency already exists - Add
XSBUG_LOG_PORTto allow custom port onxsbug-log(contributed by @cmidgley) #1376
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.6.0
Moddable SDK 5.6.0 contains improvements made between March 4, 2025 and April 3, 2025.
Realtime AI
Now with Hume
Hume AI's Empathic Voice Interface (EVI) is the latest addition to Moddable's new architecture for real-time AI launched last month. Hume's EVI joins Google Gemini and OpenAI in providing real-time voice interactions on resource-constrained embedded devices.
Hume's EVI is a bit different. It tries to understand how you are feeling and respond accordingly. It is also much less inhibited than other AI chat services, which makes it more fun to talk with. Give it a try!
Our realtime AI architecture provides a simple API for interactive voice services through a web worker. The API is the same for each AI service – even though Google Gemini, Hume, and OpenAI have dramatically different cloud APIs – so you can easily switch between services in your project.
If you are using Moddable Six, get our new Moddable Microphone for just $4.99 and you are ready to use our realtime AI architecture and Conversational AI app.
Faster than ever
The Conversational AI app inspired us to take a fresh look at optimizations to achieve even faster response times and smoother animations. This release includes many optimizations to our XS JavaScript engine, TLS stack, and network protocol implementations. These benefit all Moddable SDK projects that use these features, not just Conversational AI.
- Less floating point. We've enhanced several key JavaScript operations to use integer math instead of double precision floating point math without breaking conformance with the language. Because floating point math is much more expensive than integer math on embedded devices, this speeds up common operations such as validating arguments to TypedArray build-ins.
- TLS. We've optimized the native GCM multiply and moved two crypto utilities from JavaScript to C. The result is lower overhead TLS connections, which is key for our Conversational AI app, which continuously sends or receives audio over TLS.
- Reduced copies. We've reduced data copying in the network stack to lower peak memory use and eliminate copying overhead.
Optimization tools for you
We always start our optimizations using our Performance Profiler built into our xsbug JavaScript debugger. Read about it in Deliver High-Performance Products with the XS Profiler and see a step-by-step example of boosting performance.
This release adds two new low-level tools that can be helpful for specific optimization.
- The floating point log feature in XS show you the location of every floating point operation triggered by your script. This lets you quickly review them to see if they can be eliminated.
- The new Poco display list log shows the display list contents for each frame rendered, and shows the overdraw count - the average number of times each pixel was drawn. Some overdrawing is normal, but too much will hurt performance.
These aren't tools you are likely to use every day, but they are invaluable in improving performance. We used both to improve this release!
ESP-IDF v5.4
Moddable SDK 5.5 migrated ESP32 support to ESP-IDF v5.4 last month. If you develop for the ESP32 family, you'll need to update your ESP-IDF. Instructions are in last month's release notes.
Note: We have confirmed that OneWire works correctly with Moddable SDK 5.6.0 using ESP-IDF v5.4.
Coming Attractions
- More enhancements to Conversational AI
- A new host dedicated to small embedded Linux devices. Check out the PR from @linfan68.
Release Details
- Contributed - Conversational AI app
- Integrate support for Hume's Empathic Voice Interface (EVI).
- Add detailed readme about configuring, using the app, navigating the code, device compatibility, and using the simulator.
- Improve rendering frame rates with drawing optimizations to minimize overdrawing
- More conventional naming for AI service key environment variables (contributed by @stc1988) and comments to clarify
SPEAKINGandLISTENING - Use
Math.idiv()in scroller to reduce floating point math overhead
- Modules
- chatAudioIO
- Eliminate excess turns on Gemini worker
- Reduce peak memory use and data copying when transmitting audio to service
- Allow skipping initial data in Base64 value using return value of
isBase64to support clean audio playback for Hume, which prepends a WAVE file header to each audio buffer - Rename states for improved clarity (motivated by question from @stc1988)
- Poco renderer
- Optional display list logging
- For log on overflows, set
POCO_LOGOVERFLOWin"defines"section ofmanifest.json - To log all drawing, set
POCO_LOGin"defines"section ofmanifest.json
- For log on overflows, set
- Small rendering optimizations
- Adjust display list length on 64-bit platforms to eliminate either overflowing on simulator or over-allocating on device
- Optional display list logging
- Piu user interface framework
- Render monochrome bitmaps with mask
- TLS – optimizations to reduce overhead
- Native implementations of
Bin.compandBin.xorfunctions - Optimized native implementation of
ghash_mul
- Native implementations of
- Web Workers
- Option to specify stack size of each worker with
nativeStackproperty of creation (motivated by question from @danfinlay)
- Option to specify stack size of each worker with
- OpenAIStreamer supports optional "instructions" argument (contributed by @stc1988)
- chatAudioIO
- ECMA-419
- Audio Out – ESP32
- Close audio native driver in non-PDM case
- WebSocket client
- Update #writable when sending deferred control packet to eliminate occasional failure caused by writing more than network buffer could hold
- Use
Math.irandom()to eliminate unnecessary floating point operations
- G911 touch driver optimized to do fewer allocations when processing touch input to reduce load on garbage collector
- Image In camera now uses normative module specifier from 3rd Edition #1479 (reported by @stc1988)
- Serial – macOS
- Fix another case of callbacks triggering after close
- Write supports all Byte Buffers, not just
ArrayBuffer - Closing from within
onReadablecallback cancels pending callbacks
- Audio Out – ESP32
- Devices
- Moddable Microphone now works with Moddable Two
- macOS
- Simulator no longer warns to enable "secure coding" on launch
- Instrumentation in worker updates once a second
- ESP32
- RISC-V ESP32 targets now consistently handle misaligned memory access
- All variations of the ESP32 silicon family now use the same
main.c, to simplify maintenance - Device manifest includes preferences module manifest rather than duplicating its contents
- XS JavaScript engine
TypedArray.prototype.setoptimization when source and destination are the same kind of Typed Array- Optimize validation of arguments to built-in functions to eliminate unnecessary floating point conversions and operations
- Option to log stack trace of each floating point operation (see
mxFloatingPointOpinxsAll.h) - Instrumented builds log exception information to console (motivated by question from @linfan68)
- Divide "stack overflow" abort code into
xsNativeStackOverflowExitandxsJavaScriptStackOverflowExitto easily distinguish JavaScript and native stack overflows. This may require updating custom hosts. (motivated by question from @danfinlay) - Add function to convert abort code to string to ease adding abort codes in the future
- Fix demarshall of a detached
ArrayBuffer, last known marshalling issue found by fuzzer
- Documentation
- Add accessible description to Piu inheritance diagram to help AI crawlers (contributed by @danfinlay)
- Tools
- Option to specify size of native stack on main task in creation section of
manifest.json - Correct example in Git section to
"include"instead of"includes" - Update
.gitignoreto ignorenode_modulesandpackage-lock.jsonin all directories, not only xsbug-log
- Option to specify size of native stack on main task in creation section of
- TypeScript
- Add typings for
embedded:io/audio/inandembedded:io/audio/out(contributed by @stc1988)
- Add typings for
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.5.0
Moddable SDK 5.5.0 contains improvements made between January 20, 2025 and March 4, 2025.
Realtime AI
You may have noticed that everyone seems to be either talking about or talking with AI. Moddable is joining the party.
The rapid rise of realtime AI service APIs has created the need for fundamental realtime AI communication services on embedded devices. The goal is to deliver an amazingly interactive experience for users and a streamlined experience for developers. Moddable delivers on both with a new lightweight, low-latency, and high-performance architecture built on industry-standard APIs. Getting this right is tough. It requires balancing network communication, parsing complex service messages efficiently, capturing and playing audio seamlessly, and meeting the demands of a highly interactive user interface. Moddable has implemented that using industry best practices to free developers to focus on what makes their project unique.
A New Architecture
Moddable SDK 5.5.0 introduces our Realtime AI architecture. It works with multiple realtime AI services, and we're launching with support for two of the biggest, OpenAI and Google Gemini. The architecture supports both services with the same JavaScript API. The implementation uses Web Workers to cleanly separate the AI services from the application and keep the UI responsive.
A New Application
To show what our new architecture is capable of, we've created Conversational AI, an application with eighteen voice assistants. The UI is slick and smooth, especially on our own Moddable Six with its high-speed display bus. Conversational AI runs on macOS, Linux, and Windows too, using our simulator, so you can start exploring even before your Moddable Six arrives!
Amazing Results
We're achieving realtime voice chats with latencies that are indistinguishable from desktop, even when combined with a mobile-style user interface. All of that is implemented in modern, standard JavaScript using standard embedded JavaScript APIs from ECMA-419 3rd Edition, running on extraordinarily low-cost hardware.
More to Come
And this is just the first step. We have big plans to enhance the architecture with new features and new services. You can expect cool new applications to show those off.
Microphone for Moddable Hardware
The best way to experience our beautiful new Conversational AI application is on Moddable Six, where the software is fine tuned to get the best performance from every hardware component. You'll need to add a microphone. To make that easy, Moddable just launched a plug-in microphone for just $4.99. This high quality PDM microphone from TDK plugs into Moddable Six and Moddable Display 6. It also works with Moddable Two.
ESP-IDF v5.4
We've migrated to ESP-IDF v5.4.0 from v5.3.1. The update should be transparent to all JavaScript code (and the vast majority of C code). The update is recommended for reliability and security, and to stay current with the latest from Espressif. Updating takes just a couple minutes.
- 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, or Windows.
NOTE: OneWire support is broken in ESP-IDF v5.4.0, though it worked in ESP-IDF v5.3.*. Moddable has reported this issue to Espressif.
Release Details
- Examples
- Added Conversational AI
- XS JavaScript engine
- Marshall and demarshall (IPC mechanism used by workers)
- Enhanced to keep garbage collector enabled when demarshalling. This significantly reduces IPC overhead by eliminating an explicit collection before demarshalling each message received
- Hardened to safely report errors for unsupported data
- Detects stack overflows
- Supports sparse arrays
- Long-standing warning in
BigIntGCC optimization resolved - Eliminate unnecessary misaligned opcode retrieval from runloop on ESP32
decodeURIanddecodeURIComponentdetect invalid UTF-8 codepoints #1464 (reported by @ayuan0828)
- Marshall and demarshall (IPC mechanism used by workers)
- Devices
- ESP32
- Divide
esp32/m5atom_s3rintoesp32/m5atom_s3r_camandesp32/m5atom_s3r_m12. (Contributed by @stc1988) #1456 - ESP32-C3 has only one I²C port (reported by @mshioji)
- Task queue default timeout reduced to 20 ms (from 1000) to detect message queue blocking sooner (can override in manifest with
MODDEF_TASK_QUEUEWAIT) - Fully initialize
ledc_channel_config_tstructure (ESP-IDF v5.4.0 compatibility) CONFIG_FREERTOS_HZno longer required to be 1000 (but 1000 is still recommended). Useful for compatibility with ESP-IDF default of 100 Hz ticks.- Web Workers using FreeRTOS task once again behave correctly on all ESP32 family devices
- Web Workers given lower priority than main task, consistent with other platforms
- Eliminate memory allocation for small IPC message payloads
- Divide
- ESP32
- Modules
- Piu Port fixed so computed styles are not garbage collected while still in use
- ECMA-419
- Digital Bank class on ESP32 supports native
onReadablecallback - TLS socket
- Reduce memory overhead in packet buffers
- Reduce allocations in GCM module
- Validate
formatwhen setting
- ESP32 Camera Image In reliably matches requested image dimensions to available frame sizes
- TCP socket on macOS no longer invokes pending callbacks after
close() - HTTP server
- Properly handles all cases of unknown server response length phoddie/node-red-mcu#129
read()works when passed no arguments
- Audio In on ESP32
readon ESP32 returnsundefined(instead of0) when nothing available- Option to set PDM slot mask in manifest
"defines"
- Audio Out on ESP32 no longer blocks on write (buffer size calculation improvements)
- Web Socket Client after connecting frees properties no longer needed to reduce memory
- File storage modules (POSIX and littlefs) default export reworked to conform with ECMA-419 3rd Edition
- ESP32 IO modules only preload themselves (previously some preloaded
embedded:*) - Update module specifiers of new storage modules to match 419 3rd Edition
TCP,UDP, andListenersockets on ESP32 check if network interface is available before invoking lwip (lwip callsabort()when no active network interface)Serialon ESP32 removes interrupt handler on close #1462 (reported by @mauroForlimpopoli)
- Digital Bank class on ESP32 supports native
- Tools
- JSON modules supported in manifest
preloadsection xstsupports fuzzing of marshall and demarshallxsl- Reports details of non-frozen array elements correctly
- Correct Atomics table when
mxFloat16is defined
compileDataViewupdated to latest with support forfloat16(and much more)mcconfigandmcruncan transform JSON files (resolves conflict between Node-RED MCU Edition and ES2025 JSON module support)
- JSON modules supported in manifest
- Testing
- Add 419 Audio In unit tests
- Add add
Map,Set, andBigInttests to worker IPC test - File storage tests updated to latest ECMA-419 3rd Edition specification
- Consistently apply naming convention for test fixtures
- TypeScript
- Correct type declaration of
Bytesin Bluetooth Utilities modules (contributed by @stc1988)
- Correct type declaration of
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on X / Twitter at @moddabletech
Moddable SDK 5.4.1
Open Source drop, January 30, 2025