Skip to content

tobias-theobald/epd-node-trmnl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js program to render your trmnl screen to your waveshare 7.5" V2 e-ink display on a raspberry pi (zero w 2 in my case)

This will likely work on other devices compatible with the waveshare E-paper display, see the waveshare sample code for more details

Prerequisites:

Node.js

I'm using nvm to install node 22, haven't tested with other versions from other sources, but it should work with any reasonably recent version of node (20?)

Ensure OS presents /dev/spidev0.0 and does not use GPIO 8 for SPI CS0

Had to put this in my /boot/firmware/config.txt to get the spi to work on my freshly set up pi zero w 2

dtparam=spi=on
dtoverlay=spi0-1cs,cs0_pin=28

Additional packages

You may have to sudo apt install liblgpio-dev to get the gpio library to compile

Environment variables

Copy .env.example to .env and fill in the values from the TRMNL device page

Installing dependencies

Then run npm install to install the dependencies (this might take some time on a pi zero w)

Running

npm start to start the program. Look out for any problems in the console output.

Autostart

To autostart,

  • modify epd-node.service to suit your needs (paths, username, group, PATH env var, etc)
  • copy it to /etc/systemd/system/epd-node.service
  • run sudo systemctl reload-daemon
  • run sudo systemctl start epd-node.service
  • run sudo systemctl status epd-node.service and see if there are any issues

Troubleshooting

  • If you get an error related to the SPI device not being found, make sure the SPI device is enabled in the OS and that the device is connected properly
  • GPIO is busy or similar: make sure the GPIO pins are not being used by another program or service. gpioinfo gpiochip0 is your friend, the pins are in src/services/device.ts . If Pin 8 is used as SPI CS0, you may have to change the pin in the config.txt file as mentioned above

License note

A lot of the code in this package and especially in device.ts is simply a node rewrite of the control code from the waveshare sample code at https://github.com/waveshareteam/e-Paper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published