lmarzen / esp32-weather-epd

A low-power E-Paper weather display powered by an ESP32 microcontroller. Utilizes the OpenWeatherMap API.
GNU General Public License v3.0
2.5k stars 196 forks source link

Display somehow not turning on #81

Closed Smutssch closed 5 months ago

Smutssch commented 7 months ago

So i recreated the project exactly the same way built here, but after i upload the code the display doesnt show anything, and when I unplug the USB cable the red light goes out (ig thats normal) but there is no green light I expected there to be, because the picture of the running project showed a green light. I´m really new to hardware stuff like this and It could just be something really dumb, but still I would appreciate it a lot if you helped me out here. I´m doing this as a project for school and don´t really want it to fail.

lmarzen commented 7 months ago

All those are just warnings. Your code should still upload fine, most of them are from dependencies.

Smutssch commented 7 months ago

Alright, but my screen is still not displaying anything, the output gives me this:

Could not connect to 'ssid'
Network Not Available
_PowerOn : 22
_Update_Full : 2
_PowerOff : 2
Failed to syncronize time before deep-sleep, referencing older time.
Awake for 15.957s
Entering deep sleep for 21594s
lmarzen commented 7 months ago

Hmmmm. What have we not tried yet? I'm at a complete loss. It updated successfully one time, but not again. This is so unusual. Are you certain the wires and solder joints and connectors are all making good contact to the display? I'm running the same hardware with the same pinouts and not having any problem like this.

Smutssch commented 7 months ago

Everything looks good, nothing seems like it´s damaged or wrongly connected, although i didn´t solder the connector to the board, but that obviously can´t be the problem. Everything still connects like it should. Except there is some kind of marks on the connector for the display, although they are minor, could still be causing the problem: c2558909-6834-4010-81eb-e82c37733ab2

lmarzen commented 7 months ago

Hmm, looks alright to me. :/

Smutssch commented 7 months ago

Can you send your output so I can compare it to mine, maybe we´ll make progress that way

lmarzen commented 7 months ago

This is the output from the unmodified latest version of the project, without any options in config changed. The display shows a wifi icon and the message 'Network Not Available'. Note that _Update_Full : 4071997 means that it took the display approximately 4 seconds to update, this is the expected duration, give or take a little bit.

Battery voltage: 4188mv
Connecting to 'ssid'........................................................................................................................................................................................................
Could not connect to 'ssid'
Network Not Available
_PowerOn : 142997
_Update_Full : 4071997
_PowerOff : 39997
Failed to syncronize time before deep-sleep, referencing older time.
Awake for 20.201s
Entering deep sleep for 21590s
Smutssch commented 7 months ago

Well yeah, it is completely the same as mine. I am really clueless what to do here. I mean, judging by the code I can´t really imagine anything else than maybe that the display is broken or something. But the code would probably show an error of some sort if that would be the case, wouldn´t it?

Smutssch commented 7 months ago

I mean for me it says

_PowerOn : 22
_Update_Full : 2
_PowerOff : 2

but that is probably not like a problem or something, the screen should still draw something

lmarzen commented 7 months ago

From my experience small numbers like that or busy timeout both have to do with wiring, pin configuration, or a bad initialization function.

Smutssch commented 6 months ago

I tried debugging the program, this is the output, maybe it helps:

adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: unable to find a matching CMSIS-DAP device

.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: Success.
Couchpotatoe93 commented 6 months ago

I bought a new ESP32, Works now :) i dont know What was wrong, did all the same (wiring and program) 💁🏻‍♂️

lmarzen commented 6 months ago

I tried debugging the program, this is the output, maybe it helps:

adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: unable to find a matching CMSIS-DAP device

.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: Success.

Are you trying to use a hardware debugger?

Smutssch commented 6 months ago

Well, I´m using the PIO debugger, I dont know if that is the hardware one.

lmarzen commented 6 months ago

You need to use a hardware debugger like a jtag to provide "a means to halt the processor's operation, inspect the contents of registers and memory, and control the execution of code step by step." https://www.jtag.com/jtag-hw-debugger/

donwade commented 6 months ago

I had a similar problem with my board "not powering up". However when I switched back to using a rasp pi (using different software) everything worked fine.

I'm offering my findings to be used at your own risk, I could be wrong.

YOUR wiring diagram to the waveshare pi hat may be wrong.

I've looked at the schematics for that hat and there are some electronics on it (didn't expect that).

On the waveshare board v2, the grey wire (aka pin 1 on the schematics) expects to have a raw incoming voltage on it. That pin runs off to the INPUT of a onboard voltage regulator.

The output of that regulator is a nice 3.3V output that provides the regulated power to EVERYTHING else.

From what I can tell from your wiring diagram the grey wire goes to D3/26 on the ESP32. That means at best you can provide is 3.3V from a cpu pin to before-mentioned regulator that tries to create/regulate 3.3V. BUT The regulator may not work well if the ESP pin provides less than 3.3v. The regulator says "too bad, input too low ...can't regulate DOWNWARDS to make designed output" and your no going to get anywhere. The hat effectively shuts down.

The grey wire is actually expecting to be wired to a place that provides a solid voltage source.

I moved the grey wire onto 5V rail to give the regulator something to regulate to 3.3V and voila, my board powered up ... no more 'wait for busy" stuff.

But I know you were trying to put the board into "low power mode" using that D3/26 pin. That is not how to put the board into low power. The hat onboard regulator (apart from expecting raw voltage in and regulated voltage out) does provide a power down sleep pin and is EXPORTED out on the RED wire. Tying the RED wire to D3/26 where the grey wire used to go to now provides proper low power shutdown as it was designed. If the RED wire has a positive voltage on it, the regulator is brought out of deep sleep and the HAT has power.

For those of you who are dumb enough like me to look at the hat schematic, they mis named the name for the incoming raw voltage. They call it VIN_INT. It should have been called VIN_EXT to indicate the voltage is coming in and wants an EXTernal source and the regulated side should have been labeled VIN_INT to indicate regulated voltage supplies the INTernal parts. :) My head hurts now. Hope this helps. Use at your own risk

Glowamg commented 5 months ago

Hello. I have a similar problem. I have FireBeetle 2 ESP32-E. GDEY075Z08 screen and DESPI-C02 controller. I did the configuration. Upload is progressing correctly. However, the screen does not turn on. Serial monitor shows that the controller keeps restarting.

Rebooting... ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, 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

Over and over again

donwade commented 5 months ago

doesn't look like your even booting correctly if that's all you see. Blinky works fine right? Just guessing.

lmarzen commented 5 months ago

It could be an issue with your wiring. I would disconnect everything except the usb connector and if this is still happening then it may be a software issue.

Glowamg commented 5 months ago

Yes, that's all I can see. Blinky? - what do you mean? I am sending photos of the wiring. IMG_20240418_200324 IMG_20240418_200334 IMG_20240418_200341 IMG_20240418_200352

lmarzen commented 5 months ago

Check the polarity of your battery. You may need to swap the leads in the connector.

Glowamg commented 5 months ago

The battery polarity is ok. Thanks to your suggestions, I discovered that I didn't have any software loaded at all. And I did everything again and I made it. But I have an API problem

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, 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 Battery voltage: 4204mv Connecting to 'MG24'..... IP: 192.168.0.109 Waiting for SNTP synchronization....................... Friday, April 19, 2024 09:43:10 Attempting HTTP request: api.openweathermap.org/data/2.5/onecall?lat=40.7128&lon=-74.0060&lang=en&units=standard&exclude=minutely&appid={API key} 401 Unauthorized 401 Unauthorized 401 Unauthorized

lmarzen commented 5 months ago

That means that means your API key is invalid. If you just created it you may need to wait several hours before it will start working, otherwise double check that you copied it correctly to config.cpp

donwade commented 5 months ago
Glowamg commented 5 months ago

I waited. My key is already 3 days old. I turned on the paid subscription. I set version 3.0. I get this result and nothing else.

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, 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 Battery voltage: 4174mv Connecting to 'MG24'.... IP: 192.168.0.109 Waiting for SNTP synchronization.......................... Sunday, April 21, 2024 10:33:48 Attempting HTTP request: https://api.openweathermap.org/data/3.0/onecall?lat=50.26&lon=19.15&lang=en&units=standard&exclude=minutely&appid={API key} [ 3470][E][WiFiGeneric.cpp:1582] hostByName(): DNS Failed for https://api.openweathermap.org -1 Connection Refused [ 3485][E][WiFiGeneric.cpp:1582] hostByName(): DNS Failed for https://api.openweathermap.org -1 Connection Refused [ 3494][E][WiFiGeneric.cpp:1582] hostByName(): DNS Failed for https://api.openweathermap.org -1 Connection Refused Busy Timeout! _PowerOn : 20000254 Busy Timeout! _Update_Full : 20000163 Busy Timeout! _PowerOff : 20000131 Busy Timeout! _PowerOff : 20000131 Awake for 84.509s Entering deep sleep for 1500s

I'm doing something wrong but the code is probably ok? (API code and password are examples)

// WIFI const char WIFI_SSID = "MG24"; const char WIFI_PASSWORD = "1132345"; const unsigned long WIFI_TIMEOUT = 10000; // ms, WiFi connection timeout.

// OPENWEATHERMAP API // OpenWeatherMap API key, https://openweathermap.org/ const "****"; const String OWM_ENDPOINT = "https://api.openweathermap.org";

lmarzen commented 5 months ago

No need to share your API key, you should keep that secret and consider changing it now that it's been leaked.

So, it appears there are two issues going on. 1 a dns failure. 2 a possible wiring issue for the display. Make sure the hardware you are using is correctly selected in config.h. I'll look more into the dns failure.

donwade commented 5 months ago

First thing I'd try is execute https://api.openweathermap.org/data/3.0/onecall?lat=50.26&lon=19.15&lang=en&units=standard&exclude=minutely&appid=YOURKEY FROM a simple browser. You should get a bunch of weather text in your browser screen.
1) if successful, it indicates the problem in your project. 2) not successful?
a) try a ping https://api.openweathermap.org from a command window. if the ping fails your router is messed up or your being blocked by your ISP. b) if you got an error 4XX. you made it to openweathermap and they are rejecting it. 3) possible that two devices on your network are using the same IP address? Try rebooting your router.

donwade commented 5 months ago

https://api.openweathermap.org/ does not exist https://openweathermap.org/ does.

ping openweathermap.org PING openweathermap.org (148.251.136.139) 56(84) bytes of data. 64 bytes from static.139.136.251.148.clients.your-server.de (148.251.136.139): icmp_seq=1 ttl=54 time=181 ms

Glowamg commented 5 months ago

The screen does not turn on. Nothing is happening to him. I thought that unless all paths of the program were followed, it would not run. I checked the cabling and it seems to be ok.

const uint8_t PIN_BAT_ADC = A2; // A0 for micro-usb firebeetle // Pins for E-Paper Driver Board const uint8_t PIN_EPD_BUSY = 14; // 5 for micro-usb firebeetle const uint8_t PIN_EPD_CS = 13; const uint8_t PIN_EPD_RST = 21; const uint8_t PIN_EPD_DC = 22; const uint8_t PIN_EPD_SCK = 18; const uint8_t PIN_EPD_MISO = 19; // 19 Master-In Slave-Out not used, as no data from display const uint8_t PIN_EPD_MOSI = 23; const uint8_t PIN_EPD_PWR = 26; // Irrelevant if directly connected to 3.3V // I2C Pins used for BME280 const uint8_t PIN_BME_SDA = 17; const uint8_t PIN_BME_SCL = 16; const uint8_t PIN_BME_PWR = 4; // Irrelevant if directly connected to 3.3V const uint8_t BME_ADDRESS = 0x76; // If sensor does not work, try 0x77

// E-PAPER PANEL // This project supports the following E-Paper panels: // DISP_BW_V2 - 7.5in e-Paper (v2) 800x480px Black/White // DISP_3C_B - 7.5in e-Paper (B) 800x480px Red/Black/White // DISP_7C_F - 7.3in ACeP e-Paper (F) 800x480px 7-Color // DISP_BW_V1 - 7.5in e-Paper (v1) 640x384px Black/White // Uncomment the macro that identifies your physical panel.

define DISP_3C_B

// #define DISP_3C_B // #define DISP_7C_F // #define DISP_BW_V1

// E-PAPER DRIVER BOARD // Uncomment the macro that identifies your driver board hardware.

define DRIVER_DESPI_C02

// #define DRIVER_WAVESHARE

// 3 COLOR E-INK ACCENT COLOR // Defines the 3rd color to be used when a 3+ color display is selected.

if defined(DISP_3C_B) || defined(DISP_7C_F)

// #define ACCENT_COLOR GxEPD_BLACK

define ACCENT_COLOR GxEPD_RED

// #define ACCENT_COLOR GxEPD_GREEN // #define ACCENT_COLOR GxEPD_BLUE // #define ACCENT_COLOR GxEPD_YELLOW // #define ACCENT_COLOR GxEPD_ORANGE

endif

I have DESPI-C02 and 3 colors GDEY075Z08

I've check from frowser https://api.openweathermap.org/data/3.0/onecall?lat=50.26&lon=19.15&lang=en&units=standard&exclude=minutely&appid=MYKEY It works when it gets a whole page of weather data. So there's a problem with my project?

Check PING Pinging eu.api.openweathermap.org [82.196.7.246] with 32 bytes of data: Reply from 82.196.7.246: bytes=32 time=35ms TTL=54 Reply from 82.196.7.246: bytes=32 time=34ms TTL=54 Reply from 82.196.7.246: bytes=32 time=34ms TTL=54 Reply from 82.196.7.246: bytes=32 time=35ms TTL=54

Ping statistics for 82.196.7.246: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 34ms, Maximum = 35ms, Average = 34ms

Pinging openweathermap.org [148.251.136.139] with 32 bytes of data: Reply from 148.251.136.139: bytes=32 time=31ms TTL=55 Reply from 148.251.136.139: bytes=32 time=31ms TTL=55 Reply from 148.251.136.139: bytes=32 time=31ms TTL=55 Reply from 148.251.136.139: bytes=32 time=32ms TTL=55

Ping statistics for 148.251.136.139: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 31ms, Maximum = 32ms, Average = 31ms

lmarzen commented 5 months ago

Your wiring and configuration look correct, except for the battery polarity, the red wire (conventionally +) and black wire (conventionally -) are plugged in reversed to the esp32. You said you checked the polarity before, but I just wanted to clarify my point and double-check.

donwade commented 5 months ago

Given Imarzen's comment is double checked.... Do you have access to an oscilloscope? I blew off 2 months of my life (that I'll never get back) chasing down DISP_3C_B board problem.

Glowamg commented 5 months ago

Yes, the polarity of the battery is correct because I have a second connector on the cable to which I connect the battery and the cables on it are reversed. But it's properly connected to the battery. I have a small DIY oscilloscope. But I'm not an expert in using it. So I can assume that I need to buy a DISP_BW_V2 screen

IMG_20240422_090520 IMG_20240422_090534 IMG_20240422_090511

Glowamg commented 5 months ago

I read all the threads again and discovered that the screen works when the 3.3V power supply is changed from pin 26 to pin 3v3. IMG_20240422_092418 But the API still doesn't work

donwade commented 5 months ago

You said that when you cut and paste the api call into a browser you do get a good web response. Locate the line in the code where it prints the command to the terminal, but hides the apikey from being printed.

Change the code to actually print the api key. (I promise I won't look LOL).

Cut and paste that http text from the monitor and paste that into a browser and see if that works.

I'd hate to see a syntax error on the http line where the key was missing one char or was mistyped, or the syntax elsewhere in the line was wrong.

Glowamg commented 5 months ago

Success. I managed to do it. I uninstalled VSCode completely. Then I installed everything again. I uploaded it and it worked. Thank you very much for your help! IMG_20240422_194751

lmarzen commented 5 months ago

Glad to hear you got it working!