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.33k stars 179 forks source link

Display somehow not turning on #81

Closed Smutssch closed 2 months ago

Smutssch commented 4 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 4 months ago

Please share the terminal output.

Smutssch commented 4 months ago

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/dfrobot_firebeetle2_esp32e.html PLATFORM: Espressif 32 (6.4.0) > DFRobot Firebeetle 2 ESP32-E HARDWARE: ESP32 80MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:

Leaving... Hard resetting via RTS pin... ========================================================================================= [SUCCESS] Took 88.57 seconds ========================================================================================= Environment Status Duration


dfrobot_firebeetle2_esp32e SUCCESS 00:01:28.572 ========================================================================================= 1 succeeded in 00:01:28.572 =========================================================================================

Processing dfrobot_firebeetle2_esp32e (board: dfrobot_firebeetle2_esp32e; platform: espressif32 @ 6.4.0; framework: arduino)

lmarzen commented 4 months ago

I should have been more specific. Share the terminal monitor output. VSCode has an option on the bottom to view the usb terminal monitor. Click that, then press the reset button on the esp32. This output will help us debug your problem.

Smutssch commented 4 months ago

Now that I see this, it´s probably because of the API

--- Terminal on COM3 | 115200 8-N-1 --- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jul 29 2019 12:21:46

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: 4.03 Connecting to 'Koti'............................................................................... IP: 192.168.2.175 Waiting for SNTP synchronization.................. Sunday, February 11, 2024 09:34:26 Attempting HTTP Request: api.openweathermap.org/data/3.0/onecall?lat=51.227741&lon=6.773456&lang=de&units=standard&exclude=minutely&appid={API key} 401 Unauthorized 401 Unauthorized 401 Unauthorized Busy Timeout! _PowerOn : 10000227 Busy Timeout! _Update_Full : 10001114 Busy Timeout! _PowerOff : 10000111 Awake for 43.152s Deep-sleep for 1507s

lmarzen commented 4 months ago

So you have 2 issues. First, your API key is invalid "401" (this won't stop the display from working, but should result in the error message displaying on the screen). The second issue (which is why your display isn't displaying anything) is that your display may not be wired correctly. "Busy Timeout! _PowerOn : 10000227" Here is another person who had the same problem and suggested that the PWR pin may have been wired incorrectly, https://github.com/lmarzen/esp32-weather-epd/issues/80.

lmarzen commented 4 months ago

Also double check you have selected the correct driver board in config.h. I'm not sure which one you have, the despi or the waveshare hat.

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

define DRIVER_DESPI_C02

// #define DRIVER_WAVESHARE

lmarzen commented 4 months ago

Another thing to check is that your driver board has the switch(s) set correctly.

From the readme...

IMPORTANT: The Waveshare E-Paper Driver HAT has two physical switches that MUST be set correctly for the display to work.

  • Display Config: Set switch to position B.
  • Interface Config: Set switch to position 0.

IMPORTANT: The DESPI-C02 adapter has one physical switch that MUST be set correctly for the display to work.

  • RESE: Set switch to position 0.47.
Smutssch commented 4 months ago

Didn´t have the correct driver board selected, but now it just fails to connect to my wifi, although I did change the SSID and the password to my wifi. Also now it shows the battery voltage so I don´t think this has anything to do with the PWR pin(s). The driver board switches are set correctly aswell, so apart from the API key there is probably still another problem.

lmarzen commented 4 months ago

Sounds like we are making progress. Please share the new terminal monitor output.

Smutssch commented 4 months ago

Just realized it could still be the PWR pins, but they are placed correctly, although I had to cut off the adapter that goes into the board because the one that came with the battery was too big, and now the end of the cables look kinda broken, so I might just have to replace the whole battery. But anyway, here is the output:

--- Terminal on COM3 | 115200 8-N-1 --- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jul 29 2019 12:21:46

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: 4.06 Connecting to 'Koti'........................................................................................................................................................................................................ Could not connect to 'Koti' WiFi Connection Failed Busy Timeout! _PowerOn : 10000143 Busy Timeout! _Update_Full : 10000111 Busy Timeout! _PowerOff : 10000107 Failed to obtain time before deep-sleep, referencing older time. Awake for 45.987s Deep-sleep for 21564s

But even if the battery were to work now, it still doesn´t connect to my wifi

lmarzen commented 4 months ago

Hmm so it's still not displaying anything?

Looks like your wifi credentials are incorrect now.

The battery is optional. It should work fine just plugged in with usb. So that should be sufficient for testing.

Could you please attach a photo of your wiring and additionally copy the pin configuration for your config.cpp?

Smutssch commented 4 months ago

// PINS // ADC pin used to measure battery voltage const uint8_t PIN_BAT_ADC = A2; // A0 for micro-usb firebeetle // Pins for Waveshare e-paper Driver Board const uint8_t PIN_EPD_BUSY = 5; // 5 for micro-usb firebeetle const uint8_t PIN_EPD_CS = 2; 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 = 14; // 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

Bild_2024-02-11_101349071

bc1f3ede-caa8-4063-9188-1b1dffcab1b9

Btw the E-Paper is connected to the Driver HAT idk why the picture shows otherwise. I think its glitched

Smutssch commented 4 months ago

ADC pin was wrongly selected, just fixed it and it shows "Battery voltage: 0.00 Critically low battery voltage!"

lmarzen commented 4 months ago

Ah. Looks like you have a FireBeetle 2 ESP32-E no the FireBeetle ESP32 (non-E). The non-E version has a micro-usb connection, while the ESP32-E version has usb c.

Correct your busy line to

const uint8_t PIN_EPD_BUSY = 13; // 5 for micro-usb firebeetle
lmarzen commented 4 months ago

Your battery was set correctly originally as A2 since you have a firebeetle esp32-E usb-c.

const uint8_t PIN_BAT_ADC  = A2; // A0 for micro-usb firebeetle
Smutssch commented 4 months ago

Yep, just realized that aswell, changed them. Now the Wifi connects perfectly but there is another kind of problem with the battery aside from the API key, the display still doesn´t show anything:

--- Terminal on COM3 | 115200 8-N-1 --- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jul 29 2019 12:21:46

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: 4.09 Connecting to 'Koti'.................................................................................................................................................................. IP: 192.168.2.175 Waiting for SNTP synchronization.................................. Sunday, February 11, 2024 10:24:37 Attempting HTTP Request: api.openweathermap.org/data/3.0/onecall?lat=51.227741&lon=6.773456&lang=de&units=standard&exclude=minutely&appid={API key} 401 Unauthorized 401 Unauthorized 401 Unauthorized Busy Timeout! _PowerOn : 10001235 Busy Timeout! _Update_Full : 10001111 Busy Timeout! _PowerOff : 10001107 Awake for 51.833s Deep-sleep for 293s

But regardless if the battery works or not, the display should show an error if I am informed correctly, so there is something else wrong still.

lmarzen commented 4 months ago

I just spotted an issue with your wiring.

Your gnd is off by one. so are most the other pins.

It's late for me, but Ill follow up tomorrow if you are still having difficulties.

Smutssch commented 4 months ago

Just fixed the wiring, but the display still doesn´t show anything. I´ll try to fix it myself for now, thank you for your help.

Smutssch commented 4 months ago

Update: Got a new API key, first the wifi didn´t connect again, but now it does. Problem is, the new key is somehow unauthorized aswell. The display still shows nothing.

Smutssch commented 4 months ago

Update: Tried a few more times, now the wifi is just not connecting, the API key is wrong and something is still up with the battery.

Smutssch commented 4 months ago

Update: The red light which is normally on if connected via usb-c is off

Smutssch commented 4 months ago

Update: Wifi is connecting again, but API key is still wrong and I´m still getting a battery error, also the red light is off, but if the battery is disconnected, it starts blinking. Busy Timeout! _PowerOn : 10001235 Busy Timeout! _Update_Full : 10001110 Busy Timeout! _PowerOff : 10000107 Awake for 44.410s Deep-sleep for 835s

lmarzen commented 4 months ago

The red light indicates if the battery is being charged via usb. Once charged it will turn off.

Smutssch commented 4 months ago

Alright. So I ran it through again, everything except the API key seems to be fine, but the display is somehow still not showing an error, which it as far as I now, should. If this is just because the API key is wrong I´ll try to fix that first, although the terminal output for the battery is now this: _PowerOn : 22 _Update_Full : 2 _PowerOff : 2 I don´t know if it should be like this, or if this is just a other error.

lmarzen commented 4 months ago

Your wiring may still be wrong. If you send pictures again I can confirm the correctness. It will draw an error on the display if the API key is incorrect, so I wouldn't worry about the api key for now.

Smutssch commented 4 months ago

I got the API key to work, but now my BME is not found. I still want to investigate the problem with the display though, because now I don ´t know whether it is working or not, since it shoulnd´t be showing anything. Here´s the wiring though:

f87c8f52-50df-4c92-bcb9-cb27c0bde14c

lmarzen commented 4 months ago

The wiring of your display is looking correct from what I can tell.

Smutssch commented 4 months ago

Well then let´s solve the problem of the BME280 first, to see if it then works.

lmarzen commented 4 months ago

The display will still draw an error even if the BME is not found.

Smutssch commented 4 months ago

Oh, alright, well then there is still something wrong with the display.

lmarzen commented 4 months ago

Do you have the correct panel selected in config.h?

lmarzen commented 4 months ago

I'm running out of troubleshooting tips. Maybe your ribbon cable is not plugged in all the way?

Smutssch commented 4 months ago

The panel is selected correctly, and the ribbon cable is plugged in all the way. Although I think the ribbon cable might be broken because there is some wrinkles in there. In that case, I would have to buy a new E-paper.

Smutssch commented 4 months ago

Just saw this, I don´t know if that affects the performance of the e-paper, but if it does, we know the solution now. 35b43186-5b32-4f83-826e-981abc146827

lmarzen commented 4 months ago

Seems cosmetic only. A wrinkled cable isn't that unordinary. Cable is probably only a problem if it is cut/sliced.

lmarzen commented 4 months ago

You could try just connecting the driver board directly to the display without the extra ribbon cable in between.

lmarzen commented 4 months ago

You may have already checked this but Ill say it just incase, check that the ribbon cable is in the right orientation. i.e. that it is not flipped in a way that the connections are backwards.

Smutssch commented 4 months ago

I connected the driver board directly to the display, and it is oriented the right way, but now my wifi is not connecting again. I think the screen should show an error but it doesn´t show anything.

lmarzen commented 4 months ago

The wifi isn't working anymore? You didn't change the ssid or password?

Smutssch commented 4 months ago

No, I didn´t change anything in the code.

lmarzen commented 4 months ago

Can you share the output.

Smutssch commented 4 months ago

--- Terminal on COM3 | 115200 8-N-1 --- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jul 29 2019 12:21:46

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: 4.08 Connecting to 'Koti'........................................................................................................................................................................................................ Could not connect to 'Koti' WiFi Connection Failed Busy Timeout! _PowerOn : 10001143 Busy Timeout! _Update_Full : 10001111 Busy Timeout! _PowerOff : 10001107 Failed to obtain time before deep-sleep, referencing older time. Awake for 46.026s Deep-sleep for 21564s

lmarzen commented 4 months ago

Oh looks like the connection may have timed out.

You can try inceasing the timeout in config.cpp

const unsigned long WIFI_TIMEOUT = 10000; // ms, WiFi connection timeout.

Sometimes if you just flashed it the esp32 can be weird so if this is the first boot after a flash, hit the reboot button and see if that resolves it.

Smutssch commented 4 months ago

I set the timeout to 30000 now, and rebooted the esp, but still, it could not connect to my wifi.

lmarzen commented 4 months ago

Did it timeout?

Smutssch commented 4 months ago

Yes, should I increase it even further then?

lmarzen commented 4 months ago

Probably won't help. Are you far from your access point?

Smutssch commented 4 months ago

It´s just in the next room, so no.

Smutssch commented 4 months ago

Wifi connects again, somehow. But the display still isn´t showing anything and my BME is not found.

Battery voltage: 4.12 Connecting to 'Koti'.................................................... IP: 192.168.2.175 Waiting for SNTP synchronization.............................. Monday, February 12, 2024 20:54:30 Attempting HTTP Request: api.openweathermap.org/data/3.0/onecall?lat=51.261280&lon=6.677710&lang=de&units=standard&exclude=minutely&appid={API key} 200 OK Attempting HTTP Request: api.openweathermap.org/data/2.5/air_pollution/history?lat=51.261280&lon=6.677710&start=1707681273&end=1707767672&appid={API key} 200 OK Reading from BME280... BME not found _PowerOn : 22 _Update_Full : 2 _PowerOff : 2 Awake for 11.726s Deep-sleep for 214s

Smutssch commented 4 months ago

Never mind, the wifi again isn´t connecting. At this point it just seems random if it connects or not