danrubel / rpi_gpio.dart

Dart library for accessing the Raspberry Pi GPIO pins
Other
47 stars 5 forks source link

Add support for WiringNP #16

Open guyluz11 opened 5 years ago

guyluz11 commented 5 years ago

The code worked on Raspberry Pi 3. But on NanoPi NEO2 running the command : dart example/example.dart And getting the Error:

Unhandled exception:
RpiGpio initialization failed: -1
#0      new RpiGpio (package:rpi_gpio/rpi_gpio.dart:26:7)
#1      main (file:///home/pi/newSnap/rpi_gpio.dart/example/example.dart:12:20)
<asynchronous suspension>
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:19)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)

As you can see from this post

the CPU in the Raspberry Pi 3 is 64-bit, but the Raspbian OS has not yet been updated for a 64-bit device.

The NanoPi NEO2 have the same processor as Raspberry Pi 3 (ARM Cortex-A53). NanoPi NEO2 CPU: Allwinner H5, Quad-core 64-bit high-performance Cortex A53

Same error happening on NanoPi NEO Command: dart example/example.dart Error:

Unhandled exception:
RpiGpio initialization failed: -1
#0      new RpiGpio (package:rpi_gpio/rpi_gpio.dart:26:7)
#1      main (file:///home/pi/git/rpi_gpio.dart/example/example.dart:12:20)
<asynchronous suspension>
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:19)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)

NanoPi NEO CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz

guyluz11 commented 5 years ago

Tried running the code on Raspberry Pi 3 with ubuntu MATE OS both aarch32 ARMv7 and aarch64 ARMv8 OS install and it worked. So the architecture of the OS is not the problem.

guyluz11 commented 5 years ago

Found out that WiringNP and WiringPi are not the same. On the WiringNP git hub page

This is a GPIO access library for NanoPI. It is based on the WiringOP for Orange PI which is based on original WiringPi for Raspberry Pi.

WiringNP is based on WiringPi, so in theory it will be much easier to add support for it. Can you add support or point me in the direction to build it myself with WiringNP instead ?

danrubel commented 4 years ago

Thank you for all the useful information. This is not something I have investigated yet. I have not had time to focus on this package recently, but hope to do so sometime in the fall.