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

Creating a digital output hangs on the Raspberry Pi 4 #79

Closed
nebrius opened this issue Jul 23, 2019 · 4 comments
Closed

Creating a digital output hangs on the Raspberry Pi 4 #79

nebrius opened this issue Jul 23, 2019 · 4 comments
Labels

Comments

@nebrius
Copy link

nebrius commented Jul 23, 2019

So here's a strange one for you @fivdi. Creating a digital output on the Raspberry Pi 4 hangs.

Environment:

  • Raspberry Pi 4 Model B 2GB (hardware revision b03111)
  • Node.js 10.16.0 (installed from NodeSource's PPA)
  • OS 2019-06-20-raspbian-buster-lite
  • pigpio v1.2.3

Code:

const { Gpio } = require('pigpio');

new Gpio(17, {
  mode: Gpio.OUTPUT,
  pullUpDown: Gpio.PUD_OFF
});
console.log('done');

When I run this code, "done" is never printed, and a breakpoint set on that line is never triggered. In addition, when I ctrl+c out of the program, I get sigHandler: Unhandled signal 2, terminating, which implies something is blocking the event loop to me.

Here's the funny bit: when I run this on a Raspberry Pi 3 Model B+ (hardware revision ) with the exact same code, Node.js version, pigpio version, and OS+updates, it works fine.

Note: I did install Raspi IO first, which means the device was configured for Raspi IO (I2C was enabled and certain parameters were set, etc.).

@fivdi
Copy link
Owner

fivdi commented Jul 25, 2019

Hey @nebrius, I hope all is well with you.

The 2019-06-20-raspbian-buster and 2019-07-10-raspbian-buster images come with V68 of the pigpio C library preinstalled which doesn't support the Raspberry Pi 4. The pigpio Node.js module depends on the pigpio C library. Run the command pigpiod -v to see which version of pigpio C library is installed.

V70 of the pigpio C library provides experimental support for the Raspberry Pi 4. The instructions for installing V70 of the pigpio C library can be found at http://abyz.me.uk/rpi/pigpio/download.html.

Please install V70 of the pigpio C library and give it a try. It should be a lot better than V68.

After installing V70 of the pigpio C library a reboot may be required to get the command pigpiod -v to function correctly.

The corresponding pigpio C library issue is joan2937/pigpio#278

when I ctrl+c out of the program, I get sigHandler: Unhandled signal 2, terminating, which implies something is blocking the event loop to me.

This message comes from the pigpio C library either here or here.

Here's the funny bit: when I run this on a Raspberry Pi 3 Model B+ (hardware revision ) with the exact same code, Node.js version, pigpio version, and OS+updates, it works fine.

Compared to previous versions of the Pi, the hardware peripherals on the Pi 4 have changed quite a bit. The pigpio C library therefore needs to be modified accordingly.

Note: I did install Raspi IO first, which means the device was configured for Raspi IO (I2C was enabled and certain parameters were set, etc.).

This shouldn't be an issue.

@cinderblock
Copy link
Contributor

cinderblock commented Aug 7, 2019

I just ran into this issue as well.

Interestingly, this also launched a daemon on port 8888 when running on Pi4. I was very confused until I found this issue.

Will try to update to V70 and give that a shot. V70 seems to be working so far.

@nebrius
Copy link
Author

nebrius commented Aug 7, 2019

Thanks for all the info @fivdi, this is helpful.

Compared to previous versions of the Pi, the hardware peripherals on the Pi 4 have changed quite a bit. The pigpio C library therefore needs to be modified accordingly.

Interesting, I'll have to dig in when I have some free time (in September 😅)

@fivdi fivdi added the question label Aug 8, 2019
@fivdi
Copy link
Owner

fivdi commented Sep 7, 2019

Like the pigpio C library the pigpio Node.js module now has experimental support for the Raspberry Pi 4. Please note that hardware PWM is a little different on the Raspberry Pi 4. For further details see the New & Updates section of the README. The integration tests for the Node.js pigpio module all run successfully on a Raspberry Pi 4.

@fivdi fivdi closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants