1-wire using DS2482-100

2016-03-05
2016-03-22
  • DavidCozens - 2016-03-05

    Has anyone had any success using 1-wire devices connected using the DS2482-100 with CODESYS?

     
  • DavidCozens - 2016-03-08

    Edwin Schwellinger hat geschrieben:
    Hi David,
    no, but this link seems to be straight forward, then you need to change the location in CODESYS were the sensors are read from.
    http://raspberrypi.tomasgreno.cz/therma ... r-i2c.html
    BR
    Edwin

    Thanks Edwin, I hadn't gone down this route because the CODESYS driver is using /sys/devices/w1_bus_master1/. I think that means that CODESYS must access 1-wire masters as Linux one wire devices, I found source code for the drivers here http://lxr.free-electrons.com/source/dr ... 1/masters/. I believe that owns provides a different interface mechanism that isn't compatible with CODESYS. I'll post when I have something working. Thank you for the suggestion.

     
  • eschwellinger

    eschwellinger - 2016-03-08

    Hi David,
    CODESYS read only the values in/sys/devices/w1_bus_master1/
    the real Job is done by the Linux kernelmodul.
    So why no change the path to the new location of your sensor Location... and maybe adapt it.

    BR
    Edwin

     
  • DavidCozens - 2016-03-22

    Getting this working was actually very straightforward - I should have come back and updated this sooner.

    I needed to install the kernel module for the DS2482 and then create the device (NOTE 12C drivers already installed).

    sudo sh
    modprobe ds2482
    echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
    exit
    

    for me this created a 1wire master matching the default name of . In CODESYS I added the onewire_master and a single DS18B20 device. On the pi look in the device directory

    ls /sys/devices/w1_bus_master1
    

    The directory will have a directory for each connected device - mine was named , add this as the in the DS2482 configuration.

    As mentioned in previous posts updating the 1 wire devices is very slow - the suggestion is to put them on another lower priority slow task.

    To make these changes will be lost on a reboot, to make them permanent add ds2482 to /etc/modules. Then one of the startup scripts can be used to create the new_device. I haven't decided where I want to do this yet.

     

Log in to post a comment.