Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    onewire example

    Scheduled Pinned Locked Moved WiPy 2&3
    9 Posts 3 Posters 2.1k Views 3 Watching
    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.
    • L Offline
      livius
      last edited by

      when we use onewire example for DS18X20
      but without any connected sensor we go two issues:
      1.

      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "dstemp.py", line 11, in <module>
        File "onewire.py", line 190, in read_temp_async
      IndexError: list index out of range
      

      this is because of this line rom = rom or self.roms[0]
      2. after exception when we rerun sample we got memory allocation error

      with sensor connected all is ok :)

      think about people first, then computers

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        abilio @livius
        last edited by

        @livius, as usual, thanks for your help :) , I think no one had used the script like that before ;) . We'll have a look at it.

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          livius @abilio
          last edited by livius

          @abilio
          another error is for negative temperature for adress 28
          code should be like this

                  elif rom0 == 0x28:
                      temp = (temp_msb << 8 | temp_lsb) * 100 // 16
                      if (temp_msb & 0xf8) == 0xf8: # for negative temperature
                          temp -= 0x1000
                      return temp
          

          i have created pull request as i see that now this is on github as libs

          think about people first, then computers

          1 Reply Last reply Reply Quote 0
          • C Offline
            Colateral
            last edited by Colateral

            Hello,

            On LopY, with build 1.1.1b1, onewire code is not reading anymore the DS1B20 sensor.
            We simply upgrade Lopy that has connected the DS1B20 sensor(with pll pul rezist) on P23, GND, 3.3V ...

            Unplug LopY and plug WiPy with the same code and same build... everything is working fine.

            Do you have any idea how to fix this regression on LOpY?

            Thx

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              livius @Colateral
              last edited by livius

              @Colateral said in onewire example:

              1.1.1b1

              Do you mean 1.5.1?
              I do not have Lopy only Wipy - bot maybe someoune else can point you.

              One question - did you tried with different pin then P23?
              Maybe something interfering.

              think about people first, then computers

              C 1 Reply Last reply Reply Quote 0
              • C Offline
                Colateral @livius
                last edited by

                @livius Yes. Deeply sorry for the typo... ideed the build is 1.5.1b1. I tried also with other pin and I got the same. It is higher probability that is a timing (microseconds) microseconds issue related to LoPy.

                On WipY is working fine: same expansion board same pin and DS1B20.

                C 1 Reply Last reply Reply Quote 0
                • C Offline
                  Colateral @Colateral
                  last edited by

                  @livius I Know why I typed wrong the release name ... The downloaded pycom firmware update file is pycom_firmware_update_1.1.1.b1.exe .... that install 1.5.1.b1 firmware

                  L 1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius @Colateral
                    last edited by livius

                    @Colateral
                    Strange that you have this difference
                    because wipy is near equal to lopy
                    but have you connected antenas? especially to lora?
                    Without antena for lora it is possible to got interference and also damage board(low possible but..)

                    think about people first, then computers

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      Colateral @livius
                      last edited by

                      @livius Both antennas were connected.
                      Today I unpacked a brand new LopY ... and we did again the tests. Same results also with this new one.
                      I send to Daniel the onewire.py script... you ca do it yourself and see the issue with your own eyes .

                      1 Reply Last reply Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • 1 / 1
                      • First post
                        Last post

                      Pycom on Twitter

                      Pycom