Moddable SDK 5.2.0
Moddable SDK 5.2 contains improvements made between October 12, 2024 and November 12, 2024.
Highlights of this release include:
- Camera – all-new camera module with support for ESP32 and the simulator (macOS, Windows, and Linux)
- Support for devices with cameras from M5 Stack, Lilygo, and Seeed Studio
- New storage and flash modules - preview of features from forthcoming ECMA-419 3rd Edition. The storage module will replace the current Preferences module which is widely used in projects.
The JavaScript eco-system is abuzz with discussion about the "Language Evolution" proposal to increase the security and stability of JavaScript by dividing it into two parts. Moddable believes this is be good for the language and especially good for embedded JavaScript developers. Read our latest blog post for all the details.
We are very excited to bring camera support to the Moddable SDK. It is a natural fit with our focus on bringing a modern user experience to low-cost embedded products. As you would expect our camera integration is extremely lightweight, simple to use, and powerful. The camera input isn't limited to a rectangle on the screen. You can fully integrate the camera image into dynamic, animated user interfaces as our new "camera balls" example demonstrates. Read all about the new suite of camera examples and browse the source code here. The "camera balls" example works on macOS, Windows, and Linux with most cameras so you can try it out even before you have an ESP32 device with a camera.
The Moddable SDK now supports directly including ESP-IDF native components from the ESP Component Registry. This is how our new ESP32 camera support has been integrated. Check out our blog post Using the ESP Component Registry with the Moddable SDK to learn more.
Note: ESP-IDF v5.3.1 has been released. Our testing shows that it is compatible with Moddable SDK v5.2. The Moddable SDK will move to ESP-IDF v5.3.1 in the December 2024 release.
Release Details
- ECMA-419
- Camera module available for ESP32, macOS, Windows, and Linux.
- Implementation of the new
ImageIn
class, derived from the IO class patter - Returns uncompressed RGB565LE, uncompressed YUV422, and compressed JPEG images
- Supports new
buffer/disposable
format
to give JavaScript code direct access to camera driver's internal buffers, reducing memory use and improving performance by eliminating data copies - ESP32 implementation based on the ESP32 Camera Driver module from ESP Component Registry
- Suite of new camera examples available
- Implementation of the new
- Flash module available for ESP32 and macOS
- macOS simulator uses memory mapped file as backing store. Available partitions defined in configuration section of manifest
- Storage module available for ESP32 and macOS
- ESP32 implementation uses ESP-IDF
nvs
API for backing store - macOS implementation use
CFPreferences
API for backing store
- ESP32 implementation uses ESP-IDF
- Audio
- Add
audioType
to options object ofAudioIn
andAudioOut
constructor and as a read-only property of instances. Currently the only value defined is"LPCM"
for linear PCM audio. AudioIn
onReadable
callback receives second parameter indicating the number of readable samples (first argument remains number of readable bytes)AudioOut
onWritable
callback receives second parameter indicating the maximum number of writable samples (first argument remains the maximum number of writable bytes)
- Add
- HTTP server
- Server instance implements
port
property to allow use of ephemeral ports - If
content-length
not specified for response body and not chunked transfer encoding, the length is indeterminate. Previously incorrectly handled as length of 0 causing connection to drop prematurely. - Byte count passed to
onWritable
callback pins to bytes known to be remaining in response body
- Server instance implements
- Network sockets
- Analog input on ESP32 supports MCU-specific options to set attenuation and disable calibration. Details in new readme. Reported by @takkaO) #1431
SMBus
writeBuffer()
method handles views correctly- Add support for
buffer/disposable
format - Add minimal implementation of
axp2101
driver using ECMA-419 I²C
- Camera module available for ESP32, macOS, Windows, and Linux.
- Devices
- M5 Stack CoreS3
- Add camera support
- Uses ECMA-419 drivers for touch, audio, power, and IMU. This eliminates conflicts with the I²C support in the new camera driver.
- Add new ESP32-S3 devices, all with camera support. For more information see our ESP32 document
- Lilygo T Camera Plus S3 - platform build target
esp32/lilygo_t_camera_plus_s3
- M5 Atom S3R M12 - platform build target
esp32/m5atom_s3r
- XIAO ESP32S3 Sense - platform build target
esp32/xiao_esp32s3_sense
- Lilygo T Camera Plus S3 - platform build target
- M5 Stack CoreS3
- Modules
- Commodetto
- Bitmap
- Implements set
buffer
- experimental and may be removed - Stores
buffer
reference in native code - Add
YUV422
pixel format (YUYV byte order)
- Implements set
- Pixel format
Converter
implements YUV422 to RGB565LE conversion
- Bitmap
- Commodetto
- XS
- TypedArrays implement PreventExtensions to fail on resizable buffer. This tracks a fix in ECMA-262.
- Fixed
Error.prototype.stack
memory corruption when function namedSymbol.asyncIterator
is on the stack and function names are stripped (default on embedded builds) (reported by @cmidgley) - Implement Module constructor from Hardened JavaScript draft specification
- Enabled in
xst
for testing, disabled by default otherwise. - DefinemxModuleStuff=1
to enable - Constructor is assigned to the global variable
ModuleStuff
reflecting its experimental status
- Enabled in
- Testing
- Add unit tests for ECMA-419 Flash.
- ECMA-419 Audio out unit tests updated to test new
type
property - ECMA-419 storage tests updated for iterator and missing keys
- Add remote disconnect test for ECMA-419
TCP
socket #1430
- TypeScript
- Documentation
- Improve syntax highlighting for code blocks and fix syntax errors in example code in documentation (contributed by @stc1988)
- Correct licenses link (contributed by @SamuelMarks) #1432
- Examples
- Add ECMA-419 camera examples
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter / X at @moddabletech