I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

Code: Select all

# file system setup
mp3s = []
for filename in os.listdir('/sd'):
    if filename.lower().endswith('.mp3') and not filename.startswith('.'):
        mp3s.append("/sd/"+filename)
        print("/sd/"+filename)
print(length(mp3s))
Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

It not giving me anything. Its the same screen showing that index is out of range.

Is there any chance that the sd card reader is broken?

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

I doubt it, setting up the SD filesystem would most likely fail. Can you post a screenshot of the SD contents?

It's not finding any files. That's why you get the index out of range: there's nothing in the list and the code is trying to access the first thing in it.

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

Capture.PNG
Capture.PNG (42.07 KiB) Viewed 112 times
This is what is on the sd card

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

Can you try some simpler tests? This would be good: https://learn.adafruit.com/adafruit-mic ... es-2976357

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

I used that code and its telling me that there is no sd card detected even though I have a sd card in the slot.
Capture.PNG
Capture.PNG (97.91 KiB) Viewed 93 times
thumbnail_IMG_8537.jpg
thumbnail_IMG_8537.jpg (396.32 KiB) Viewed 93 times

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

Time to double check the wiring for the SD card I guess.

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

I doubled check the wiring. Everything is how it was shown.

https://learn.adafruit.com/walkmp3rson- ... on-circuit

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

For the card you just need MISO, MOSI, SCLK, and SDCS (the SD chip select). The first 3 are needed for the display as well. Make sure the pin you use for SDCS agrees with the code.

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

So I checked the wiring and everything looks good. I was able to get it to work by switching out the SD Card to a different one. Not sure why the other would read even though it was perfectly fine. I've ran into a new issue. The display pulls up and everything but now it's telling me there's a memory error.
thumbnail_IMG_8627.jpg
thumbnail_IMG_8627.jpg (422.53 KiB) Viewed 64 times

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

The code is trying to use more memory (RAM to be specific) that is available. What MCU board are you using?

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

I'm using the Feather RP2040.

https://www.adafruit.com/product/4884

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

That has about as much ram as you're going to get in an MCU (256K). How big are your sound files? My guess is that it's the decoder buffering. Can you post the code that's giving that error?

Dave

User avatar
Scallopman1739
 
Posts: 15
Joined: Mon May 29, 2023 5:36 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by Scallopman1739 »

The largest sound file I have is 11.1MB. Probably what's leading to the memory error.

Do you mean the code for the decoder?

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: I2C NeoKey 1x4 error: ValueError: No I2C device at address: 0x30

Post by dastels »

The error was close to this line, which seems like it'd use lots of memory.

Code: Select all

 mp3stream_fc = audiomp3.MP3Decoder(mp3_file_fc)
Try smaller files. Convert them to a lower quality (smaller size) and see if that helps.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”