Skip to content

Pico to Wemos D1 Error #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
llewmihs opened this issue Sep 29, 2021 · 1 comment
Open

Pico to Wemos D1 Error #11

llewmihs opened this issue Sep 29, 2021 · 1 comment

Comments

@llewmihs
Copy link

I'm looking to replicate your setup but with a Wemos D1 Mini instead of the Uno.
Everything looks to be working from the D1 seide, but the Pico side throws an error when the programme is run

Traceback (most recent call last):
  File "<stdin>", line 18, in <module>
OSError: [Errno 5] EIO

The code running on the Pico is as follows - some adaptations from your original to help with debugging

from machine import Pin, I2C
from time import sleep

MSG_SIZE = 15

i2c = I2C(0, scl=Pin(17), sda=Pin(16), freq=100000) 
devices = i2c.scan()

if len(devices) == 0:
    print("No I2C device found")
elif len(devices) > 1:
    print("Multiple I2C devices found -")
    for d in devices:
        print("  0x{:02X}".format(d))
else:
    print("I2C device found at 0x{:02X}".format(devices[0]))
    device = devices[0]
    i2c.writeto(0x09, 'Hi from Pi')
    sleep(0.1)
    a = i2c.readfrom(0x09, MSG_SIZE)
    print(a)

print("done")

The Pico is able to find the Wemos as an I2C peripheral

I2C device found at 0x09

but is unable to write to it. Any help gratefully appreciated, your youtube video on the topic was incredibly helpful.

@llewmihs
Copy link
Author

Well, I think I've solved my own problem - this is already covered here - esp8266/Arduino#5762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant