Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.5inch Display Not Working #16

Closed
eyal352 opened this issue Dec 20, 2020 · 4 comments · Fixed by #18
Closed

7.5inch Display Not Working #16

eyal352 opened this issue Dec 20, 2020 · 4 comments · Fixed by #18
Labels
bug Something isn't working

Comments

@eyal352
Copy link

eyal352 commented Dec 20, 2020

Hello! Awesome project. I'm trying to get it working on the 7.5inch V2 by running the examples, but am unable to due to an undefined function.
Steps to reproduce:
In 4gray.js, change device:
const { init, devices } = require('epaperjs'); init(devices.waveshare7in5v2Horizontal);

Run npm run start

And the following logs are returned:

/***********************************/ Current environment: Raspbian set wiringPi lib success !!! /***********************************/ (node:4581) UnhandledPromiseRejectionWarning: ReferenceError: convertPNG is not defined at Object.displayPNG (/home/pi/Downloads/node_modules/epaperjs/devices.js:62:24) at Page.display (/home/pi/Downloads/node_modules/epaperjs/page.js:24:27) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async WebSocket.<anonymous> (/home/pi/Downloads/epaper.js-1.3.1/examples/ereader/ereader.js:8:13) (Use node --trace-warnings ...to show where the warning was created) (node:4581) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:4581) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:4581) UnhandledPromiseRejectionWarning: ReferenceError: convertPNG is not defined at Object.displayPNG (/home/pi/Downloads/node_modules/epaperjs/devices.js:62:24) at Page.display (/home/pi/Downloads/node_modules/epaperjs/page.js:24:27) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async WebSocket.<anonymous> (/home/pi/Downloads/epaper.js-1.3.1/examples/ereader/ereader.js:8:13) (node:4581) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

According to the logs, the convertPNG() method that's specific to the const waveshare7in5v2Horizontal in devices.js is never defined in image.js (or any other files or dependencies) and needs to be defined.

@samsonmking
Copy link
Owner

@eyal352 good catch! 7.5" support was originally added by another contribution and I don't have a 7.5" display to test with, myself. Could you try running the attached pull request and see if it fixes the issue for you?

Just a couple suggestions to keep in mind:

  • Please try both the vertical and horizontal configurations
  • The 7.5" display only supports black and white, not 4 color grayscale. The 4gray example may still work in some capacity, but I think you might have better results with one of the other examples.

Thanks!

@samsonmking samsonmking added the bug Something isn't working label Dec 26, 2020
@eyal352
Copy link
Author

eyal352 commented Dec 28, 2020

@samsonmking awesome! I'll test it out and report back. I wanted to add that in the meantime, I had the const waveshare7in5v2Horizontal from devices.js call the convertPNGto1BitBW method and so far it's been working pretty well as a workaround.

@samsonmking
Copy link
Owner

@eyal352 since your temporary fix was the same as mine, I went ahead and merged the PR. I wanted to get the fix merged, in case this bug was effecting others, too.

Please let me know if you have any more trouble. Thanks!

@eyal352
Copy link
Author

eyal352 commented Jan 4, 2021

@samsonmking Apologies for the delay. Sounds good. I've tested the horizontal display so far and it's working well. If I have any trouble with the vertical layout I'll post an update.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants