ThingPulse / esp8266-weather-station-color

ESP8266 Weather Station in Color using ILI9341 TFT 240x320 display
https://thingpulse.com/product/esp8266-wifi-color-display-kit-2-4/
MIT License
562 stars 221 forks source link

Info screens go too fast #22

Closed Trecoolius closed 5 years ago

Trecoolius commented 7 years ago

Got it working, but it seems the script is not retrieving the info from wunderground, since the weather shows 0°C and the screens cycle super fast. API key was set and manual requests from my browser display all the info needed (eg http://api.wunderground.com/api/MY API KEY/conditions/q/USA/NEW_YORK.json).

squix78 commented 7 years ago

Please try to replace USA with NY: http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/NY/NEW_YORK.json When I tried the call with USA then I got a list of possible candidate locations...

2017-07-10 16:10 GMT+02:00 Trecoolius notifications@github.com:

Got it working, but it seems the script is not retrieving the info from wunderground, since the weather shows 0°C and the screens cycle super fast. API key was set and manual requests from my browser display all the info needed (eg http://api.wunderground.com/api/MY API KEY/conditions/q/USA/NEW_YORK.json).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/squix78/esp8266-weather-station-color/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/AArwFkUgtRirS-rGfQLuY60I5Ukirp8mks5sMjDrgaJpZM4OS5dS .

G6EJD commented 7 years ago

One day WU will publish details of their API's including allowed values, I asked them if they would do this, but they said the current supplied documentation is adequate. For example I discovered their systems sometimes report wind direction as WEST when other days it usually reports 'W' only, there's an example where API values like County and City values are needed.

Trecoolius commented 7 years ago

Awesome, works now, but the screen go by too fast. Is there any setting I can change to make them go slower?

squix78 commented 7 years ago

Are they moving automatically? They actually should not move at all until you press the touch screen, assuming that you have a display module with a touch screen (e.g. from my ESP8266 Wifi Color Display Kit https://blog.squix.org/product/esp8266-wifi-color-display-kit-2-4). If you are talking about the forecast slider on the first screen you can control this by calling carousel.setTimePerFrame(time)

2017-07-10 20:13 GMT+02:00 Trecoolius notifications@github.com:

Awesome, works now, but the screen go by too fast. Is there any setting I can change to make them go slower?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/squix78/esp8266-weather-station-color/issues/22#issuecomment-314189421, or mute the thread https://github.com/notifications/unsubscribe-auth/AArwFjYHzRZzBLyaTSK4qpC_jowyjPMvks5sMmnBgaJpZM4OS5dS .

Trecoolius commented 7 years ago

It's not the starting slider, it's everything :(

squix78 commented 7 years ago

What display are you using? Does it have touch screen? If not I recommend to comment the line "screen = (screen + 1) % screenCount;" Then you can't switch from frame to frame but you can always add a button or so

2017-07-10 20:47 GMT+02:00 Trecoolius notifications@github.com:

It's not the starting slider, it's everything :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/squix78/esp8266-weather-station-color/issues/22#issuecomment-314199039, or mute the thread https://github.com/notifications/unsubscribe-auth/AArwFsa4LwLqVclB7ETXcK6stBUP35Mnks5sMnG0gaJpZM4OS5dS .

Trecoolius commented 7 years ago

I'm using this one.

squix78 commented 7 years ago

I have one like that but have not tried it with the touch interface...

2017-07-10 21:16 GMT+02:00 Trecoolius notifications@github.com:

I'm using this one http://www.ebay.com/itm/2-8-TFT-LCD-Display-Touch-Panel-SPI-Serial-240-320-ILI9341-5V-3-3V-STM32/201950756171 .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/squix78/esp8266-weather-station-color/issues/22#issuecomment-314206589, or mute the thread https://github.com/notifications/unsubscribe-auth/AArwFuXMMBBsWAKEuMC05lfR3NRwkAbzks5sMnh7gaJpZM4OS5dS .

vididuc commented 7 years ago

Hi all

I'm also seeing the same issue on my display. I have this display [https://learn.adafruit.com/wifi-weather-station-with-tft-display/overview].

Regards, Marcos

vadpol commented 7 years ago

I report the same issue, I have a 2,8" TFT LCD SPI 240*320 ILI9341 display with XPT2046 Touch Screen chip. After flashing of the code and connection to WiFi all 5 screens start automatic rapid scrolling one after another in majority cases also after reset button is pressed. However in a very seldom case one of the random screens stops, but automatic scrolling starts again as soon as screen is touched. I found that when scrolling happens the blue LED on the module is blinking very fast, when screen is stable the LED is off and it goes bright while screen is touched, doesn't matter stable or scrolling screens are present at the moment.

squix78 commented 7 years ago

Thank you all for your feedback. Are you sure that the 2.8" display uses a XPT2046 touch screen chip? It sounds like that the described behavior occurs, when the touch driver has not been detected properly and they isTouched method always returns true. This should be certainly fixed on the software side. To actually solve your problem I would like to hear from you if it might be possible that the 2.8" display uses a different driver chip

vididuc commented 7 years ago

Hello

In my case you are right. The controller of my touch unit is a STMPE610 have a look at page 14 in this doc.

Thanks a lot for the hint.

Regards, Marcos

vadpol commented 7 years ago

In my case it is XPT2046 img_0427

vididuc commented 7 years ago

Hello I managed to get my display/touch starting working the expected way. I downloaded and intslled the Adafruit lib. I modified the code to disable the lib for the XPT2046 and replaced parts of the code to use the Adafruit lib. Currently the pages swap only after a touch on the screen. Switching from 24h to 12h display is not working as the code is not able yet to detect where the user touched the screen. I will try to get this issue also solved. I will also try to get the display switched off after a couple of seconds and switch it on at the first screen touch. I still do not understand why the red led is blinking all the time, any hint on this?

Bye Marcos

vadpol commented 7 years ago

It seems that I've found the possible reason of the screen scrolling with XPT2046. As to me it happens just because the onboard +3,3v regualator on D1 Mini ESP module is not enough to power everything in this setup especially LED backlight of the display. It works at the edge of its capacity I believe and some of the XPT chips might be very sensitive to voltage fluctuations. I disconnected an LED pin of the display from GPIO and connected to +3,3v pin at D1 Mini module via 100 Ohm resistor first. It doesn't help a lot as the regulator was still loaded. Then I connected LED pin via the same resistor to +5V pin at D1, so directly to USB input power. And screen scrolling has stopped! Everything works now how it meant to work! If I touch the screen it goes to next one, if not - it shows the current screen with refreshed from time to time info. Hope that this might be the reason, interesting to know from others whether it helps as well.

scropion86 commented 6 years ago

@vadpol can you share the modified Lib which working for you , so we can test it . i have identical LCD screen and same issue of touch problem.

vadpol commented 6 years ago

Hi,

I didn't change any lib, the thing worked for me is just re-connection of the display's backlight LED pin to +5V power (USB) via 100 Ohm resistor. This allowed to take out a part of the load from 3,3V regulator at D1 Mini board and thus influented XPT somehow. I still have no idea why it is so, but it worked for me. I have made some improvements of this schematics later on, you may find my the latest developments under the Screen brightness issue up here.

scropion86 commented 6 years ago

the problem still not solved for me with the above solution that @vadpol purposed i even try to provide a 3.3V from other source and share the ground to take out the entire load from the USB. any other work around??

vadpol commented 6 years ago

I also tried to put 1000,0 x 6,3V and 0,1uF capacitors at both power lines (+3,3V and +5V) thinking that it might be some LF and/or HF distortions, however no result as well. By the way I never saw a calibration screen appeared and prompt to switch in between 12H /24H and METRIC/IMPERIAL modes. Trying of the separate touch screen test examples also didn't work. So my conclusion at the moment is that some batches of XPT2046 are not good enough or even fake indeed and this is a pure hardware issue. Different XPT2046 chips behave differently, there is no system in it...

scropion86 commented 6 years ago

@vadpol i so sad to say that i already found the problem , there was a small crack on the touch glass that's make problem. i figured it out by trying a sketch for touch painting which automatically fill the screen line by line.. the crack was on the corner small unseen and later it spread diagonally enough see it

check you screen for crack 😢

vadpol commented 6 years ago

Well, how did you fix it then? I think it is not an easy thing....

scropion86 commented 6 years ago

no way i just saved my time and ordered a new screen with less headache i ordered nextion screen 2.8" they have a good enough IDE to design the GUI here More about

kiwipaulrob commented 6 years ago

I was tearing my hair out trying to get my display to work when I found out that I had a display with no touch sensor. See photos. I ordered another that is identical except it has the resistive touch sensor in place. See the extra connector on the left.

https://photos.app.goo.gl/CHiLMIcjrS65UYXm1

njordan77 commented 6 years ago

Hi Daniel, was this issue discussed any further. I have several 2,4/2.,8/3,2 inch TFT touch displays with the named chip (fake?) but non of them works with touch.

In my case strange, when first starting i shortly could see a calibration screen which immediately started to switch like with others every 2-3 seconds.... After clearing the flash and reinstallation of the same code without any adaptation i now have the strange situation that no calibration request (even if it did not work) and also no rotation. Now the main screen is kept, only the 12/24 hour clock switches every 2-3 seconds. Touch of course does not react. Wiring is the same as your plane wiring scheme. Any further digging into this issue? Any idea why a full flush of flash does not bring the same starting situation with calibration request? (if full flash is cleared).

Many Thanks, Norbert

mcouture87 commented 6 years ago

I have the TFT FeatherWing from AdaFruit 2.4" touchscreen and I got the same issues. First boot, got the calibration screen, then it started to flip through all the screens very quickly. On all future boots, I never get the calibration screen anymore but all screens flip by very quickly.

rberkelm commented 6 years ago

Has there been any progress on resolving this issue? I bought my new weather station kit from the Squix online shop just before Xmas, complete with 2.4" TFT screen. Worked beautifully for the first few days. Then, after a reboot, the screens keep flipping by very quickly. Touching the screen does not help. Reboots don't help. Would dearly like to find a solution.

lorol commented 6 years ago

This mostly is caused by 2 things

You can try another screen if you have, you can try cxandy's clone of the project - it has a button replacement of the touch, also you can see above comments for power cranking workarounds.

rberkelm commented 6 years ago

Thanks lorol. Looks like a faulty screen for me as I'm powering from a 2A supply and have tried other power options. I've ordered another screen but might try the button option as well. I've tried slowing down the screens with delays and it works, but the clock updates don't happen as they should. Now I know what the "remainingTimeBudget" line and comment is about!

squix78 commented 6 years ago

Hi All. Sorry for being absent from this thread for such a long time. I'd love to find a solution to these problems but I don't have a setup to analyze these issues. If one of you could send me their screen I might be help. But without it it's just educated guessing

squix78 commented 6 years ago

Has anyone of you tried with a different library? These guy here says his white screen problem disappears when using the adafruit library: http://discuss.tindie.com/t/pinout-on-esp8266-display-kit/23871/3

rberkelm commented 6 years ago

Hi Dani, I'll send you mine if you like. It came from your online store, so you might be interested in getting this one sorted. Since you have done such an amazing job on this project I'm happy to cover the freight. Can you give me your postal details? Ray

On 21 January 2018 at 16:22, Daniel Eichhorn notifications@github.com wrote:

Hi All. Sorry for being absent from this thread for such a long time. I'd love to find a solution to these problems but I don't have a setup to analyze these issues. If one of you could send me their screen I might be help. But without it it's just educated guessing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/squix78/esp8266-weather-station-color/issues/22#issuecomment-359227088, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad5HvSovFra2XmwvOI23EAXvKu_Z0VkVks5tMtebgaJpZM4OS5dS .

rberkelm commented 6 years ago

I'm still not making progress with issue. I soldered a 1000uF capacitor onto the TFT VCC and GND pins thinking that perhaps the regulator on the Wemos board might be a bit borderline. No luck! Today I received a new 2.4" TFT screen and wired it up to my ESP dev board. It has the same issue with the fast-moving screen. It has a touch controller IC with HR2046 written on it. I've tried some Different libraries incl the Adafruit STMPE610, and Bodmer's TFT_Touch and TFT_Touch_Shield_V2. None of these will compile for me.

UniquePete commented 6 years ago

I am having similar problems with the touchscreen part of things—symptoms as previously described. My screen has an HR2406 controller, and the build quality is anything but outstanding, but I managed to get the display part functional by simply removing (commenting out) the 'if (touchController.isTouched(500))' conditional statement at around line 199. My unit also works a lot more reliably with an independent 5V power supply.

It would be nice to get to the bottom of the touchscreen problem though. It seems that whatever is going on, the MCU thinks that the screen is constantly being 'touched'. When running the TouchTest sketch, there is a constant stream of messages to the Serial Monitor:

Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 1, y = 1
Pressure = 4691, x = 611, y = 612
Pressure = 4655, x = 562, y = 576
Pressure = 4112, x = 211, y = 185
Pressure = 4098, x = 2, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 1, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1
Pressure = 4095, x = 0, y = 1

Note that the screen is detecting my own tap above the 'background noise'—those are the entries with non-zero/one x & y values. Should we just be setting a sensitivity threshold somewhere?

UniquePete commented 6 years ago

Well, I can get things partially working on my configuration by editing the XPT2046_Touchscreen.cpp file and setting the value of Z_THRESHOLD to something greater than the 'background' pressure measurement displayed when I ran the TouchTest sketch. I also set the Z_THRESHOLD_INT value correspondingly higher, but at this point I'm not sure what that is doing.

#define Z_THRESHOLD     4200
#define Z_THRESHOLD_INT 750

Now the esp8266-weather-station-color sketch will load and run, and I can change the time format by tapping on the screen. But that's all I can do. If I check the x & y values that are being returned, the y value is always 0, which explains why tapping anywhere on the screen only changes the time format. But the x value is sometimes negative, which doesn't make a lot of sense to me.

One other thing I noticed when running the TouchTest sketch was that, while the x & y values did vary as I tapped around the screen, I couldn't work out the logic of the x & y values being reported. In particular, the x & y values, apart from being affected in some way by the position being touched on the screen, were also very much affected by how hard I was pressing (i.e. if I just touched one point and pressed harder, the x & y values increased, significantly).

And why is the blue [NodeMCU] 'load LED' flashing constantly? (It's on hard as the TouchTest sketch is running too.)

Anyway, I'll fiddle some more. If anyone else works it out, please let us all know.

G6EJD commented 6 years ago

The LED is flashing because on that board it is shared by one of the gpio ports in use you can determine which one by serial.println(BUILTIN_LED) if I remember the correct spelling.

Have you tried running a touch test programme to eliminate any issues resulting from the hardware.

UniquePete commented 6 years ago

Thanks for the tip. It wasn't that LED, but it was the same problem—the LED in question was linked to GPIO 2, which we were using for T_IRQ. Disconnect that lead and no more flashing LED. No more T_IRQ either, of course, but that didn't seem to make any difference...?!?

There aren't that many GPIO pins left to use though. Are we really using all those leads coming from the display? We only seem to be using four of them (CS, DC, T_CS and T_IRQ, notwithstanding my observation in relation to T_IRQ), plus the RST, LED and power leads I guess. Nonetheless, I tried GPIO9 (SD2), and that just resulted in a crash. GPIO10 (SD3) seems to be OK, so that's where T_IRQ is now, but given that completely disconnecting the T_IRQ line from the display seemed to have no impact on operations, I've no idea wether or not the current connection (to GPIO10) is doing anything.

And yes, the problem seems to exist when running the TouchTest sketch, so it's almost certainly hardware related. The question is really whether this is a simple configuration issue or a more intrinsic hardware problem.

The fact that the TouchTest output indicates that both x & y values are being sensed (even if it's not clear what they mean), while the weather station software constantly reports a y value of "0", suggests that there is still a software element to this issue.

UniquePete commented 6 years ago

OK, so I appear to have fixed my remaining problem. Somewhere along the line, obviously when things weren't working properly, I had created a bad calibration file (valid file, but invalid data) that was being read every time I loaded the sketch. So I modified the sketch to set the result of the calibration check (at around line 170) to false and force a new calibration:

//  boolean isCalibrationAvailable = touchController.loadCalibration();
boolean isCalibrationAvailable = false;

After following the calibration instructions (creating the new calibration file), I changed the sketch code back to the original call to touchController.loadCalibration().

I still don't really understand the x & y values being returned, but now at least when I tap on the upper part of the display, the date format changes, and when I tap of the lower part of the display it cycles through several screens. I'm assuming that that's the correct behaviour...

mattie47 commented 6 years ago

Sadly also seeing the issue with all the screens switching through within a few seconds with this non-touch screen + D1 mini: https://www.aliexpress.com/item/Smart-Electronics-2-2-Inch-240-320-Dots-SPI-TFT-LCD-Serial-Port-Module-Display-ILI9341/32607741715.html

mattie47 commented 5 years ago

Anyone got an idea how to fix this?

As per https://github.com/ThingPulse/esp8266-weather-station-color/issues/52 it used to work prior to touch support.

Thanks,

Matt

mattie47 commented 5 years ago

For anyone interested, you can use this with non-touch screens with the last commit before touch screen support was added. You don't get the fast scrolling issue.

For reference, compiling with this commit it works fine:

https://github.com/ThingPulse/esp8266-weather-station-color/tree/5ba7fa70b5b707a85b4a15fe4bdc9f9bc79b0d9c

👍

commanzoom commented 5 years ago

@mattie47 I also have non-touch screen only and this commit you mention is too old now, as Weather underground is not providing APIs anymore (for free) Does anyone know what changes do i need to make to the code (latest version) to make it running properly on non-touch screen? Currently i have 12\24h mode switching every second as well as forecasts scrolling - looks like ESP thinks touch is connected :) Thanks!

mattie47 commented 5 years ago

@commanzoom Other than fixing the actual problem, you could always look at making the required changes for openweathermap at that git commit I referred to.

Openweathermap changes were done in https://github.com/ThingPulse/esp8266-weather-station-color/commit/5b6fef3da75738f050d128b6546ae56773dbd5bd

Sorry - I don't have time to give this a go, nor the C skills to try and fix/understand the problem with non-touch screens.

Thanks,

Matt

commanzoom commented 5 years ago

Hi @mattie47 Thanks for advice, but i was busy with this yesterday night and managed to fix this following advise from #84 - commented lines from 216 to 224 (master)

mattie47 commented 5 years ago

Thanks for that @commanzoom. I hadn't seen that post. Got mine working too. :-)

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

wapiti59 commented 4 years ago

Hi. I'm sorry if this has been addressed. I saw a reference to it up above but when I clicked on the link it would not let me view it. I received my kit(s) directly from Thingpulse. got them all assembled and programmed no problem, and they boot up and run great - for about a minute, and then the screen goes completely white. If I power down and back up again, works great, again for a minute and then white screen. Help???