question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Random error while waiting for pin interrupts

See original GitHub issue

Describe the bug

Steps to reproduce

Expected behavior

Don’t crash or provide a way to handle issue.

Actual behavior

Unhandled exception. System.IO.IOException: Error while waiting for pin interrupts.
   at System.Device.Gpio.Drivers.SysFsDriver.WasEventDetected(Int32 pollFileDescriptor, Int32 valueFileDescriptor, Int32& pinNumber, CancellationToken cancellationToken)
   at System.Device.Gpio.Drivers.SysFsDriver.DetectEvents()
   at System.Threading.Thread.StartCallback()

Versions used

pi@raspberrypi:~/dotnet $ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.101
 Commit:    ef49f6213a

Runtime Environment:
 OS Name:     raspbian
 OS Version:  11
 OS Platform: Linux
 RID:         linux-arm
 Base Path:   /home/pi/.dotnet/sdk/6.0.101/

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  6.0.101 [/home/pi/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [/home/pi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [/home/pi/.dotnet/shared/Microsoft.NETCore.App]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pgrawehrcommented, Jan 27, 2022

@pelikhan We’ve been having a few problems using SysFs in the past. I don’t remember exactly what we did there about that. I think catching the exception and retrying was normally working. However, since SysFs is deprecated and slow, we switched to using libgpiod as default low-level library when it’s available.

So just run sudo apt install -y libgpiod-dev and the library should pick it up automatically. I’ve never seen the above error with libgpiod and it is orders of magnitude faster (compare #1470).

1reaction
pgrawehrcommented, Jan 9, 2022

Try installing libgpiod-dev. That should work around the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do not use interrupts in your programming (?)
I've read a few Forums about complications using Interrupts and most ... the interrupt pin alone still be enough for it to trigger...
Read more >
Arduino Project Interrupt Error?
You are disabling interrupts for way too long. Interrupts are meant for handling time-critical tasks that cannot wait for a full loop ...
Read more >
problem with timer interrupt - MSP low-power microcontrollers
I am configured timer A for interrupt for generating a square wave but ... + GIE); // Enter LPM0 w/interrupt so CPU sleep...
Read more >
SPI Interrupt Bit-Offset / Too Early - Raspberry Pi Forums
I´m running an SPI Slave on my Pico and executing an interrupt when 16 bits of Data are received. I visualized the interrupt...
Read more >
Arduino Interrupt won't ignore falling edge
You're attaching the handler to a pin change interrupt. That means, if the pin is not changed interrupt will not be called again....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found