Apologies! I'm and newbie ESP32C6 and SHTC3 won't work together

I’m running current version of HA on a raspberry pi 4 2gb, and trying to program my ESP32C6 and SHTC3 with it via USB, to make a wireless temp/humid sensor. I can get everything to compile but although the ESP32C6 boots, it does not report any temp or humidity data. The ESP32C6 is visible on my HA but the item is showing empty temp and humidity values on my dashboard. No signs of any comms with the SHTC3, and I have tried 2 of them. Here is my yaml

Board: Seeed Studio XIAO ESP32C6 (Seeed Studio)

Definition: definitions/boards/seeed_xiao_esp32c6/manifest.yaml

esphome:
name: adeles-studio
friendly_name: Adele’s Studio

esp32:
variant: esp32c6
flash_size: 4MB
framework:
type: esp-idf

logger:

api:
encryption:
key: “(key redacted for obvious reasons=”

ota:

  • platform: esphome

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: Adele’s Studio Fallback Hotspot
password: “redacted”

captive_portal:

i2c:

  • scl: GPIO23
    sda: GPIO22
    id: i2c_1
    scan: true
    scl_pullup_enabled: true
    sda_pullup_enabled: true

sensor:

  • platform: shtcx
    i2c_id: i2c_1
    humidity:
    id: sensor_shtcx_1_humidity
    name: Humidity
    temperature:
    id: sensor_shtcx_1_temperature
    name: Temperature
    id: sensor_shtcx_1
    update_interval: 15s

I’m pretty sure I have the wiring between the esp and the sensor correct.
I think there’s a stage I’m missing, being a newbie.
After compiling, should the sensor work while it is still connected to the Pi4 via USB? Because, that’s what I’ve been doing. The pi has a 4 amp power supply, so I don’t think low voltage is the problem. I’ve followed this tutorial on YouTube. https://www.youtube.com/watch?v=llA2mdCh7Kc
I’m usually pretty handy with these things, but struggling with this. If you would like me to post a photo of the wiring I can do this althoug just 4 wires so I’m pretty sure I’m ok and have checked with my multimeter that the 3.3v is getting to the sensor.
Thanks
Chris

Very good idea. With I2C “correct wiring” doesn’t just mean correct pins.

Also, post your code using code tags </> so it’s readable.
Post also your esphome logs (with code tags), so we see what’s going on.
And image of your SHTC3 circuit board, at the moment we only know you have chip like this from Sensirion (if not fake) :
image

You also need to include the logs, which will show if it finds the device or not.

Hi Karosm,
Thanks for your help. It’s the usual irony… struggle for a week, ask for help, then find the solution after asking for help.
Turns out I had done everything correctly. It was my Seeed Studio ESP32C6 that was faulty. It had non-functional I2C pins on GPIO22 and 23. Unfortunately, the GPIO ports for the low power I2C are not wired to the header on this board. I have it working fine now with a new ESP32. I’m loath to throw the old one away so I might keep hold of it and write “no I2C” on it, in the hope it has no other faults.


Have a great day and sorry to trouble you.
Chris

Hi Neel.
Hope you’re well.
Thanks so much for offering to help. I’ve no doubt that I’ll have further matters requiring assistance in future. People like yourself are well appreciated by newbies such as myself.
Please read my reply to Karosm.
Interestingly, the ESPHome Builder default configuration for the Seeed Studio ESP32C6 puts the I2C on pins 6 and 7, which are to the low power I2C output. This is NOT CONNECTED on this board. It uses GPIO 22 and 23 instead. I think that needs updating but I don’t know whom to tell…
Have a great day. Thanks again.
Chris.

Gpio6 / 7 are exposed on backside of the board as MTCK/MTDO.
I’m surprised that esphome supports LP-core functions in the first place.

Edit: I didn’t find any evidence that LP-core features are available on esphome, so your solution sounds pretty confusing to me. Can you explain better?

Huh?

Do you actually have a Seeed Studio board or some other board?

There are many numbering systems typically in use and you have to be clear about which one you are using and where.

There are the pin numbers of the dev board itself (and there is the do you start counting at 0 or 1, but pins generally start counting at 1).

There are the D numbers, which are an indirection introduced to make things easier to explain (but more confusing when you know more).

There are the GPIO numbers which are what the SW/FW needs to know, which are what the chip thinks in.

The esp chips have a mux, so you can generally define any pin to any function. There are conventions that say this GPIO is generally used for i2c, but it is not required for esp chips. Since there is so much freedom it can be hard to understand how to make a good choice.

LP pins are not like general I/O pins.
But I heavily doubt OP really had non-working LP I2C pins on Xiao and then found them on another board. Because esphome doesn’t feature LP.
Quite likely just normal I2C pins and bad soldering / missing pullups.

Huh?
You don’t believe it was a Seed Studio board, although I did state this very clearly in my post!
My previous post also indicated that I used ESPHome Builder, and why would I want to start muxing pins if I’m a newbie and using the builder for simplicity? The pinouts were as per the HA plugin, and the defaults placed into the yaml by this are incorrect for this board. Here is a screenshot from the default I2C yaml generated by ESPHome Builder, when this Seeed Sudio board is selected, and the I2C component is imported:

This leads a newbie like me up the garden path, since the app imports the wrong pin assignments and doesn’t even label them as GPIO pins. GPIO 6 and 7 on this board are generally used for the low power I2C system, and are not available on the header, only on flimsy SMC pads on the rear of the board. The ESP32C6 default I2C pins are 22 and 23, which are marked D4 and D5 on the actual board…

I do accept though that if I had muxed the pins, I could have completely ignored the ESPHome builder written my own yaml, and done it any way I liked. That’s if I had the acumen, which I don’t. I used the builder, because that seems to be the preferred and recommended way for newbies.

I’ll keep my eyes open for further misleading things like this in the Builder.

I thought the Seeed Studio board had internal pullups, which are enabled by default. Are additional ones required when connecting I2C devices? If so, I’ve not seen this done on any of the hobby projects I’ve looked at…
Although a newbie with the ESP32, I’ve a soldering microscope and 45 years experience in soldering as part of my Ham Radio hobby (G4JHQ). I’d stake my life on my soldering being solid. However, I’d accept static burning one of the pins as being a possibility. These Seeed Studio board are shipped in a non-conductive foam disc, placed in a plastic screw top box, which is a great way to make them vulnerable to static. A conductive bag would have been a better choice in my opinion, although nothing like as fancy.
I’m learning a lot from this challenging discourse!
Thanks!

Unfortunately to someone who has seen many people struggling with getting started (which is difficult) your post was and still to some extent shows a significant lack of understanding. There is nothing remarkable about that, everyone was there are their beginning.

While that might have been clear to you, it wasn’t to me. It got lost in the other topics that you covered.

This is where the definition lives.

I have seen some other things checked in that do not work. I don’t believe any of the devs who work on esphome visit here. I have heard they are on Discord, so you can try there or create an issue on GitHub. Or, just know it isn’t quite right and how to create your own config.

As far as i2c goes, it always requires proper pull-ups. Many sensor boards include these pull-ups. This is the reason people say show your work/connections and be specific about exactly what you are using. Otherwise you will get generic advice that probably won’t be very helpful and could even be annoying.

Seed studio board doesn’t have pullups on gpio pins. Esp chip has weak ~50k internal pullups and esphome activates those for I2C on esp32 by default. But they are too weak alone for most of cases. So if you are using bare SHTC3 or a module without pullups on board, you need to add them. Hobby projects use often hobby sensors which have those on board for hobbyist convenience.

All this doesn’t change the fact that xiao gpios are almost all good for I2C on esphome, no need to change supplier.

That’s great information and not easily found online.
I’m grateful.
I’m learning!
Thanks, Karosm!

Hi there,

I’m very grateful for your help.
I’m learning heaps from you and others reviewing my post, and it’s great!
These things aren’t easily found on internet searches, and moreover as a newbie, it’s very difficult to work out what is important and what is not.
There is no substitute for experience and I really appreciate your taking time to help me improve.
Thanks for steering me along. You’re encouraging me to experiment and learn more.
I’m really enjoying this!
Best wishes.

Chris.