Looking for Some Best Microcontroller for a DIY Smart Home Project?

Is this the sort of thing you are seeing ?

For me I saw a few lines like that but it was due to the startup/reset of the C3.
I setup a test push button, and with not pullup it was floating so flooded with on/off (as expected), So I tweaked and added the pull up.
I then pressed the button, and nothing happened mmmm But the reason was I miss read the pin allocation for my exact board. When I got the correct GPIO pin, I can press the button to toggle the start as reflected in the log.

I assume you have some other logic driving the pin high/low, so my first thought is check the actual pin you are connected to is the pin you think it is.

A simple way would be to disconnect everything, then enable the pull up and check the pin it should be 3.3v. if not see what gpio pin is 3.3V, turn it off and check again. If the 2nd time its off, then good chance that is the actual GPIOx.

e.g. On my board i code to set GPIO0 assuming that would be connected to the boot button so I could use that to test. But GPIO0 was labeled 9 on the PCB, which is 0 on the correct datasheet, but not the boot button.

1 Like

Just to add a little bit more, and I would recommend checking you exact board. From a quick google it seems the JTAG on the C6 is off by default, but Om by default on the C3. GPIO4 seems to be connected to a jtag pin (TMS). So you could try a different GPIO (at least to test). e.g. I had GPIO0 working as a high/low.

1 Like

Hi Michael,

Yes, the top example is exactly what I’m seeing on the ESP32-C3, and the lower example is what the C6 board is giving me.

The Waveshare ESP32-C3-Zero doesn’t have an inbuilt pullup resistor, which is why you’ll see reference to pullup setting in the .yaml file as I was playing around with that setting. However, it’s a PIR motion detector, rather than an open switch that’s ā€˜floating’. With a multimeter I get a stable 0V (no presence) and a stable 2.8V (motion detected) reading off … oh … damn … :flushed_face:

ā€˜Pad 4’ on the C3 is GPIO 0, which happens to be next to the 3.3V pad, which on the C6 is GPIO 4. That’s a bit embarrassing isn’t it … :clown_face:

Ok 30 seconds later, ESP32-C3 re-flashed with GPIO 0, and it works perfectly.

Thank you Michael, you are a legend!! :folded_hands:

Thanks for the advice from everyone else also.

Cheers, Dave

Hi Michael,

I couldn’t find which is/are the JTAG / test pins. The BOOT pin in this case is GPIO9.

I guess that my input pin was ā€˜floating’ after all. It was also the ā€˜entity’ that was ā€˜unavailable’ while the device itself was ā€˜online’.

Thanks again. Dave

ESPHome supports Raspberry Pi Pico!

1 Like

Hi Mark,

Yeah, pretty cool, hey.

I have been using RPis but for the size factor, to make unobtrusive sensors, I thought I’d try out the ESP32 ā€˜minis’.

Cheers, Dave

Glad to hear its working now.

On thing i learnt with the esp32 and all the dev boards is make no assumptions and make sure the labels match pins.
This is even more important when chamging models and variants.

The.main thinv is ae got there, found a good reason for the issue and learnt something along the way with the help of others.

I have learnt alot this week with the feed back and help of people here as well

1 Like

ESPHome yaml can certainly get long with lots and lots of indentation :frowning: Like most things, it gets easier as you have more experience.
My Greenhouse.yaml (not yet complete) is currently 697 lines long … though I have added plenty of comments to make it easier to debug later on, and it is split into sections to make the parts easier to find.

Honestly your yaml code looks great to me.

While composing this post i see that there have been other messages, and Michael’s post #41 looks right, and pleased to see that pointed you in the right direction

:+1:

Wi-fi

My first suspect is always the wi-fi connection … this is too often the problem and since we can’t see radio signals it is too easy to just assume that it is magic.

Curiously, having identified that OTA updates are working, and the router is logging connections and joining the network, and moving closer to your WAP … i.e that the wi-fi is likely not the problem here … you then seem to have continued to look for the problem in the wi-fi. This confused me when reading the discussion above.

FYI:

  • Wi-Fi is not for speed; but for the convenience of not running Ethernet cables. No board in the last 20 years is ā€˜too slow’ for Wifi; especially since Wi-Fi is designed to adapt to lower speed as required.
  • You mention the C6 supports 5GHz wi-fi … but other IoT devices use the older cheaper 2.4GHz radio frequencies. Incidentally I found my new ASUS AX-55 router’s ā€œSmart Connectā€ feature did drop devices from 2.4GHz to encourage them onto 5GHz, so i setup separate 2.4 and 5GHz networks.
  • The small PCB and ceramic antennas can be affected by the metal in breadboards, so I try to place the microcontroller at the end of the breadboard.

yaml syntax

Probably even more common are errors in the syntax, indentation, hyphens, etc. of yaml code - a real bugger to see with the naked eye ! And that is why people ask you to post your yaml code, formatted with the </> mode. It still often takes me three or more iterations to get the indentation right - and sometimes i still just can’t see it for looking.

C6 working, but not C3

Now this does puzzle me. C6 is the newer, not yet officially supported, presumably more powerful model for the same IoT market segment as the C3. Your experience suggests that the C6 is essentially a copy of the C3 with extra features added. I hope it won’t be long as the FireBeetle 2 ESP32 C6 looks perfect for remote IoT applications (like my greenhouse).

Turns out the issue was that while the boards use similar chips, the boards themselves have different pin layout and support circuitry. I should have picked up on that from my own experience with S3 and S3-zero boards.

1 Like

Hi Donald,

Yes, thanks again. As I mentioned, I’m really only just starting with HA, ESPHome, microcontrollers … and programming … after a 30 year break.

The ESP32-C6 was not only more capable in terms of WiFi-6 but also Mesh and Zigbee. For pretty simple sensors around the house to activate lights, eventually 8 of them, I just needed something simple like the C3. My C6 will likely get repurposed for a future project.

The Wifi bit was confusing. It didn’t make sense at the start but I had read on the ESPHome forums about issues between Unifi routers and ESP32s (and I have a UDR), and the log from the device seemed to end with a line about encryption - hence the wild goose chase.

Ultimately, it’s another testament to Occam’s razor, the simplest explanation (wrong pin - learn to read the diagram!!!) was the right answer.

1 Like