Communication Issues

Troubleshooting I2C, REPL, and Wi-Fi connectivity problems

📡 I2C Device Not Found (0x40)

Symptoms:

  • Error: "PCA9685 not found at address 0x40"
  • I2C scan returns empty list
  • Servos don't respond to any commands

Solutions:

1. Run I2C scan diagnostic

# Connect via REPL:
from machine import I2C, Pin
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)
devices = i2c.scan()
print("Found devices:", [hex(d) for d in devices])

Should show: Found devices: ['0x40']

2. Check wiring

  • SDA: Pico GP0 → PCA9685 SDA
  • SCL: Pico GP1 → PCA9685 SCL
  • VCC: Pico 3V3(OUT) → PCA9685 VCC (NOT 5V!)
  • GND: Pico GND → PCA9685 GND

3. Check I2C address

  • • Some PCA9685 boards default to 0x41 instead of 0x40
  • • Check address jumpers on PCA9685 board
  • • Try: sc = ServoController(i2c_address=0x41)

4. Add pull-up resistors

  • • Some PCA9685 boards lack pull-up resistors
  • • Add 4.7kΩ resistors: SDA→3.3V and SCL→3.3V
  • • Or enable internal pull-ups in code (less reliable)

💻 Can't Connect to REPL

Symptoms:

  • Terminal shows no output when connected
  • Port not showing up in device list
  • "Port not found" or "Access denied" errors

Solutions:

1. Check USB connection

  • • Try different USB cable (must support data, not just charging)
  • • Try different USB port
  • • Check for loose connections

2. Find the correct port

macOS/Linux:

ls /dev/tty.*  # Look for /dev/tty.usbmodem*

Windows:

  • • Open Device Manager
  • • Look under "Ports (COM & LPT)"
  • • Find "USB Serial Device (COM#)"

3. Reset to bootloader

  • • Unplug Pico from USB
  • • Hold BOOTSEL button
  • • While holding, plug in USB
  • • Pico appears as USB drive (RPI-RP2)
  • • Re-flash MicroPython if needed

📶 Wi-Fi Connection Problems

Symptoms:

  • Can't connect to Wi-Fi network
  • Connection drops frequently
  • Web interface not accessible

Solutions:

1. Verify credentials

  • • Check SSID is correct (case-sensitive)
  • • Verify password is correct
  • • Ensure using Pico 2W model (has Wi-Fi), not regular Pico

2. Check network compatibility

  • • Pico 2W only supports 2.4GHz Wi-Fi (not 5GHz)
  • • WPA2 security (WPA3 not supported)
  • • Check router allows new device connections

3. Test connection

import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('YourSSID', 'YourPassword')
# Wait 10 seconds
print(wlan.isconnected())
print(wlan.ifconfig())  # Shows IP if connected