Open JetzeMellema opened 4 years ago
An updated version of the module is in the repo (it uses .NET APIs instead of WiringPi), but not yet on PS Gallery.
For now, just clone the repo onto Pi4 and it should work:
git clone https://github.com/PowerShell/PowerShell-IoT.git
and then in PS import module with
Import-Module ./src/Microsoft.PowerShell.IoT/Microsoft.PowerShell.IoT.psd1
Hello, At the link above only Raspberry Pi 2 and 3 are mentioned as supported. I've try to Import the updated version of module, it is on different directory, than your example and failed with the following error:
PS /home/pi/powershell/IoT> Import-Module ./PowerShell-IoT/src/Microsoft.PowerShell.IoT/Microsoft.PowerShell.IoT.psd1
Import-Module: The module to process 'Microsoft.PowerShell.IoT.dll', listed in field 'NestedModules' of module manifest '/home/pi/powershell/IoT/PowerShell-IoT/src/Microsoft.PowerShell.IoT/Microsoft.PowerShell.IoT.psd1' was not processed because no valid module was found in any module directory.
Next, I've build the module libraries with build.ps1 and get version 0.2.0 running, but it seems again, not supported on BCM2711 / Raspberry PI 4
PS /home/pi/powershell/IoT/PowerShell-IoT/out/Microsoft.PowerShell.IoT> Get-GpioPin -Id 16
Get-GpioPin: Operation is not supported on this platform.
The module installs fine on Raspberry Pi 4, but it's not actually possible to interact with GPIO. Error message after running Get-GpioPin:
This is caused by an older version of WiringPi that doesn't recognize the updated hardware in the Raspberry Pi 4. The author published a newer version (2.52) that adds support for the Pi 4: http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
I installed this version on my Pi and can confirm with gpio -v:
This does not resolve the issue, the cmdlets still fail. It would be great if this module could support the latest WiringPi version.