0

RuntimeError: No pull up found on SDA or SCL; check your wir
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RuntimeError: No pull up found on SDA or SCL; check your wir

by AJJ1 on Mon May 23, 2022 12:11 am

Hello,

I just received two(2) QT Py RP2040 a few day ago. I update the Python 7.2.5. I download the BME_680 bundle and copied the library file and code.py to the QT PY RP2040. I continuously get this error:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 9, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

This occurs on both QT Py RP2040s. I tried different combination of BME-688 sensors and Stemma connectors. I tried installing a older version on python 7.2.4. & 7.3.0.rc2. Error remains.

Please help. TY

Alex J.

AJJ1
 
Posts: 15
Joined: Sun Nov 30, 2014 5:54 pm

Re: RuntimeError: No pull up found on SDA or SCL; check your

by neradoc on Mon May 23, 2022 4:05 am

Hi, I don't know your code, but the QT PY RP2040 has the stemma QT connector wired to SDA1 and SCL1 or board.STEMMA_I2C().
If you are using code that uses board.I2C() or busio.I2C(board.SCL, board.SDA) you need to update it with those.

neradoc
 
Posts: 174
Joined: Wed Apr 27, 2016 2:38 pm

Re: RuntimeError: No pull up found on SDA or SCL; check your

by AJJ1 on Mon May 23, 2022 8:11 pm

neradoc,

Thank you. Here's the original code:

Code: Select all | TOGGLE FULL SIZE
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
import adafruit_bme680

# Create sensor object, communicating over the board's default I2C bus
i2c = board.STEMMA_I2C()  # uses board.SCL and board.SDA
bme680 = adafruit_bme680.Adafruit_BME680_I2C(i2c, debug=False)

# change this to match the location's pressure (hPa) at sea level
bme680.sea_level_pressure = 1013.25

# You will usually have to add an offset to account for the temperature of
# the sensor. This is usually around 5 degrees but varies by use. Use a
# separate temperature sensor to calibrate this one.
temperature_offset = -5

while True:
    print("\nTemperature: %0.1f C" % (bme680.temperature + temperature_offset))
    print("Gas: %d ohm" % bme680.gas)
    print("Humidity: %0.1f %%" % bme680.relative_humidity)
    print("Pressure: %0.3f hPa" % bme680.pressure)
    print("Altitude = %0.2f meters" % bme680.altitude)

    time.sleep(1)


I changed the I2C method to "board.STEMMA_I2C()" and it works. Question: How would I write the code for "board.I2C()"? i2c = board.I2C(SCL1, SDA1)?

V/r

Alex J

AJJ1
 
Posts: 15
Joined: Sun Nov 30, 2014 5:54 pm

Re: RuntimeError: No pull up found on SDA or SCL; check your

by danhalbert on Mon May 23, 2022 10:41 pm

Question: How would I write the code for "board.I2C()"? i2c = board.I2C(SCL1, SDA1)?


i2c = busio.I2C(board.SCL1, board.SDA1) would be for the STEMMA connector on this board.
board.I2C() on this board are the SCL/SDA pins. But on other boards, the STEMMA pins may be the same as the SCL/SDA pins. It depends on whether there were spare pins available or not.

danhalbert
 
Posts: 3256
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.