Sigfox and SSD1306



  • 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()
    


  • @jcaron said in Sigfox and SSD1306:

    i2c.writevto

    this looks like bug should be writeto



  • @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.



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



  • @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.
    >>>
    


  • @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


Log in to reply
 

Pycom on Twitter