0 votes
by (2.9k points)
edited by
Hi,

What event will wake-up the device after going to deep sleep in the example "esp8266-weather-station-color.ino"?

I tried a setting to go to sleep after a minute, but once in sleep mode, touching the screen does not wake-up the system.

Update:

It looks like after ESP puts the whole system to deep sleep,  then TFT device' TOUCH_IRQ output (that suppose to wake-up back ESP processor on next touch) does not change to low level anymore.

Since I just wanted after 10 min to turn the screen with its LED back light OFF and then ON on next touch, instead of sleep I used the low level' screen commands + toggle LED pin. This way, the system still runs and it is up to date even while the screen is off:

      tft.writecommand(ILI9341_DISPOFF); // instead of ESP.deepSleep(0,  WAKE_RF_DEFAULT);
      digitalWrite(TFT_LED, LOW); // turn off the back light

Then for screen back ON:

       tft.writecommand(ILI9341_DISPON);
       delay(200);
       digitalWrite(TFT_LED, HIGH);
       screen = 0;

Of course, you need to find your desired spot to add the ON (wakeup screen) code :)  I used an extra condition if (p.y > 250) in the touching processing section

if (touchController.isTouched(500)) {  ....

Thank you

2 Answers

0 votes
by (550 points)
Thanks for posting Lorol Good to know about the power saving!!
by (240 points)
edited by
Hi Lorol,

The only issue I'm having is that the iSTouched test always evaluates to true after shutting off the LED and turning the display off. I ended up using the routine that tests for the lower region p.y < 80 and that works but I wanted to simply test if the screen was touched. I looked at the touchscreen driver cpp code and the isTouched seems to have a pressure (z) value returned so that is likely why I can't wake on isTouched only.


Anyhow, it's working nicely other than that. The screen sleeps until touching the lower spot. Very cool project.

Thanks,

Catfish
0 votes
by (260 points)
thanks lorol ...tried this patch and everything works except that when waking up, the display shows for a very short time and then going to sleep again regardless of the SLEEP_INTERVAL_SECS set in config.h - tried to re-initialize this variable in wakeup but this dont work either ...
by (2.9k points)
My latest sketch with workaround solution is here:
https://github.com/lorol/esp8266-weather-station-color/blob/master/esp8266-weather-station-color.ino
At least it works stable for me.
by (260 points)
thanks - I already tried compiling your complete fork master. dont know whats wrong  - it compiles without error  but when running it, I get all icons with question mark. The serial monitor says:
PIFFS opened:
[HTTP] GET...
[HTTP] GET... code: -1
...
by (2.9k points)
edited by
I forgot to tell you that I introduced night icons processing, but the dependency code is in different place. So you need to use this library fork with uncommented
#define NIGHTICONS in WundergroundConditions.h and  WundergroundForecast.h

https://github.com/lorol/esp8266-weather-station/commits/master
by (260 points)
checked and manually edited all 4 files and uncommented the NIGHTICONS define  -  but still the same problem.  Have to check the fork zip-download (this should contain all the libs right? so why the changes were not there?) Maybe i`d better wait for a possible update ...
by (2.9k points)
edited by
Probably your Arduino IDE still takes the original lib, not the modified one. You cannot have same library twice in libraries.

The reason of my library mod's is shown here:
https://github.com/squix78/esp8266-weather-station-color/issues/39

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...