16 16
Per-Mattias Nordkvist

NanoPI NEO / AIR

Recommended Posts

How do i enable i2c on the nano pi , running the 4.7 kernel

 

As far as i remember, i just had to install the i2c-tools (and made i2c available for python as well).

Unfortunately, not all my i2c devices were recognized properly. So i use Friendlyarm's Ubuntu, where i2c works fine. (I used the same breadboard for both Armbian and Ubuntu, so it was not a hardware issue.)

apt-get install i2c-tools -y
apt-get install python-smbus -y

Share this post


Link to post
Share on other sites

installed those  already but the scan picks up nothing , i remeber on the pi's you had to enable the kernal module for it to work , but if the friendlyarms ubuntu does have it enabled maybe i can pickup from that one which kernel module i need to enable

Share this post


Link to post
Share on other sites

installed those  already but the scan picks up nothing , i remeber on the pi's you had to enable the kernal module for it to work , but if the friendlyarms ubuntu does have it enabled maybe i can pickup from that one which kernel module i need to enable

 

Well, comparing apples and oranges is maybe not the best way to do this. You grabbed unsupported OS images with kernel 4.7 instead of those where I2C should work out of the box (legacy kernel). So everything as expected. Mainline kernel for H3 boards is still WiP so unless you really know what you're doing (being a kernel hacker for example) many things might fail (actually you would need so called device tree overlays to get I2C/SPI working with 4.x kernel since this stuff hasn't landed in upstream kernel yet). Asking google for

device tree overlay i2c site:armbian.com

might give you an idea. Choosing the supported OS image is the better way of course.

Share this post


Link to post
Share on other sites

installed those  already but the scan picks up nothing , i remeber on the pi's you had to enable the kernal module for it to work , but if the friendlyarms ubuntu does have it enabled maybe i can pickup from that one which kernel module i need to enable

 

Ah, sorry, my fault - all i said above is for a 3.4.something kernel (armbian's and friendlyarm's default images).

Share this post


Link to post
Share on other sites

Ah, sorry, my fault - all i said above is for a 3.4.something kernel (armbian's and friendlyarm's default images).

 

Armbian's sun8i kernel is based on FriendlyARM's code drop but we patched it up to most recent version so now it's 3.4.39 vs. 3.4.113. Not all of the stuff FA did is contained in our kernel sources but we added a rather huge patch to support all of FA's matrix peripherals some months ago: https://github.com/igorpecovnik/lib/blob/master/patch/kernel/sun8i-default/matrix-support-Matrix-starter-kit.patch

 

Should not be related to I2C but it might be possible that this additional hardware support isn't part of default NEO legacy OS images (needs an apt-get upgrade followed by a reboot then).

Share this post


Link to post
Share on other sites

Hi, sorry than I came in this topic with another board (orange pi one)

I try "Armbian_5.24.161226_Nanopineo_Ubuntu_xenial_4.9.0.img" and my OPI one boot success, ethernet works well, etc..

but I have problem with uart â„–3 (/dev/ttyS3)

cat /dev/ttyS3

cat: /dev/ttyS3: Input/output error

I done https://forum.armbian.com/index.php/topic/1524-orange-pi-one-how-to-enable-uart/

but without success(

Share this post


Link to post
Share on other sites

Did you look into the DTS if all UART are enabled, because some are not by default, and still assigned as plain GPIO.

For that, you will need to decompile DTB into DTS, edit by changing their status "disabled" by "okay", and then recompile DTB.

Share this post


Link to post
Share on other sites

For that, you will need to decompile DTB into DTS, edit by changing their status "disabled" by "okay", and then recompile DTB.

For UART ports you need to add pinctrl nodes too.

 

i can look into DTS via minicom?

dev kernel (4.9.x) is intended for advanced users and developers, using legacy 3.4.x is recommended if you don't want to figure out DT patches, overlays and kernel recompilation procedures.

Share this post


Link to post
Share on other sites

Then, to get your feet wet, google a bit about Device Tree, even for other kind of platforms, there is a lot of tutorial.

But, in the mean time, to get you started :

 

First, do a backup of your current DTB : cp /boot/dtb/board.dtb /boot/dtb/board.dtb-BACKUP

Decompile DTB into DTS :

dtc -I dtb -O dts -o board.dts /boot/dtb/board.dtb

Edit the board.dts to suit your need.

Recompile DTB from modified DTS :

dtc -I dts -O dtb -o /boot/dtb/board.dtb board.dts 

Reboot your board.

Share this post


Link to post
Share on other sites

thank you very! One qustion... there are many files .dtb in /boot/~dtb directoty

How I can know, which file use my linux?

must be some config file for this, I guess....

Share this post


Link to post
Share on other sites

unfortunately uarts exept 0 fails(

 

root@nanopineo:~# dmesg | grep tty
[    0.000000] Kernel command line: root=UUID=2d2112dd-a756-4cd3-ace6-e0c52d9647dc rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 cgroup_enable=memory swapaccount=1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1 ubootpart=f773f33f-01   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16
[    0.001204] console [tty1] enabled
[    4.262838] console [ttyS0] disabled
[    4.283070] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 40, base_baud = 1500000) is a U6_16550A
[    4.283139] console [ttyS0] enabled
 
I done with dtb file and with script.bin via fex.... but even in dmesg silence about uart3, uart1, etc....
but I`ll try again and far) thank you friends for your help!

Share this post


Link to post
Share on other sites

Firstly, I change @script.bin from /boot/bin/nanopineo.bin to /boot/bin/orangepione.bin

I rewrite sun8i-h3-orangepi-one.dtb to sun8i-h3-nanopi-neo.dtb

(my board is orange pi one)

Here it is.... and script.bin. In dts file I change "disabled" -> "okay"

files.rar

 

Share this post


Link to post
Share on other sites

Your DTS looks Ok.

Did you recompile it into DTB and reboot ?

Still no new tty ?

Strange ...

 

What those commands showing ?

cat /proc/device-tree/soc/serial@01c28400
cat /proc/device-tree/soc/serial@01c28800
cat /proc/device-tree/soc/serial@01c28c00

it should print "okay" for each one ...

Share this post


Link to post
Share on other sites

In case I want to run the Nano Pi Air with low power consumption by disable WiFi.

Is it possible? or another way to reduce power consumption?

I want to run the board as data logger with 20 spi sensors, sampling rate 1K and powered by battery.

Share this post


Link to post
Share on other sites

In case I want to run the Nano Pi Air with low power consumption by disable WiFi.

Is it possible? or another way to reduce power consumption?

 

Please use the google search function and check 'h3consumption' and reasonable combinations of 'nano pi air consumption'. To disable Wi-Fi set 

echo "000" > /proc/driver/wifi-pm/power

from /etc/rc.local. Maybe better to use

(sleep 60 && modprobe -r dhd && echo "000" > /proc/driver/wifi-pm/power) &

And then you would check the fex file and disable there Bluetooth too by setting the appropriate value from 1 to 0.

Share this post


Link to post
Share on other sites

Your DTS looks Ok.

Did you recompile it into DTB and reboot ?

Still no new tty ?

Strange ...

 

What those commands showing ?

cat /proc/device-tree/soc/serial@01c28400
cat /proc/device-tree/soc/serial@01c28800
cat /proc/device-tree/soc/serial@01c28c00

it should print "okay" for each one ...

 

Hi, sorry that too late, but I reinstall clean image, check anything, but have no success(

output is:

cat: /proc/device-tree/soc/serial@01c28400/: Is a directory

 

if I print "cat /proc/device-tree/soc/serial@01c28400/status", I get empty (no "okay") is printed(

 

but in

root@nanopineo:~# cat /dev/ttyS
ttyS0  ttyS1  ttyS2  ttyS3  ttyS4  ttyS5  ttyS6  ttyS7
I can see many uarts((((

Share this post


Link to post
Share on other sites

Yes, sorry for the typo ...

I means :

cat /proc/device-tree/soc/serial@01c28400/status
cat /proc/device-tree/soc/serial@01c28800/status
cat /proc/device-tree/soc/serial@01c28c00/status

it should not get empty, check carefully, because it doesn't do \r\n, so it is appearing just before shell prompt, it is "okay" or "disabled", no other values.

Share this post


Link to post
Share on other sites

Hi,

 

I'm trying to install Armbian on my NanoPiAir.

 

At first I booted in FEL mode and burned an image with Etcher to MMC. I tried Armbian_5.20_Nanopiair_Debian_jessie_3.4.112.img, Armbian_5.20_Nanopiair_Ubuntu_xenial_3.4.112.img and Armbian_5.24.161226_Nanopiair_Ubuntu_xenial_4.9.0.img. Then I removed the USB cable, removed the SD card and replugged the USB cable. With the 5.24 nightly build the blue LED startet flashing after some seconds. But there was no /dev/ttyACM0 device or usb device (I checked lsusb and dmesg) detected on my host computer (Linux Mint 17, 3.13.0-100).

So I installed an image on my sd card with dd but the same problem. Then I soldered the UART pins and connected via screen /dev/ttyUSB0 which works without any problems. I started nand-sata-install script that finished with success. After removing my sd card I tried to start from eMMC but I only get this message via UART:

U-Boot SPL 2016.09-armbian (Sep 15 2016 - 05:37:42)
DRAM: 512 MiB
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

I also tried to reflash the eMMC via FEL but etcher aborts everytime while flashing or after the verify process.

 

Does this mean my eMMC is broken? Is there a way to check this?

Share this post


Link to post
Share on other sites

With the 5.24 nightly build the blue LED startet flashing after some seconds. But there was no /dev/ttyACM0 device or usb device (I checked lsusb and dmesg) detected on my host computer (Linux Mint 17, 3.13.0-100).

Images with the dev kernel (4.9.x) don't provide a serial console on the USB OTG port, but console on the UART pins should work fine (and flashing LED means the boot process reached at least the firstrun script and in general should work fine)

 

So I installed an image on my sd card with dd but the same problem. Then I soldered the UART pins and connected via screen /dev/ttyUSB0 which works without any problems. I started nand-sata-install script that finished with success. After removing my sd card I tried to start from eMMC but I only get this message via UART:

U-Boot SPL 2016.09-armbian (Sep 15 2016 - 05:37:42)
DRAM: 512 MiB
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

U-boot 2016.09 means this was one of the 5.20 images and there these u-boot issues are possible

 

 

I also tried to reflash the eMMC via FEL but etcher aborts everytime while flashing or after the verify process.

 

Does this mean my eMMC is broken? Is there a way to check this?

FEL based eMMC flashing process may have issues, especially if the board is not powered properly.

Share this post


Link to post
Share on other sites

Yes, sorry for the typo ...

I means :

cat /proc/device-tree/soc/serial@01c28400/status
cat /proc/device-tree/soc/serial@01c28800/status
cat /proc/device-tree/soc/serial@01c28c00/status

it should not get empty, check carefully, because it doesn't do \r\n, so it is appearing just before shell prompt, it is "okay" or "disabled", no other values.

 

I`m sorry( I check more carefully, it is "disabled"(((

disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28400/status
disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28800/status
disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28c00/status

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
16 16