PeterJBurke / Nanostat

ESP32Stat_Rev_3_5_PIO
MIT License
40 stars 10 forks source link

Expected startup behavior? #9

Closed c-jw closed 9 months ago

c-jw commented 9 months ago

Dr Burke,

I ordered a set of PCBs, and have followed the provisioning/firmware tutorial on Youtube. Thank you for such detailed explanations.

VSCode reports success on the build, the upload of the build file, and the upload of the filesystem image. However, after unplugging and restarting the nanostat hardware, I do not see the expected behavior. There is no access point, for example. I also attempted building and uploading the firmware again with my wifi credentials in the wifi-credentials.h file, and did not see the device on my network. I have power to the board as signified by two green LEDs shining.

I am worried I have a hardware issue. Before I dive into that, could you share if there is any other expected startup behavior from the board that I could use to confirm the ESP32 (or other hardware) is working? Are there any expected blue "blinky" LED flashes on startup? Are there any other tests you would recommend?

Thank you in advance. I know any support you provide here is a service.

PeterJBurke commented 9 months ago

Hi c-jw:

I don't have any self tests programmed in. That is a good idea.

I will check the startup behavior I see and post later this week here.

In the meantime, I would suggest: 1) Use an app such as Wifi Analyzer (Android) to see if there is any RF signal coming out of the board. 2) Monitor the terminal log in VS code when it is connected via USB and boots. Post what you see here as diagnostic. 3) Try a simple blinky sketch instead of the Nanostat code.

Please keep me posted, meanwhile I will work on some self test options.

-Peter

c-jw commented 9 months ago

Thanks for the quick response. I monitored on serial and got the following repeated over and over for as long as the device was plugged in to USB.

`ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 188777542, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:1184 load:0x40078000,len:13232 load:0x40080400,len:3028 entry 0x400805e4 Welcome to NanoStat, Firmware Rev. 0.1.2!

Brownout detector was triggered`

It looks like the firmware is flashed successfully, based on the Welcome to NanoStat message, but the ESP32 is shutting down on a power issue.

A quick google search revealed suggestions here to put capacitors between the 3.3V supply and ground. Based on my not-an-EE interpretation of the board design, though, these capacitors are already there (C7 and C11). I looked at the solder joints on C7 and C11 and they look fine. So I'm a bit stumped.

The stackexchange link I referenced also has a software solution to disable the brownout protection. I am going to try flashing the remaining 3 boards I ordered (I have flashed 2 of 5 already) before I try disabling the brownout protection.

I have not tried a blinky sketch yet. I will update after I do.

Thanks again.

c-jw commented 9 months ago

I should clarify that my inspection of a solder joint is absolutely not authoritative.

PeterJBurke commented 9 months ago

Sometimes the computer USB power supply is not strong enough. Try a different USB port on your computer or a cell phone usb charger. Another option is to power it with the two power pins and keep plugged in over USB to your computer, so the computer can monitor it and the external power pins are for more power.

PeterJBurke commented 9 months ago

I confirm I do not get the "Brownout" message with my NanoStat plugged into my USB port on my desktop. Any progress on your end c-jw?

c-jw commented 9 months ago

Thanks for checking in, and thank you for doing a test on your end. I have not resolved the issue yet. I made a minor modification to the main.cpp file, adding a LED blink to the setup function at line 3847 to help with troubleshooting. I have observed the following behavior in different situations.

  1. When plugged in to USB power from the computer USB power supply: The LED blinks, then the Welcome to Nanostat message over serial, then a brownout error over serial. This repeats indefinitely.
  2. When plugged in to a cell charger (a RaspberryPi power supply, actually) rated for 5V and 2.5A: Identical behavior from the blinking LED as no. 1, though no serial communication.
  3. With jumper wires directly to the battery/power pins from a 5V, 2.5A power supply: Identical behavior to no. 2.
  4. With jumper wires directly to the battery/power pins from a 5V, 2.5A power supply AND plugged in to the USB power supply: Identical to no. 1, confirmed with serial communication.

I'm not sure what to make of this except for a phantom hardware issue (bad component from the manufacturer, bad solder joint, etc.) I am going to do two things:

  1. Review (again) the substitutions I made for a couple components from your design. This will be a triple check that I didn't select something out of spec to replace an out-of-inventory component.
  2. Try modifying the code to ignore the brownout error, and cross my fingers that the dip in voltage is transient and doesn't break something else.

I hope to get to the bottom of this soon. I welcome any other ideas or feedback.

Thank you!

PeterJBurke commented 9 months ago

Sounds like a hardware error. If you have more than one made, try the others. Please keep me posted.

c-jw commented 9 months ago

Update on the brownout issue:

I got a real EE/hardware guy (unlike me) to take a look at the boards. He scoped the voltage at the power supply and at the input to the ESP32. Things look fine at 3.3V, so the behavior is still a bit of an anomaly.

I followed the recommendations at this link to disable the brownout detection on the ESP32. There is an argument to be made that this is foolhardy, and may expose the hardware to future damage if there is an actual power supply issue, but I'm giving it a run anyway. After making this change, all five boards have booted and run just fine. I have been able to set up wifi credentials and assign a fixed IP address to each one on the wifi network. I hope to be running an array of Nanostats in parallel soon!

Thanks for your help. I'll close this issue.

PeterJBurke commented 8 months ago

I just got a new batch and I also have the brownout issue. I will update the code to disable brownout detection. Thank you for the suggestion.