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

    [SOLVED] broken Pysense board?

    Scheduled Pinned Locked Moved Expansion Board
    pysensewipy2i2cexpansion boarderror
    8 Posts 3 Posters 2.2k 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.
    • A Offline
      andrethemac
      last edited by livius

      I just got a Pysense board. I get a strange error. I can read the sensors (light, pressure, ...) but not the board.
      I get these errors:

      >>> from pysense import Pysense
      >>> p = Pysense()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/flash/lib/pysense.py", line 101, in __init__
      Exception: Pysense board not detected
      

      Is the board really broken, or am I missing something?
      André

      J A 2 Replies Last reply Reply Quote 0
      • J Offline
        jcaron @andrethemac
        last edited by

        @andrethemac How do you read the sensors? You wouldn't be creating multiple instances of the Pysense object by any chance?

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          andrethemac @jcaron
          last edited by

          @jcaron I can read the sensons directly (with their library) as the are al I2C components. You don't need the pysense as such, but It would be nice to now the version,... .

          this is a test I did to read the sensors with the pysense lib commented out, .

          from LIS2HH12 import LIS2HH12
          from LTR329ALS01 import LTR329ALS01
          from MPL3115A2 import MPL3115A2
          from SI7006A20 import SI7006A20
          # from pysense import Pysense
          import time
          # py = Pysense()
          acc = LIS2HH12()
          l = LTR329ALS01()
          pres = MPL3115A2()
          alt = MPL3115A2(mode=0)
          th = SI7006A20()
          
          while True:
            pitch = acc.pitch()
            roll = acc.roll()
            print('pitch: {}, roll: {}'.format(pitch,roll))
            print('      light: {}'.format(l.light()))
            print('   pressure: {}'.format(pres.pressure()))
            print('   altitude: {}'.format(alt.altitude()))
            print('temp from pres: {}'.format(pres.temperature()))
            print('temperature: {}'.format(th.temperature()))
            print('   humidity: {}'.format(th.humidity()))
            print('-'*80)
          
            time.sleep_ms(100)
          
          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @andrethemac
            last edited by

            @andrethemac Try passing the py object to the constructors for the various sensors. This enables them to share the I2C object, which is probably the issue here.

            See the main.py example in the Pysense library:

            py = Pysense()
            mp = MPL3115A2(py,mode=ALTITUDE)
            si = SI7006A20(py)
            lt = LTR329ALS01(py)
            li = LIS2HH12(py)
            
            A 1 Reply Last reply Reply Quote 0
            • A Offline
              andrethemac @jcaron
              last edited by

              @jcaron I tried that, but you get the error when the Pysense object gets created.
              I started out with the example from the Pysense library.

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

                @andrethemac Hooooray. It is fixed by upgrading the firmware to the latest version (0.0.7) of the pysense firmware. Maybe there was something wrong with the firmware on the board.
                BTW I had to run the dfu-util with elevated rights (sudo) before it would upgrade. (I'm using Linux).

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  jorismathijssen @andrethemac
                  last edited by

                  @andrethemac Do you have anymore tips. I was trying yesterday night and it still isnt working. Your example without pysense is working but when i turn it back on i also get the error when the Pysense object gets created.

                  I tried updating the sense framework and it looked like it was succesfull. Still no succes

                  Match vendor ID from file: 04d8
                  Match product ID from file: f011
                  Opening DFU capable USB device...
                  ID 04d8:f011
                  Run-time device DFU version 0100
                  Claiming USB DFU Runtime Interface...
                  Determining device status: state = dfuIDLE, status = 0
                  WARNING: Runtime device already in DFU state ?!?
                  Claiming USB DFU Interface...
                  Setting Alternate Setting #0 ...
                  Determining device status: state = dfuIDLE, status = 0
                  dfuIDLE, continuing
                  DFU mode device DFU version 0100
                  Device returned transfer size 64
                  Copying data from PC to DFU device
                  Download [=========================] 100% 16384 bytes
                  Download done.
                  state(2) = dfuIDLE, status(0) = No error condition is present
                  Done!

                  A 1 Reply Last reply Reply Quote 0
                  • A Offline
                    andrethemac @jorismathijssen
                    last edited by

                    @jorismathijssen Hi Joris. Did you tried tot upload thé firmware again? Be sure to powercycle your device. Did you run dfu utils with elevated rights? (Admin on Windows of sudoku on Linux?)
                    Good luck

                    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