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

    Sigfox and SSD1306

    Scheduled Pinned Locked Moved Getting Started
    6 Posts 3 Posters 33 Views 4 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
      alexlont
      last edited by

      Im trying to create a Sigfox signal tester using the return RSSI using a Fipy and a SSD1306 OLED
      im getting an error in relation to SSSD1306. i have a script from the following.
      https://github.com/pycom/pycom-micropython-sigfox/blob/master/drivers/display/ssd1306.py
      i get the following error

      >>>
      >>>
      ♦Traceback (most recent call last):
        File "<stdin>", line 12, in <module>
        File "ssd1306.py", line 109, in __init__
        File "ssd1306.py", line 37, in __init__
        File "ssd1306.py", line 64, in init_display
        File "ssd1306.py", line 89, in show
        File "ssd1306.py", line 119, in write_data
      AttributeError: 'I2C' object has no attribute 'start'
      ♦>
      Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; FiPy with ESP32
      Pybytes Version: 1.6.1
      Type "help()" for more information.
      >>>```
      
      

      my main.py code is below

      from machine import I2C, Pin
      from network import Sigfox
      from ssd1306 import SSD1306_I2C
      import socket
      
      #i2c = I2C.init(0, I2C.MASTER, baudrate=100000, pins=("P10","P10"))
      #INITIALIZATION AFTER POWER UP
      i2c = I2C(0, I2C.MASTER)             # create and init as a master
      # configure the I2C bus
      i2c.init(I2C.MASTER, baudrate=400000) # init as a master
      oled = SSD1306_I2C(128, 32, i2c, 60,external_vcc=True)
      
      sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ4)
      s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
      s.setblocking(True)
      s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, True)
      s.send(bytes([0, 1, 2, 3]))
      r= s.recv(32)
      print(r)
      rssi=sigfox.rssi()
      print(rssi())
      oled.text(rssi, 0, 0, 1)
      oled.show()
      s.close()
      
      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @alexlont
        last edited by

        @alexlont said in Sigfox and SSD1306:

        SSSD1306

        It is quite old. Try to use it from official micropython it use framebuffer then
        https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py

        think about people first, then computers

        A 1 Reply Last reply Reply Quote 2
        • A Offline
          alexlont @livius
          last edited by

          @livius I've updated my SSD1306.Py script to refect the newer library. however im still getting the exact same issues.

          Pybytes configuration read from /flash/pybytes_config.json
          Traceback (most recent call last):
            File "main.py", line 7, in <module>
            File "ssd1306.py", line 109, in __init__
            File "ssd1306.py", line 37, in __init__
            File "ssd1306.py", line 64, in init_display
            File "ssd1306.py", line 89, in show
            File "ssd1306.py", line 119, in write_data
          AttributeError: 'I2C' object has no attribute 'start'
          Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; FiPy with ESP32
          Pybytes Version: 1.6.1
          Type "help()" for more information.
          >>>
          
          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @alexlont
            last edited by livius

            @alexlont
            Are you sure that you are using this new one?
            There is no start command in the new code.

            think about people first, then computers

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jcaron @livius
              last edited by

              @livius The new version uses i2c.writevto, though, which does not seem to exist in Pycom firmware (at least it's not documented, didn't check an actual device or the sources).

              But the error message should be slightly different, the error shown clearly points to the older version of the driver.

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

                @jcaron said in Sigfox and SSD1306:

                i2c.writevto

                this looks like bug should be writeto

                think about people first, then computers

                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