Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nanopi Neo Air and WiringNP

Featured Replies

All, I downloaded and built WiringNP according to the FriendlyARM instructions. Running 'gpio read all' gives me an error saying

piBoardRev: Unable to determine board revision from /proc/cpuinfo

 

for the rest the Neo Air Armbian runs fine.

any ideas what's wrong?

  • Author

I believe it has to do with the Armbian Kernel where there may be no model name specified? Like H3 or something? The file /proc/cpuinfo, which is a virtual file and I believe its contents are determined by what is in the kernel, doesn't give any model name and gpio is looking for a model name.

So gpio readall fails:

 

$ gpio -v readall

 

gives:


gpio version: 2.20
Copyright (c) 2012-2014 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Your NanoPi has an unknown model type. Please report this to
    support@friendlyarm.com
with a copy of your /proc/cpuinfo if possible

 

  • Author

Where should I start in the code? Any suggestions on which file to look in?

 

I started in wiringPi.c and I see that I probably have to tweak the function getBoardType().

But where can I find that function?

your help is appreciated.

It is opening /proc/cpuinfo there : https://github.com/WiringPi/WiringPi/blob/master/wiringPi/wiringPi.c#L698

Then it is checking if it is an Raspberry there : https://github.com/WiringPi/WiringPi/blob/master/wiringPi/wiringPi.c#L723

You need to tweak that port, either by skipping it or provide check for H3 SoC.

 

Anyway, maybe someone already done that by forking this original WiringPi to make it compatible with NanoPiNeoAir ...

 

I had the same issue with wiringNP on nanoPi NEO. The issue was resolved by adding a line to the file "boardtype_friendlyelec.c" in the array "BoardHardwareInfo gAllBoardHardwareInfo[]"

 

The line added is:

{"sun8i", 0, NanoPi_NEO, "NanoPi-NEO-Armbian", "-1(-1)"},

 

The critical parameter is the -1(-1), which is the board type reported by the kernel for this board.

 

I have not carried our thorough testing, but the gpio readall reports properly and I am able to toggle outputs and read inputs correctly using the gpio command.

There is 2 Repository.

 

https://github.com/friendlyarm/WiringNP

https://github.com/wertyzp/WiringNP

 

friendlyarm's WiringNP have a mapping bug.

gpio of pin#35 and #36 won't work.

 

static int pinToGpio_m1 [64] ={
    0, 6, // 0, 1
    2, 3, // 2, 3
    200, 201, // 4  5
    1, 203, // 6, 7
    12, 11, // 8, 9
    67, 17, //10,11
    64, 65, //12,13
    66, 198, //14,15
    199, -1, //16,17
    -1, -1, //18,19
    -1, 20, //20,21
    21, 8, //22,23
//    13, 9, //24,25 /nopnop2002
    16, 9, //24,25
//    7, 16, //26,27 /nopnop2002
    7, 13, //26,27
    15, 14, //28,29
    19, 18, //30,31

 

  • Author
On 27-10-2017 at 10:28 AM, JohnF said:

I had the same issue with wiringNP on nanoPi NEO. The issue was resolved by adding a line to the file "boardtype_friendlyelec.c" in the array "BoardHardwareInfo gAllBoardHardwareInfo[]"

 

The line added is:

{"sun8i", 0, NanoPi_NEO, "NanoPi-NEO-Armbian", "-1(-1)"},

 

The critical parameter is the -1(-1), which is the board type reported by the kernel for this board.

 

I have not carried our thorough testing, but the gpio readall reports properly and I am able to toggle outputs and read inputs correctly using the gpio command.

I will try this on the Neo Air 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.