SpotPear ESP32C3-1.44
General information
General Stuff for our spot pear page
The SpotPear ESP32C3 1.44inch MiniTV keychain device is available directly from SpotPear or from many vendors at AliExpress.
The device is programmable via some of the usual integrated development kits, such as Arduino and ESP IDK but for children this would be a big hit if we had scratch.
Our public wiki is here https://github.com/Spotpear-Scratch/spotpear-scratch.github.io/wiki and the editor ui is here https://spotpear-scratch.github.io/
Scratch Support
Scratch isnt natively supported by this device, in fact very little repository code is specifically available for the device although its commonly just an ESP32C3 with display, ...
First investigating Scratch, there are really 3 options;
- Scratch original, which doesnt support python but could be used via board extension
- Proprietary versions (based on OpenBlocks) but they have since stopped releasing sources
- OpenBlock, based on Scratch, with C/Python generators, and support for blocks
- xcratch/osep; perpendicular extensions so ignored
Scratch Versions:
- Scratch, and ScratchX (experimental one, dead as it used flash) ; https://scratch.mit.edu/discuss/topic/674605/?page=2#post-7865678
- OSEP Scratch
- xcratch based on scratch, adds url based extensions
- OpenBlocks based on scratch, adds code generators, and link
- KittenBlock based on OpenBlocks; has wiring, and uart
- PictoBlocks based on OpenBlocks; has uart direct use
Extending Open Blocks
How to add to OpenBlocks:
- Web Api UART
- openblock-vm/src/io/serialport.js; change from using Scratch-link's "SERIALPORT" to WSERIALPORT
- openblock-vm/src/util/scratch-link-websocket.js; added support for WSERIALPORT by implementing Web API Serial and decoding the JSON messages meant for the scratch-link bridge.
- Adding a new board
- openblock-gui/src/lib/libraries/devices/index.jsx ; adding new section for board along with const defines for logos/images
- openblock-gui/src/lib/device.js ; add check for device type and return 'python'
- openblock-gui/src/lib/code-generator.js ; add deviceType and return 'Python'
- openblock-vm/src/extension-support/extension-manager.js ; add your device
- openblock-vm/src/devices/yourboard/yourboard.js ; add your new board's blocks
- openblock-blocks/generators/python/spotpear.js ; add your custom code generation for your blocks defined above
- openblock-il10n/??? ; add your language translation
SpotPear Scratch Repos:
Creating a Repo:
- git clone
- npm install
- npm install git@github.com:openblockcc/openblock-vm.git
- npm install "git+https://github.com/openblockcc/openblock-blocks.git#0.1.0-prerelease.20250611095335"
- fix the python code build.py, and ...deps.py using 2to3 -w ...
- fix some utf8 code conversion issues in python
How to build for debug and devel:
- git clone git@github.com:Spotpear-Scratch/openblock-gui.git
- cd openblock-gui
- NODE_OPTIONS=--openssl-legacy-provider npm install
- NODE_OPTIONS=--openssl-legacy-provider npm start
UART Support in Operating Systems with WebSerial
Windows PC : OK for most modern browser
MacOS : Not sure, should be ok
iPAD : Dont know
Android: Mixed bag, chrome gave up on polyfill so its 50/50 if it works
https://github.com/google/web-serial-polyfill/issues/54
Documentation
Docs:
- Scratch Link : https://github.com/scratchfoundation/scratch-link/blob/develop/Documentation/NetworkProtocol.md
- Web Serial : https://whatwebcando.today/serial.html
Links:
