node.jselectronraspberry-pi3

How to use GPIO of raspberry pi in electron App?


I am trying to build an app for raspberry pi 3 (b) using electronJs. I am not able to use "onoff" module of nodejs to communicate with GPIO of raspberry pi. When I import it in main process and try to run the app using electron . command, the command exits with no error info. Can anyone please suggest how to use GPIO of raspberry pi3 in electron App.

Also if its not possible with electronJs then please suggest how can I implement a GUI app for raspberry pi which can use GPIO.

Sample repo of same https://github.com/AkshayKanchan/electron_gpio


Solution

  • Updating nodeJS to latest build and running electron-rebuild solved my problem. Thank you Dave Newton for your help. Seems like there was an issue with epoll compilation which is used by onoff package.