• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    unipi 1.1 + pi3 and 1Wire DS18B20 bus problem

    CODESYS
    4
    12
    5741
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alverman
      Alverman last edited by

      Good morning,
      Use CoDeSys with unipi 1.1 and raspberry PI3
      I did some projects that manage digital inputs and relay and everything works perfectly, but trying 1wire bus I just can not operate the DS18B20 sensor.
      I tried the projects found online or in the CoDeSys but did not work either !!

      I tried to enter the raspberry and typing:

      PI3_MMM pi @: ~ $ cd / sys / bus / w1 / devices
      pi @ PI3_MMM: / sys / bus / w1 / devices $ cd 28-0004442100ff
      pi @ PI3_MMM: / sys / bus / w1 / devices / 28-0004442100ff $ cat w1_slave

      00 00 00 00 00 00 00 00 00: crc = 00 YES
      00 00 00 00 00 00 00 00 00 t = 0

      It seems to not work !!
      I have three sensors, and I tried them all with the same result.

      any advice?

      thx, Alberto

      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @Alverman last edited by

        @Alberto-Cauzzi Hello,

        so you are using the kernel module for 1Wire? Please paste more info, eg. how did you configure it, what happens if you put more sensors on the network, etc..

        Alverman 1 Reply Last reply Reply Quote 0
        • Alverman
          Alverman @tomas_hora last edited by

          @tomas_hora
          Hi,
          I have:
          PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
          NAME="Raspbian GNU/Linux"
          VERSION_ID="8"
          VERSION="8 (jessie)"
          ID=raspbian
          ID_LIKE=debian
          HOME_URL="http://www.raspbian.org/"
          SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
          BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

          and
          Linux PI3_MMM 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux

          In PI config I have enabled 1wire

          The sensor is connected to the RJ45 port UNIPI 1.1
          I also have a hub (yours) to 8 channels (in and out included) but for now I wanted to try it by connecting the sensor directly to unipi

          Thanks, Alberto

          1 Reply Last reply Reply Quote 0
          • Alverman
            Alverman last edited by

            0_1488551302845_upload-383c6e3c-d159-4e9b-b952-0d9724fed53a

            Alverman 1 Reply Last reply Reply Quote 0
            • Alverman
              Alverman @Alverman last edited by

              @Alberto-Cauzzi
              this project is for raspberry not for unipi and not work with sensor connected on 1wire unipi port.
              The error is only bad image reference

              1 Reply Last reply Reply Quote 0
              • Alverman
                Alverman last edited by

                0_1488551821112_upload-e1394848-83c9-4084-8a1c-2dc61aaeccf4

                1 Reply Last reply Reply Quote 0
                • Alverman
                  Alverman last edited by

                  In CoDeSys only it works unipi 1.1 card.
                  In CoDeSys the expansion board i2c to 8 relays and 1wire bus DO NOT WORK !!

                  1 Reply Last reply Reply Quote 0
                  • T
                    tomas_hora administrators last edited by

                    I guess you did not read the manual which describes the installation really nicely. The Raspi-config you used enables 1Wire via GPIO but the 1Wire we are using is connected via I2C...

                    Please follow the datasheet as described https://store.codesys.com/codesys-for-unipi.html

                    1 Reply Last reply Reply Quote 0
                    • L
                      lefrank01 last edited by

                      I got this problem few time ago. The sample project gived by Codesys isn't perfect but with this program you can get the address.

                      -First thing I see is to disable 1-Wire. Because Codesys will try to ping 1-wire Bus from the raspberry pi board and not the 1-wire Bus from UNIPI board. Because the UNIPI BUS is over I2C.

                      The best thing to do is to run the installation script. But for this, you need to log into the root session.

                      Put the script into USB KEY.
                      log into the root session
                      click right on the script, property.
                      permission - and bring it executable from anyone.
                      then double click on the script.
                      Run from terminal.
                      There the script gonna get you the correct configuration. Make sure internet work because if my memory is good it have to download something.

                      I did this on a clean install of pixel. And after that everything was fine.

                      With my best regard,
                      Mathieu lefrançois

                      D 1 Reply Last reply Reply Quote 0
                      • L
                        lefrank01 last edited by

                        IF NOT x THEN
                        x := TRUE;
                        //scan function
                        FOR ui:=1 TO MIN(Onewire_master.uiScannedDevices, 20) DO
                        astrID[ui] := Onewire_master.pasScannedDevices^[ui-1].StringRepresentation;
                        END_FOR
                        END_If

                        Run this code into a seperate POU (ST language)

                        x=bool
                        astrID=array
                        ui=UINT

                        With my best regard,
                        Mathieu lefrançois

                        1 Reply Last reply Reply Quote 0
                        • L
                          lefrank01 last edited by

                          with this, look online the string of the array. from 1 to 20 DS18B20 correctly wired you will have the address.

                          Once that done, you need to insert the address manually of each DS18B20 into codesys DS18B20. If you use more than 1 DS18B20, you have to click on the DS18B20 already existing, ADD new device and add another DS18B20.

                          With my best regard,
                          Mathieu lefrançois

                          1 Reply Last reply Reply Quote 1
                          • D
                            DavidCozens @lefrank01 last edited by

                            @lefrank01 thank you for sharing your tips. I have also had this reported once or twice and on each occasion starting from a clean install of Raspbian, installing CODESYS for Raspberry Pi and then running the script that ships with CODESYS for UniPi has resolved users problems.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post