epaper.js icon indicating copy to clipboard operation
epaper.js copied to clipboard

Add support for 13.3 inch Waveshare e-ink display

Open johanoskarsson opened this issue 3 years ago • 2 comments

I recently purchased one of the 13.3" Waveshare displays and I'd love to help add support for it to this package. However I'm not much of a C programmer nor particularly familiar with Node so some hand holding might be required.

I've brought over the code from their drivers here: https://github.com/waveshare/IT8951-ePaper into this PR. I tried my best to adapt the node c file to it.

This does seem to compile but most likely does not work yet. I'm embarrassingly stuck on the node part when trying to test it. How can I run the epaper.js cli from the source directory without installing the package globally? Or even how do I install the package globally from the local directory? It doesn't seem to like that the packages reference the core package using the workspace keyword.

npm -v
8.3.1
$ ~/epaper.js $ npm i packages/cli/ packages/rpi-13in3/
...
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^

Resources: https://www.waveshare.com/13.3inch-e-paper-hat.htm https://www.waveshare.com/wiki/13.3inch_e-Paper_HAT

johanoskarsson avatar Feb 15 '22 17:02 johanoskarsson

Hi @johanoskarsson thanks for your interest in the project! Apologies for the lack of documentation for developers... I recently switched to a monorepo setup, but haven't gotten a change to write up a contributing.md, yet.

The monorepo links the different packages together using pnpm. When developing locally, you should use pnpm instead of npm. To get started...

  1. Install pnpm
  2. Clean out any npm temporary files with something like git clean -xfd
  3. Run pnpm install from the root of the project. This will install all dependencies and symlink all the packages together
  4. Add a link to your new package in the root tsconfig.json
  5. Running pnpm build:clean will compile the typescript for all the packages. You can do an incremental build (only build what changed) by running pnpm build
  6. You can build the c / c++ code for your package by running pnpm build:clean from the root of the packages/rpi13in3 directory. You can build all the typescript code and all the c/c++ code by running pnpm -r build:clean from the root of the project.

Hopefully that's enough to get you started. It looks like this display differs a little from the others we support. When I get some more time over the next few days, I can take a more in depth look at what's required. It should be totally doable, though!

samsonmking avatar Feb 16 '22 03:02 samsonmking

@johanoskarsson @samsonmking For what its worth, id love to see this merged in. +1

VictorioBerra avatar Aug 12 '22 16:08 VictorioBerra