pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
200 stars 166 forks source link

G01 I2C bus not finding I2C device (SSD1306) #318

Open mamelmahdy opened 5 years ago

mamelmahdy commented 5 years ago

Board information: (sysname='GPy', nodename='GPy', release='1.18.2.r7', version='v1.8.6-849-df9f237 on 2019-05-14', machine='GPy with ESP32')

I am actually using the G01 module on a custom board. I thought I could fix the problem with a firmware update, and I chose GPy as the board. However, problem still persists.

Trying to use a SSD1306 screen over the I2C bus. The same script works on a GPy connected to a PyTrack.

For initializing the screen I have

from machine import I2C import ssd1306

i2c = I2C(0, I2C.MASTER, baudrate=100000, pins=("P9","P10")) oled = ssd1306.SSD1306_I2C(128, 32, i2c)

Which results in this error:

Traceback (most recent call last): File "main.py", line 37, in File "/flash/lib/ssd1306.py", line 117, in init File "/flash/lib/ssd1306.py", line 37, in init File "/flash/lib/ssd1306.py", line 62, in init_display File "/flash/lib/ssd1306.py", line 122, in write_cmd OSError: I2C bus error

Running i2c.scan() in the REPL leaves the device hanging with no response.

Running i2c.scan() on a GPy in the REPL returns the correct address of the SSD1306 screen ([60] aka 0x3c).

The SSD1306 driver I am using is what is provided on the pycom repo.

robert-hh commented 5 years ago

Please check the connection. G01 and GPy should not differ with respect to I2C on P9 and P10.

mamelmahdy commented 5 years ago

Thank you for the response! I will revisit this as soon as I can resolve some network attachment and SIM card read issues I am having on the GPy modem (and not my custom board). I have posted another issue about this (#320 )