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.34k 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

Oh and you got your API key working. What BME are you using? Check config.cpp, for the BME address variable. Assuming there is no problem with wiring, it should work unless the address is wrong. There are 2 possible values. see the comment

Smutssch commented 4 months ago

I´m using the BME280, I tried both 0x76 and 0x77 but it still doens´t find my BME

lmarzen commented 4 months ago

This is unusual for sure. It sounds like it could be a hardware-related issue given the symptoms. Let's try to elimate some variables. completely disconnect the BME and Battery. Power it from usb. See if that fixes the wifi or display issue. If wifi is still misbehaving, disconnect everything. If wifi is still misbehaving then there may be an issue with your esp32 or software configuration. You could try moving into the same room as your access point and see if that helps your wifi issue if you haven't already tried that.

lmarzen commented 4 months ago

Also, check that you are running the software you are running is the latest version from github, last commit: Jan 12, 2024.

Smutssch commented 4 months ago

I disconnected the battery and the BME, now the wifi works. The screen still doesn´t show anything though.

Smutssch commented 4 months ago

Just connected the BME again, now the wifi doesn´t work, so something is wrong with the BME

Smutssch commented 4 months ago

Alright, I don´t know how exactly but I got both the BME and the Wifi to work. But I am still getting errors:

Reading from BME280... Success Busy Timeout! _PowerOn : 10001246 Busy Timeout! _Update_Full : 10001115 Busy Timeout! _PowerOff : 10001107 Awake for 43.251s Deep-sleep for 1397s

lmarzen commented 4 months ago

Oh that's good progress! Im glad to see wifi is working and with the BME as well.

lmarzen commented 4 months ago

Do you have the waveshare hat r2.2 or r2.3?

Smutssch commented 4 months ago

I have the r2.3, but somehow the wifi is again not working. At this point it feels like it´s random whether it works or not.

lmarzen commented 4 months ago

This project was originally developed for and only officially supports the waveshare r2.2 hat and the DESPI-C02. Some people have gotten the r2.3 working with some modifications, but I can't assist much on that front since I don't have the r2.3 hat. I recommend buying the DESPI-C02, since it is also better for low-power.

lmarzen commented 4 months ago

I'm guessing however you have wired the r2.3 to the esp32 it is not playing well and may be drawing too much power or something that is causing your inconsistent wifi problems.

Smutssch commented 4 months ago

Alright, I will try to get a DESPI-C02, but do you know where I could buy one, because the only marketplace I see which sells this is AliExpress and I don´t really trust the shipping costs.

lmarzen commented 4 months ago

I'm not really sure where else they are sold.

For what it's worth, I've had no problems ordering from good-display off Aliexpress shipping to the US. Shipping costs from aliexpress are very low (for many countries) due to government subsidies. (https://www.shopify.com/blog/epacket-delivery-explained-everything-you-need-to-know-about-epacket-shipping#) Beware that shipping may be slow depending where you are located, so if you need it sooner you will of course need to pay extra.

lmarzen commented 4 months ago

If you are really set on getting the r2.3 hat working, it can be done. If you want to go down this path, search the other issues on this github project to find some workarounds.

Smutssch commented 4 months ago

Just one question, if I get a DESPI-C02, I don't need a new E-Ink aswell, because I can just disconnect the rev2.3 and connect the DESPI-C02 to it, is that correct?

lmarzen commented 4 months ago

that's correct

lmarzen commented 4 months ago

image

Looks like in the image you sent that your connector is not in all the way.

Smutssch commented 4 months ago

Oh yes, but putting it all the way in doesn´t fix the problem. I ordered the DESPI-CO2, it should arrive in a few days, I´ll keep you updated when it does.

Couchpotatoe93 commented 4 months ago

Same issue here …already have the DESPI -CO2…worked for 2 days with the pin-cables today I soldered it and nothing works :(

lmarzen commented 4 months ago

@Couchpotatoe93 Sorry to hear you're experiencing issues. It sounds like the wiring or soldering is the culprit since it stopped working after you soldered it. Double-check the connections and ensure everything is properly secured.

Smutssch commented 4 months ago

The DESPI-CO2 arrived, I put it all together changed the code and ran it, but my BME is not found. I checked the wiring and the code and it seems that everything is correct to my eyes, also the screen doesnt show anything.

Terminal Output:

Waiting for SNTP synchronization.. Tuesday, February 27, 2024 19:05:58 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=1708970761&end=1709057160&appid={API key} 200 OK Reading from BME280... BME not found Busy Timeout! _PowerOn : 10001261 Busy Timeout! _Update_Full : 10001103 Busy Timeout! _PowerOff : 10001111 Awake for 42.323s Deep-sleep for 95s

lmarzen commented 4 months ago

The Busy Timeout tells me that your wiring or pin configuration is incorrect.

To help me assist you please do the following.

  1. Check that your driver board is set correctly in config.h

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

    define DRIVER_DESPI_C02

    // #define DRIVER_WAVESHARE

  2. Share your PIN config from the top of config.cpp (copy and paste it here)

  3. Share a picture of your wiring.

Smutssch commented 4 months ago

The correct driver board is selected in config.h, here is the pin config: // 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 = 13; // 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

3b320ba0-598b-457a-8bd9-efdcfa5d14b0 4ce08e6d-42bb-448a-89f2-742c4c09f99f

Smutssch commented 4 months ago

I ran the whole thing a few times, rewired it, now the output changed:

Waiting for SNTP synchronization.............................. Wednesday, February 28, 2024 18:39:35 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=1709055578&end=1709141977&appid={API key} 200 OK Reading from BME280... BME not found _PowerOn : 7563003 _Update_Full : 2 _PowerOff : 1 Awake for 20.895s Deep-sleep for 81s

I don´t know if this means the problem with the power is solved, although I think I should have something displaying on the screen, which is not the case

lmarzen commented 4 months ago

Seems that you are using an older version of the config.cpp pins that are different from the current wiring diagram. Update your config.cpp as follows, (do not change your physical wiring)

// 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 = 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

\ \ \ Side note, in the future, enclose the code you share with three tickmarks like this...

code

This makes it much easier to read.

lmarzen commented 4 months ago

Also, I can't see your BME very well in the photo but judging by the positioning of the punch hole, it looks like you may have wired it in reverse?

Smutssch commented 4 months ago

The wiring on the BME was wrong, I rewired it now, but it is still not found in the output. Here´s a picture of the wiring, in case it´s still wrong: 86dd2c5c-f52d-4421-ac3c-ccf52b50fce4

Smutssch commented 4 months ago

Oh and I changed the pin configuration aswell

lmarzen commented 4 months ago

Does the screen work now? And can you share your output?

Smutssch commented 4 months ago

The screen doesn´t work, here is the output:

Waiting for SNTP synchronization............
Wednesday, February 28, 2024 19:32: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=1709058753&end=1709145152&appid={API key}
  200 OK
Reading from BME280... BME not found
_PowerOn : 21
_Update_Full : 2
_PowerOff : 2
Awake for 12.488s
Deep-sleep for 94s
lmarzen commented 4 months ago

Why are neither your BME nor screen working? This is very odd. Are you certain you uploaded the code to the controller (not just built it)?

Smutssch commented 4 months ago

Yes, I did it everytime I changed the code

lmarzen commented 4 months ago

Do all the solder joints look good?

I'm at a loss here. It may be worth doing a comparison/diff of your project with the unmodified project, to make sure nothing is different that is not supposed to be.

You could also inspect your cables to make sure none of them are damaged.

Smutssch commented 4 months ago

I uploaded the code a few times and somehow, the screen works! But the BME is not found and therefore the Temperature in the bottom right and the humidity is not being showed. 08fb635e-8d87-4c4d-b784-af5cc9c2e0ac

Waiting for SNTP synchronization.....................
Wednesday, February 28, 2024 20:02:20
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=1709060544&end=1709146943&appid={API key}
  200 OK
Reading from BME280... BME not found
Busy Timeout!
_PowerOn : 10001265
Busy Timeout!
_Update_Full : 10001115
Busy Timeout!
_PowerOff : 10001111
Awake for 46.014s
Deep-sleep for 74s
lmarzen commented 4 months ago

Okay great. This is a step in the right direction.

The timeout shouldn't be happening if it is successfully updating the screen, I wonder why this is.

Busy Timeout!
_PowerOn : 10001265
Busy Timeout!
_Update_Full : 10001115
Busy Timeout!
_PowerOff : 10001111

Maybe you have the wrong panel selected in config.h? Double check that you have the correct screen selected here.

// 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_BW_V2
// #define DISP_3C_B
// #define DISP_7C_F
// #define DISP_BW_V1
Smutssch commented 4 months ago

The panel is correctly selected, but the screen didn´t update until now, and the information on the screen hasn´t changed and now there is some sort of black line at the edges:

4f75aa67-d84a-4b30-9d68-a7cb11ee0c5f

Smutssch commented 4 months ago

Here is the terminal output, if it helps:

Waiting for SNTP synchronization.................................................
Wednesday, February 28, 2024 20:38:18
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=1709062702&end=1709149101&appid={API key}
  200 OK
Reading from BME280... BME not found
Busy Timeout!
_PowerOn : 10002267
Busy Timeout!
_Update_Full : 10002127
Busy Timeout!
_PowerOff : 10002119
Busy Timeout!
_PowerOff : 10002119
Awake for 55.419s
Deep-sleep for 125s
lmarzen commented 4 months ago

It could be a low-voltage issue? Is the switch on your despi set to 0.47?

Does the issue still exist if you disconnect the battery? Or if you disconnect the USB and run on only the battery?

Smutssch commented 4 months ago

The switch is set to 0.47, and when I disconnect the battery or the usb-c, nothing happens, it still doesnt refresh and has black lines at the edges.

Smutssch commented 4 months ago

Oh and I noticed the black "ink" on the display forming the letters etc. are fading away 1d76e82e-dc8e-4f1b-91ed-71c0b1fe0228

lmarzen commented 4 months ago

I would download a clean version of the project, with the latest updates and then leave all defaults and upload the code. It should draw a wifi error to the screen.

Smutssch commented 4 months ago

I downloaded a clean version, uploaded it and ran it, but the output always gives me something like this:

WiFi Connection Failed
_PowerOn : 22
_Update_Full : 994
_PowerOff : 2
Failed to syncronize time before deep-sleep, referencing older time.
Awake for 16.018s
Entering deep sleep for 21594s

The screen is still not drawing anything new

Smutssch commented 4 months ago

Or something like this:

WiFi Connection Failed
_PowerOn : 21
Busy Timeout!
_Update_Full : 10001111
Busy Timeout!
_PowerOff : 10001107
Failed to syncronize time before deep-sleep, referencing older time.
Awake for 36.013s
Entering deep sleep for 21574s
lmarzen commented 4 months ago

I'm stumped. I would expect the screen to be updated with the wifi error, but it still indicates busy timeout.

lmarzen commented 4 months ago

Outputs like....

_PowerOn : 21
Busy Timeout!
_Update_Full : 10001111
Busy Timeout!
_PowerOff : 10001107

typically indicate bad wiring or misconfigured pins.

Smutssch commented 4 months ago

I just disconnected everything from the ESP, and it´s still giving me this:

Network Not Available
_PowerOn : 22
Busy Timeout!
_Update_Full : 10000151
_PowerOff : 4710997
Failed to syncronize time before deep-sleep, referencing older time.
Awake for 30.619s
Entering deep sleep for 21580s

So maybe that is an indicator that something is wrong with the board?

lmarzen commented 4 months ago

That's the expected output when nothing is connected.

lmarzen commented 4 months ago

I bumped the versions of all dependencies to the latest versions. Maybe there was some incompatibility with the specific version of a dependency you had. Try updating the project and try again. Honestly I'm not convinced this will fix your issue, but it may be worth a try.

Smutssch commented 4 months ago

Didn´t fix it, and somehow I got errors while uploading the code:

src/display_utils.cpp: In function 'uint32_t readBatteryVoltage()':
Compiling .pio\build\dfrobot_firebeetle2_esp32e\lib849\GxEPD2\epd3c\GxEPD2_266c.cpp.o
src/display_utils.cpp:45:23: warning: variable 'val_type' set but not used [-Wunused-but-set-variable]
   esp_adc_cal_value_t val_type;

and then this:

C:/Users/user64398/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c: In function 'uartSetPins':
C:/Users/user64398/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:153:9: warning: 'return' with no value, in function returning non-void
         return;
         ^~~~~~
C:/Users/user64398/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:149:6: note: declared here
 bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin)

It also signals me a problem in display_utils.cpp line 45:

variable 'val_type' set but not used [-Wunused-but-set-variable]

Although I don´t know if these are influencing the project, I´m just concerend they are.