SpotPear ESP32C3-1.44

From revRE Wiki


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;

  1. Scratch original, which doesnt support python but could be used via board extension
  2. Proprietary versions (based on OpenBlocks) but they have since stopped releasing sources
  3. OpenBlock, based on Scratch, with C/Python generators, and support for blocks
  4. xcratch/osep; perpendicular extensions so ignored

Scratch Versions:

  1. Scratch, and ScratchX (experimental one, dead as it used flash) ; https://scratch.mit.edu/discuss/topic/674605/?page=2#post-7865678
  2. OSEP Scratch
  3. xcratch based on scratch, adds url based extensions
  4. OpenBlocks based on scratch, adds code generators, and link
  5. KittenBlock based on OpenBlocks; has wiring, and uart
  6. 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:

  1. git clone
  2. npm install
  3. npm install git@github.com:openblockcc/openblock-vm.git
  4. npm install "git+https://github.com/openblockcc/openblock-blocks.git#0.1.0-prerelease.20250611095335"
    1. fix the python code build.py, and ...deps.py using 2to3 -w ...
    2. fix some utf8 code conversion issues in python


How to build for debug and devel:

  1. git clone git@github.com:Spotpear-Scratch/openblock-gui.git
  2. cd openblock-gui
  3. NODE_OPTIONS=--openssl-legacy-provider npm install
  4. 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:

  1. Scratch Link : https://github.com/scratchfoundation/scratch-link/blob/develop/Documentation/NetworkProtocol.md
  2. Web Serial : https://whatwebcando.today/serial.html


Links:

  1. https://homeding.github.io/boards/esp32c3/spotpear-144lcd.htm
  2. https://spotpear.com/index.php/ESP32-C3-desktop-trinket-Mini-TV-Portable-Pendant-LVGL-1.44inch-LCD-ST7735/forum-answer/190.html
  3. https://github.com/Vinzenz82/esp32-c3-tft-cube
  4. https://www.elektroda.com/news/news4091334.html