1-Wire Temperature Sensor - DS18B20 - on Omega2

  • Hi
    Has anyone got advice for how to get a DS18B20 1-wire temperature sensor to appear on an Omega2?

    Following the instructions on https://wiki.onion.io/Tutorials/Reading-1Wire-Sensor-Data I have setup the gpio pins:

    echo "w1-gpio-custom bus0=0,19,0" > /etc/modules.d/55-w1-gpio-custom
    And connected the sensor to power, gnd and pin 19 with an appropriate resistor across power and pin 19.

    However I don't see my sensor in either /sys/devices or /sys/bus/w1/devices

    I have checked on a Raspberry Pi that the sensor works in that configuration.
    Omega2 Device Firmware Version: 0.1.7 b139

    Appreciate any help

  • Hi,

    same here.

    did exactly the same without success using firmware version -> omega2p-v0.1.8-b145.bin

    testet it on pi to make sure the wiring is correct

    any thoughts??

  • I got error message when I trying to load w1-gpio-custom module. Maybe onion team have to patch it.

    # insmod w1-gpio-custom bus0=0,19,0
    [  124.179275] Custom GPIO-based W1 driver version 0.1.1
    [  124.184807] w1-gpio w1-gpio.0: Failed to parse gpio property for data pin (-2)
    [  124.192201] w1-gpio: probe of w1-gpio.0 failed with error -2

  • So, I dug into this and it appears there is, indeed, a bug. I patched this in my own version of LEDE with the patch from https://dev.openwrt.org/ticket/21965?cversion=0&cnum_hist=8#no1 , after which 1-Wire began to work.

  • I asked whether LEDE-devs would accept the patch, if I made a pull-request, but they are being pricks about it and refuse. @Lazar-Demin For now, please integrate the patch into your official firmware for those, who aren't using custom firmwares, in order to get w1 working.

  • @WereCatf Looked at there ask, and they seemed to want a higher resolution (say in drivers/pinctrl) to prevent the need for the assumption/check where you did it.

    With that, if you had to fix this bug higher up ( or down, depending on how you look at it) the stack, what would be a broader resolution? And would you still need that check in the specific driver file you made?

    I do dislike the general "suggestions" or "I wouldn't have done it that way" as a means to squash a PR, but I do like issues resolved at where they occur earliest. I'm asking as I want to learn from your way of thinking about this :)

  • @Theodore-Borromeo This issue has been around for fricking years and no one has fixed it "properly" and no one, who actually has the skills to do it, is willing to! But then no one is also willing to accept this patch, even temporarily, which comes to my opinion: it's idiocy. Getting things working should be more important than aesthetics, especially if the issue lingers around for years and years and nothing is ever done about it!

    Yes, fixing things up in pinctrl would possibly be the "most correct" way of fixing things, but it's not happening. On the other hand, this is just a simple two-line patch, so it would be extremely easy to apply for now and remove one day in the future, if someone decided to fix things "correctly."

  • @WereCatf I agree completely. Especially as, if it is fixed 'upstream', and your patch stayed, there is minimal effect should it stay in place! On top of that, as you are pointing out, "everyone wants the perfect patch, but ain't no one wanna write the perfect patch!" ;)

  • Hi All, so what do I have to do to install your patch? I need a temperature controller for my next project.
    Keep up the good work! :)

  • @WereCatf

    Just think of all the other sensors that have to be "worked on" by the Onion programmers !

  • @Morten-Egge You can't apply the patch to the official firmware, you need to compile your own or wait for the Onion devs to fix theirs. I have already included the patch in my LEDE-sources.

  • @WereCatf Thanks for the update/answer, hopefully the onion team will adress this issue. I have a project that requires the one wire sensor. I do understand that the onion team has a lot on they're plate right now.

  • I get also this gpio error :( . When Onion correct this to firmware?? I have firmware 0.1.9 (b149) and it don't work!!! Please do something!!

  • @Lazar-Demin any idea when 1-wire will be returned to the firmware so we can all hook up our sensors?

    Home and Business Automation


  • This is basically the "hello world" of sensors programs and it is broken. :( I'm beginning to wonder if the MKR1000 would have been a better option.

  • Onion issued a post on GitHub that they are planning to look at 1-wire this week.

    Home and Business Automation


  • firmware update arrived:


    February 2, 2017

    • Added patch to fix 1-wire master issue where virtual nodes were not accepted as gpios
    • Infra: added option for quick (essential) compile
    • Infra: reorganized patches

    I guess they patched it, will check later...

    As far as I can tell it is working ;-) did my first reading.

    Following the Omega (1) instructions:


  • How do we do an upgrade to b151 without losing everything we have installed to /usr/bin?

    Home and Business Automation


  • Confirmed as working fine on my 2+


    Home and Business Automation


  • @Costas-Costas Did you find a solution for your backup problem?

  • Nope, reinstalling now.

    Home and Business Automation


Log in to reply