Skip to content

ngxson/pluspoint-reader

Repository files navigation

PlusPoint

This is a fork of crosspoint-reader that I created out of curiousity. The main motivation is to add some coplex features that will have slim chance of being upstreamed.

For the name of this project, "Plus" has a double meaning: It means both "being more" and "my passion for C++"

Philosophical design behind this fork:

  • We only target low-level changes, things that does not directly alter the UI/UX
  • We try to introduce these feature as a wrapper, avoid too many modifications on the original code
  • For any changes fall outside of these category, please send your PR to upstream project

Things that this fork is set out to support:

  • Emulation (for a better DX)
  • Allow user-defined app, packaged as Javascript file under /apps directory
    • Cover more APIs
    • Allow app to be compressed into a more space-efficient format (inspired by BSON <--> JSON)
    • Add networking APIs
  • Real-time clock (with calibration to minimize drifting)

How to install

Adapted from official guide, under Web (specific firmware version) section:

  1. Connect the device to computer using USB cable
  2. Download firmware.bin from Releases page of PlusPoint
  3. Go to https://xteink.dve.al/ and flash the firmware file using the "OTA fast flash controls" section --> Flash firmware from file

Custom JS apps

PlusPoint is shipped with an experimental implementation of user-defined JS apps, powered by mquickjs.

For more details, please refer to apps documentation

Image

Emulated

This fork provides a semi-emulated solution that allows running CrossPoint / PlusPoint on a cheap barebone ESP32C3. This allow faster development without the risk of (soft) bricking the real device.

Why don't we use QEMU? Please refer to this discussion

More details Image

The SD card is replaced by a "proxy FS", which maps the SD card to {project_directory}/.sdcard. It make things much, much easier to debug.

Because we are using the same chip as the real device, most hardware functionalities should stays the same, including wifi and bluetooth.

Some small caveats:

  • OMIT_FONTS must be enabled, in order to fit the program inside 4MB flash
  • You have to press RST to wake up from sleep, this is not exactly the same as power button, but works for now

How to use it:

  1. Make sure you're having a ESP32C3 with 4MB of memory. Just a standalone board is enough, no need to connect any GPIO pins
  2. Connect ESP32C3 to computer via USB
  3. Compile this project with the env:emulated config and flash it to the board
  4. Run python ./ngxson/server.py
  5. Open http://localhost:8090/ on your browser
  6. Enjoy

Note: You don't need to stop the program each time you upload a new firmware, the script automatically disconnects from the console to avoid interrupting the uploading process. After it's finished, you can simply press the RST button on the board and wait ~5 seconds.

Known issue(s):

  • For now, the FATAL: Timeout waiting for response can sometimes pop up. If it stucks in bootloop, exit the python script, press RST on the board, then re-connect it.
  • Sometimes, too frequent FS_READ and FS_WRITE can also trigger the issue above. If it when into bootloop, try deleting content inside {project_directory}/.sdcard/.crosspoint

About

Yet another alternative firmware for Xteink X4

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors