Open
Description
The problem is that if a GPIO reference gets lost in some process's state, it's no longer possible to open that GPIO. This happens when using GPIOs at the IEx prompt, since return values are saved in the session history. It can also happen in code that returns GPIO references rather than wrapping them in GenServers so there's only one owning process.
Currently it's hard to debug lost GPIO references other than to reboot. It would be a lot nicer to be able to invalidate old references and try again.
If you run this, try the following for now:
- For non-performance critical code, use
Circuits.GPIO.write_one/3
andCircuits.GPIO.read_one/2
instead. This totally avoids references. - Create a
GenServer
that holds the GPIO reference in its state.
Metadata
Metadata
Assignees
Labels
No labels