Techlxrd Posted August 9, 2018 Posted August 9, 2018 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.
Techlxrd Posted August 9, 2018 Author Posted August 9, 2018 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
martinayotte Posted August 9, 2018 Posted August 9, 2018 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.
Techlxrd Posted August 10, 2018 Author Posted August 10, 2018 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.
Thomas Pfeiffer Posted October 26, 2018 Posted October 26, 2018 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
martinayotte Posted October 26, 2018 Posted October 26, 2018 3 hours ago, Thomas Pfeiffer said: Do you have some hints for me? You must have done typos during decompile/recompile DTBO ...
Thomas Pfeiffer Posted October 26, 2018 Posted October 26, 2018 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. :-)
martinayotte Posted October 26, 2018 Posted October 26, 2018 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 ? 1
Thomas Pfeiffer Posted October 26, 2018 Posted October 26, 2018 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
Thomas Pfeiffer Posted October 26, 2018 Posted October 26, 2018 Update - solved! :-) I added param_w1_pin=PG11 to /boot/armbianEnv.txt - now it works.
StuxNet Posted January 18, 2019 Posted January 18, 2019 You guys are awesome. I love you but I also hate you. 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 I needed 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.
StuxNet Posted January 19, 2019 Posted January 19, 2019 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 ds18b20ThermoNPiNeoInstall.sh
Recommended Posts