2 2
Techlxrd

Default W1 pin on Nano PI NEO

Recommended Posts

I enabled modules, and connected DS18B20 but still haven't 28-XXX... folder in /sys/bus/w1/devices. 

In README.sun8i-h3-overlays written that default port is PD14 but i can't find it on my board pinout.

 

Share this post


Link to post
Share on other sites

cat /sys/kernel/debug/gpio

 

gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
 gpio-10  (                    |nanopi:blue:status  ) out lo
 gpio-110 (                    |w1                  ) in  lo
 gpio-166 (                    |cd                  ) in  lo


gpiochip1: GPIOs 352-383, parent: platform/1f02c00.pinctrl, 1f02c00.pinctrl:
 gpio-362 (                    |nanopi:green:pwr    ) out hi

So now w1 uses gpio-110 but i still can't find it on pinout

Share this post


Link to post
Share on other sites

PD14 equals GPIO110 ...

But, effectively, according to schematic of NanoPi-NEO, since header has only 24 pins, the PD14 is not there unlike many other boards.

You can use PG11 (GPIO203) or PA6 (GPIO6) instead, but you need to decompile overlay, edit to change the pin, and recompile it.

Share this post


Link to post
Share on other sites
11 hours ago, martinayotte said:

PD14 equals GPIO110 ...

But, effectively, according to schematic of NanoPi-NEO, since header has only 24 pins, the PD14 is not there unlike many other boards.

You can use PG11 (GPIO203) or PA6 (GPIO6) instead, but you need to decompile overlay, edit to change the pin, and recompile it.

Thank you, solved.

Share this post


Link to post
Share on other sites

Is there a difference to the NanoPi NEO Air?

 

I tried to setup W1 with my NanoPi NEO Air (Rev 1.0) but i failed. I changed pins to "PG11" in /boot/dtb/overlay/sun8i-h3-w1-gpio.dtbo (and in sun7i*w1 and sun4i*w1 as well), but W1 remains on gpio-110:

 cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
 gpio-10  (                    |nanopi:blue:status  ) out hi    
 gpio-110 (                    |w1                  ) in  lo    

To be sure, i double checked the new dtbo files by decompiling them again.
Kernel: Linux nano01 4.14.65-sunxi #1 SMP Mon Aug 20 08:45:20 CEST 2018 armv7l GNU/Linux

 

Do you have some hints for me?

 

Best regards, Thomas

Share this post


Link to post
Share on other sites

I think that's not the case:

 

dtc -I dtb -O dts sun8i-h3-w1-gpio.dtbo.orig > orig.dts
dtc -I dtb -O dts sun8i-h3-w1-gpio.dtbo.new > new.dts

diff orig.dts new.dts 
12c12
< 				pins = "PD14";
---
> 				pins = "PG11";

 

The real file name in /boot/dtb/overlay/ is sun8i-h3-w1-gpio.dtbo. :-)

Share this post


Link to post
Share on other sites
3 hours ago, Thomas Pfeiffer said:

The real file name in /boot/dtb/overlay/ is sun8i-h3-w1-gpio.dtbo. :-)

What is the output resulting from this command ?

cat /proc/device-tree/soc/pinctrl@1c20800/w1_pins/allwinner\,pins

What did you put in /boot/armbianEnv.txt to load the overlay ?

Share this post


Link to post
Share on other sites

Thanks very much for helping, martinayotte!
 

cat /proc/device-tree/soc/pinctrl@01c20800/w1_pins/pins

PG11
So this seems to be correct.


cat /boot/armbianEnv.txt

[...]

overlay_prefix=sun8i-h3

overlays=i2c0 i2c1 i2c2 usbhost1 usbhost2 w1-gpio

[...]

I added w1-gpio by using armbian-config.

 

I tried armbian-add-overlay as well (mentioned in https://docs.armbian.com/User-Guide_Allwinner_overlays/ ):

armbian-add-overlay w1-gpio.dts 

Error: dtc does not support compiling overlays

Please try to install matching kernel headers

 

Thanks in advance!

Thomas

 

 

Share this post


Link to post
Share on other sites

You guys are awesome. I love you but I also hate you. :P That  is  a joke btw.

Remember, threads/emails are not ideal communication. When you finalize a thread, maybe wrap it all up in a single coherent, command by command tutorial?

Just spent the last hour trying to hodge podge the meaning of this thread + this

All you need to know is that param_w1_pin=PG11 shoulda been on a seperate line while a simple dump of the full amrbianEnv.txt woulda sufficed...

verbosity=1
logo=disabled
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=armbian-add-overlay usbhost1 usbhost2 w1-gpio
param_w1_pin=PG11
rootdev=UUID=41c3101b-b077-456b-b9cd-a7717422b4b3
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
 

Not to mention how to actually de/recompile dbto's and dts's. I would love to post back here those simple commands that were just glossed over in this thread but I can't guarantee I'll be able to do that. Anyone with a life outside themselves would understand how valuable 1 hour of uninterrupted time to decompiling text based gibberish is, all the while knowing it could legit, be automated.

 

If there's any doubt to the tone of this message. I prove my point and thank you guys.

Share this post


Link to post
Share on other sites

Which is easier to say? Every post previous, or run this?

Attached is a bash script that will install and make various dtbo/dts edits automagically in order to install and interface with ds18b20 Thermometer connected to a NPiNeo running Armbian 5.69.

I've also attached an image for how the module needs to be physically connected (using 10k resistor between 1 wire and PWR). If you do not have a physical 10k resistor you may use the internal pullup to do so (do not use on long connections?) This is done by adding param_w1_pin_int_pullup 1 on a newline after param_w1_pin=PG11 in the /boot/armbianEnv.txt file.

 

The picture is for a raspi connection. Simply connect blue wire to PG11 on NanoPi Neo, Red to 3.3v PWR. Black wire to GND. All of which are actually located on the exact same pins if you flip the picture 90 degrees clockwise and cross reference it to FriendlyArms standard schematic. Also attached.

 

WARNING: I created the attached script from a default installation of Armbian. It will erase current /boot/armbianEnv.txt file.  Use sed or edit printf command to customize.

 

- physical bash script attached

- gist copy of script here: https://gist.github.com/BiTinerary/0ab5f3c7bf118456fc02bb0b876dc172

 

 

 

mNNsUzt.jpg

ds18b20ThermoNPiNeoInstall.sh

NEO_pinout-02.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2