[opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
I measure temperature with DS1820 hooked up to microcontrollers (PIC) or via serial interface to regular PCs, now I was hoping to use a nanopi neo air, but I am not getting anywhere. I have the modules loaded - w1-therm, wire, w1-gpio - but no devices turn up in /sys/bus/w1/devices. I'm connecting the DS1820s to GPIO11 - I guess I need to modify the DTB to make this work? -- Per Jessen, Zürich (8.5°C) Member, openSUSE Heroes. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi,
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 24 November 2019 16:07 To: opensuse-arm@opensuse.org Subject: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
I measure temperature with DS1820 hooked up to microcontrollers (PIC) or via serial interface to regular PCs, now I was hoping to use a nanopi neo air, but I am not getting anywhere.
I have the modules loaded - w1-therm, wire, w1-gpio - but no devices turn up in /sys/bus/w1/devices. I'm connecting the DS1820s to GPIO11 - I guess I need to modify the DTB to make this work?
There are some information about 1-wire here: https://en.opensuse.org/openSUSE:1-wire If you want to use 1-wire on a regular gpio, with w1-gpio module, you need to update your device-tree to setup it properly. Then, you can check /sys/bus/w1/devices folder for any devices found on the 1-wire bus. If you do not update your DTB, w1-gpio will not know which gpio to use. Cheers, Guillaume
-- Per Jessen, Zürich (8.5°C) Member, openSUSE Heroes.
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. N�����r��y隊Z)z{.�櫛맲��r��z�^�ˬz��N�(�֜��^� ޭ隊Z)z{.�櫛�0�����Ǩ�
Guillaume Gardet wrote:
Hi,
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 24 November 2019 16:07 To: opensuse-arm@opensuse.org Subject: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
I measure temperature with DS1820 hooked up to microcontrollers (PIC) or via serial interface to regular PCs, now I was hoping to use a nanopi neo air, but I am not getting anywhere.
I have the modules loaded - w1-therm, wire, w1-gpio - but no devices turn up in /sys/bus/w1/devices. I'm connecting the DS1820s to GPIO11 - I guess I need to modify the DTB to make this work?
There are some information about 1-wire here: https://en.opensuse.org/openSUSE:1-wire
Thanks Guillaume, Yes, I've seen that one, but it's very limited :-)
If you want to use 1-wire on a regular gpio, with w1-gpio module, you need to update your device-tree to setup it properly. Then, you can check /sys/bus/w1/devices folder for any devices found on the 1-wire bus.
If you do not update your DTB, w1-gpio will not know which gpio to use.
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image. -- Per Jessen, Zürich (7.1°C) Member, openSUSE Heroes. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 25 November 2019 10:46 To: opensuse-arm@opensuse.org Subject: RE: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Guillaume Gardet wrote:
Hi,
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 24 November 2019 16:07 To: opensuse-arm@opensuse.org Subject: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
I measure temperature with DS1820 hooked up to microcontrollers (PIC) or via serial interface to regular PCs, now I was hoping to use a nanopi neo air, but I am not getting anywhere.
I have the modules loaded - w1-therm, wire, w1-gpio - but no devices turn up in /sys/bus/w1/devices. I'm connecting the DS1820s to GPIO11 - I guess I need to modify the DTB to make this work?
There are some information about 1-wire here: https://en.opensuse.org/openSUSE:1-wire
Thanks Guillaume,
Yes, I've seen that one, but it's very limited :-)
Yes, it is, but 1-wire as well. 😉 Feel free to improve it with your findings, if appropriate.
If you want to use 1-wire on a regular gpio, with w1-gpio module, you need to update your device-tree to setup it properly. Then, you can check /sys/bus/w1/devices folder for any devices found on the 1-wire bus.
If you do not update your DTB, w1-gpio will not know which gpio to use.
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image.
I fear that you need to update your DT. Not sure what is the current status of Device Tree Overlays, upstream. If device tree overlays are supported, you may just need to create a dt fragment, compile it and load it at runtime or on boot as a kernel option. Matthias, Yousaf, do you know about the status of the DT overlays? Guillaume
-- Per Jessen, Zürich (7.1°C) Member, openSUSE Heroes.
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Guillaume Gardet wrote:
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image.
I fear that you need to update your DT. Not sure what is the current status of Device Tree Overlays, upstream. [snip] If device tree overlays are supported, you may just need to create a dt fragment, compile it and load it at runtime or on boot as a kernel option.
Okay, I had almost concluded that myself, thanks for confirming it. Judging by the instructions for the Raspi, it seems overlays should be fine? I'm going to go and study how to write a dt fragment for the nanopi. -- Per Jessen, Zürich (7.1°C) Member, openSUSE Heroes. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 25 November 2019 11:43 To: Guillaume Gardet <Guillaume.Gardet@arm.com>; opensuse- arm@opensuse.org Subject: Re: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Guillaume Gardet wrote:
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image.
I fear that you need to update your DT. Not sure what is the current status of Device Tree Overlays, upstream. [snip] If device tree overlays are supported, you may just need to create a dt fragment, compile it and load it at runtime or on boot as a kernel option.
Okay, I had almost concluded that myself, thanks for confirming it. Judging by the instructions for the Raspi, it seems overlays should be fine?
On Raspberry Pi, the overlays are handled by firmware. So, this is different. RPi is different from other boards.
I'm going to go and study how to write a dt fragment for the nanopi.
My understanding is upstream kernel, as used in openSUSE, cannot apply DT overlays at runtime. You need to update your DTB, or create a fragment and merge it with your current DT. Then, use this new DTB to boot your board. Cheers, Guillaume
-- Per Jessen, Zürich (7.1°C) Member, openSUSE Heroes.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Guillaume Gardet wrote:
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 25 November 2019 11:43 To: Guillaume Gardet <Guillaume.Gardet@arm.com>; opensuse- arm@opensuse.org Subject: Re: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Guillaume Gardet wrote:
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image.
I fear that you need to update your DT. Not sure what is the current status of Device Tree Overlays, upstream. [snip] If device tree overlays are supported, you may just need to create a dt fragment, compile it and load it at runtime or on boot as a kernel option.
Okay, I had almost concluded that myself, thanks for confirming it. Judging by the instructions for the Raspi, it seems overlays should be fine?
On Raspberry Pi, the overlays are handled by firmware. So, this is different. RPi is different from other boards.
Yeah, that is certainly true, but I didn't know about that little twist.
I'm going to go and study how to write a dt fragment for the nanopi.
My understanding is upstream kernel, as used in openSUSE, cannot apply DT overlays at runtime.
Okay, good to know that I can ignore the overlay idea.
You need to update your DTB, or create a fragment and merge it with your current DT. Then, use this new DTB to boot your board.
Right. It's good to get my suspicions confirmed, makes it easier to move in the right direction. -- Per Jessen, Zürich (7.2°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Per Jessen wrote:
You need to update your DTB, or create a fragment and merge it with your current DT. Then, use this new DTB to boot your board.
Right. It's good to get my suspicions confirmed, makes it easier to move in the right direction.
Thanks to Guillaume for getting me on the track. To those who might be watching this thread - yes, it's working now! Status: I'm reading three DS18x20 sensors connected to GPIO11. I'm getting mostly good readings, but also quite a few bad ones (temp 85C). I'll update the wiki-page as well as write an entry on my own blog, but for those impatiently waiting - I based everything on the DTB from the FriendlyCore eflasher image. It has way more stuff than we have in the openSUSE JeOS ditto. I guess the source is also available somewhere, but I started out with decompiling to DTS. a) Look for the entry "pinctrl@01c20800" and add a label 'gpio0:' gpio0:pinctrl@01c20800 b) in this section, for instance above the 'csi' entry, add the following: ds1820_pins:w1_pins@0 { label = "Dallas 1-wire"; pins = "PG11"; function = "gpio_in"; pull = <0x1>; }; c) towards the end of the file, add this node: onewire { compatible = "w1-gpio"; pinctrl-names = "default"; pinctrl-0 = <&ds1820_pins>; gpios = <&gpio0 0x0 203 0x1>; status = "okay"; }; I added it after the "leds" node. compile a new dtb: dtc -b 0 -@ -I dts -O dtb your-new.dts >/boot/dtb/your-new.dtb adjust your boot-script and reboot. I am most certainly not very familiar with all of this, and it took a lot of trial & error. Corrections and suggestions are very much welcome. For module 'w1-therm', I ended up adding 'strong_pullup=2' which reduced the number of bad readings, a lot. -- Per Jessen, Zürich (0.4°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi !
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 03 December 2019 16:01 To: opensuse-arm@opensuse.org Subject: RE: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Per Jessen wrote:
You need to update your DTB, or create a fragment and merge it with your current DT. Then, use this new DTB to boot your board.
Right. It's good to get my suspicions confirmed, makes it easier to move in the right direction.
Thanks to Guillaume for getting me on the track. To those who might be watching this thread - yes, it's working now!
Great!
Status: I'm reading three DS18x20 sensors connected to GPIO11. I'm getting mostly good readings, but also quite a few bad ones (temp 85C).
I'll update the wiki-page as well as write an entry on my own blog, but for those impatiently waiting -
I based everything on the DTB from the FriendlyCore eflasher image. It has way more stuff than we have in the openSUSE JeOS ditto. I guess the source is also available somewhere, but I started out with decompiling to DTS.
a) Look for the entry "pinctrl@01c20800" and add a label 'gpio0:'
gpio0:pinctrl@01c20800
b) in this section, for instance above the 'csi' entry, add the following:
ds1820_pins:w1_pins@0 { label = "Dallas 1-wire"; pins = "PG11"; function = "gpio_in"; pull = <0x1>; };
c) towards the end of the file, add this node:
onewire { compatible = "w1-gpio"; pinctrl-names = "default"; pinctrl-0 = <&ds1820_pins>; gpios = <&gpio0 0x0 203 0x1>; status = "okay"; };
I added it after the "leds" node.
compile a new dtb:
dtc -b 0 -@ -I dts -O dtb your-new.dts >/boot/dtb/your-new.dtb
adjust your boot-script and reboot.
I am most certainly not very familiar with all of this, and it took a lot of trial & error. Corrections and suggestions are very much welcome.
For module 'w1-therm', I ended up adding 'strong_pullup=2' which reduced the number of bad readings, a lot.
1-wire should have CRC checksum to avoid wrong read. Guillaume
-- Per Jessen, Zürich (0.4°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Guillaume Gardet wrote:
For module 'w1-therm', I ended up adding 'strong_pullup=2' which reduced the number of bad readings, a lot.
1-wire should have CRC checksum to avoid wrong read.
Yes, it does and the kernel module also checks and prints out a YES or a NO. Sometimes you still get a good reading (the CRC is good), but it reads 85000 which is the DS18x20 saying "poor communication". Yesterday since 1500, I have read 3 sensors once a minute, that is approx. 3000 readings. Of those, 73 had a bad crc, and 203 were bad readings (85000). That's actually pretty good, only 9% failure rate. I can possibly improve it with better cabling/routing. -- Per Jessen, Zürich (0.1°C) member, openSUSE Heroes -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 04 December 2019 08:54 To: opensuse-arm@opensuse.org Subject: RE: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Guillaume Gardet wrote:
For module 'w1-therm', I ended up adding 'strong_pullup=2' which reduced the number of bad readings, a lot.
1-wire should have CRC checksum to avoid wrong read.
Yes, it does and the kernel module also checks and prints out a YES or a NO. Sometimes you still get a good reading (the CRC is good), but it reads 85000 which is the DS18x20 saying "poor communication".
Yesterday since 1500, I have read 3 sensors once a minute, that is approx. 3000 readings. Of those, 73 had a bad crc, and 203 were bad readings (85000). That's actually pretty good, only 9% failure rate. I can possibly improve it with better cabling/routing.
The pull-up resistor value is very important. You can try a higher or a lower value and test. Guillaume
-- Per Jessen, Zürich (0.1°C) member, openSUSE Heroes
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. N�����r��y隊Z)z{.�櫛맲��r��z�^�ˬz��N�(�֜��^� ޭ隊Z)z{.�櫛�0�����Ǩ�
On 25/11/2019 11:07, Guillaume Gardet wrote:
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 25 November 2019 10:46 To: opensuse-arm@opensuse.org Subject: RE: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
Guillaume Gardet wrote:
Hi,
-----Original Message----- From: Per Jessen <per@jessen.ch> Sent: 24 November 2019 16:07 To: opensuse-arm@opensuse.org Subject: [opensuse-arm] any hints for getting ds1820s to work with my nano pi neo air?
I measure temperature with DS1820 hooked up to microcontrollers (PIC) or via serial interface to regular PCs, now I was hoping to use a nanopi neo air, but I am not getting anywhere.
I have the modules loaded - w1-therm, wire, w1-gpio - but no devices turn up in /sys/bus/w1/devices. I'm connecting the DS1820s to GPIO11 - I guess I need to modify the DTB to make this work?
There are some information about 1-wire here: https://en.opensuse.org/openSUSE:1-wire
Thanks Guillaume,
Yes, I've seen that one, but it's very limited :-)
Yes, it is, but 1-wire as well. 😉 Feel free to improve it with your findings, if appropriate.
If you want to use 1-wire on a regular gpio, with w1-gpio module, you need to update your device-tree to setup it properly. Then, you can check /sys/bus/w1/devices folder for any devices found on the 1-wire bus.
If you do not update your DTB, w1-gpio will not know which gpio to use.
I picked gpio11 because it happened to be convenient for the wiring, but I don't really care which one I use. What is the easiest way of using 1-wire devices on the nanopi, without having to modify the DTB ? I'm using the Friendlycore DTB, not the one from the openSUSE Jeos image.
I fear that you need to update your DT. Not sure what is the current status of Device Tree Overlays, upstream.
If device tree overlays are supported, you may just need to create a dt fragment, compile it and load it at runtime or on boot as a kernel option.
Matthias, Yousaf, do you know about the status of the DT overlays?
AFAIK there is a way to apply overlays in U-Boot. But I have never tried that. Feel free to do so and provide feedback (maybe even a openSUSE wiki entry) :) Regards, Matthias
Guillaume
-- Per Jessen, Zürich (7.1°C) Member, openSUSE Heroes.
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (3)
-
Guillaume Gardet
-
Matthias Brugger
-
Per Jessen