0

Using VScode I have taken the led-blink sample code from https://github.com/dotnet/iot and placed it into an IotEdge module template with the intention of having it run in a container on IoT edge and then use device twin properties to modify some of the variables on the fly through IoT Hub. After loading the module it starts ups but the logs show the following error

Unhandled exception. System.IO.IOException: Error 2 initializing the Gpio driver.
   at System.Device.Gpio.Drivers.RaspberryPi3LinuxDriver.Initialize()
   at System.Device.Gpio.Drivers.RaspberryPi3LinuxDriver.OpenPin(Int32 pinNumber)
   at System.Device.Gpio.Drivers.RaspberryPi3Driver.OpenPin(Int32 pinNumber)
   at System.Device.Gpio.GpioController.OpenPin(Int32 pinNumber)
   at edgetestmodule20sep.Program.Main(String[] args) in /app/Program.cs:line 29

Can anyone advise what is going on here and what a possible solution might be?

rareg3636
  • 29
  • 4
  • 1
    See this answer. https://stackoverflow.com/questions/30059784/docker-access-to-raspberry-pi-gpio-pins One of the later ones specifically deals with IoT Edge on Pi. Essentially your container does not have the privileges. – Mark Radbourne Sep 21 '20 at 23:52
  • thanks @MarkRadbourne, I came across the same last night and (after figuring out how to actually implement it) it has solved the problem – rareg3636 Sep 22 '20 at 12:03
  • @rareg3636 glad you are unblocked :). Please mark below as answer to help others as well. Thanks! – asergaz Oct 06 '20 at 10:58

0 Answers0