openHASP icon indicating copy to clipboard operation
openHASP copied to clipboard

Guition ESP32-S3-4848S040 Display wakes-up randomly

Open vampywiz17 opened this issue 10 months ago • 102 comments

Perform all steps below and tick them with [x]

  • [x] Check the related part of the Documentation
  • [x] Update openHASP to the latest version
  • [x] Reproduce the issue and describe all steps

Describe the bug

To Reproduce

Install latest beta firmware 7.0 rc11 (Guition ESP32-S3-4848S040)

Expected behavior

The display can not wake up

Screenshots or video

Get this code on console, when the display are wake up:

#[22:50:34.205][98292/109668 10][25324/26056  3] HASP: First touch Disabled
#[22:50:34.219][94196/106476 11][25324/26056  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#[22:50:34.231][90100/106488 15][25324/26056  3] MQTT PUB: idle => off
#[22:50:34.244][90100/104904 14][25324/26056  3] MSGR: File not found: L:/idle_off.cmd
#[22:50:34.272][98292/109556 10][25324/26056  3] MQTT RCV:  = backlight {"state": "on", "brightness": 255}
#[22:50:34.285][94196/107960 12][25324/26056  3] MSGR: backlight={"state": "on", "brightness": 255}
#[22:50:34.300][94196/107960 12][25324/26056  3] MQTT PUB: backlight => {"state":"on","brightness":255}

vampywiz17 avatar Apr 11 '24 19:04 vampywiz17

hmm it does not depend on discovery...

I get this, if the display are wakeing up.

#[22:50:34.205][98292/109668 10][25324/26056  3] HASP: First touch Disabled
#[22:50:34.219][94196/106476 11][25324/26056  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#[22:50:34.231][90100/106488 15][25324/26056  3] MQTT PUB: idle => off
#[22:50:34.244][90100/104904 14][25324/26056  3] MSGR: File not found: L:/idle_off.cmd
#[22:50:34.272][98292/109556 10][25324/26056  3] MQTT RCV:  = backlight {"state": "on", "brightness": 255}
#[22:50:34.285][94196/107960 12][25324/26056  3] MSGR: backlight={"state": "on", "brightness": 255}
#[22:50:34.300][94196/107960 12][25324/26056  3] MQTT PUB: backlight => {"state":"on","brightness":255}

Possible that some problem with touch panel?

vampywiz17 avatar Apr 11 '24 20:04 vampywiz17

Strange thing... it only happen, if i power it my display via 230V... if i use USB type C port, the problem not happen more than one hour...

vampywiz17 avatar Apr 11 '24 23:04 vampywiz17

I have that screen running on 240V and do not see this problem, how often does it wake up ?

smcgann99 avatar Apr 14 '24 18:04 smcgann99

@smcgann99

I did more test and seems maybe not the 230V the problem...

sometimes happen about 5-10 min, sometimes not happen hours... I dont understand... Seems happen more time, if for example the sun is shine directly to the screen... but it only just a idea...

vampywiz17 avatar Apr 14 '24 21:04 vampywiz17

This doesn't really sound like a bug to me. Do you have the complete log prior to the screen idle off, perhaps something is being sent to the screen ?

smcgann99 avatar Apr 14 '24 23:04 smcgann99

@smcgann99

Hello sorry the late answer.

Here:

#[20:08:00.000][102388/111876  8][25364/26012  3] MQTT RCV: p0b3.text = 20:08
#[20:08:59.990][102388/111876  8][25364/26012  3] MQTT RCV: p0b3.text = 20:09
#[20:09:38.479][98292/110356 10][25364/26012  3] MQTT PUB: statusupdate => {"node":"nappali_uj","idle":"long","version":"0.7.0-rc12","uptime":37576,"ssid":"iot_network","rssi":-63,"ip":"192.168.31.162","mac":"80:65:99:C8:8D:40","heapFree":111940,"heapFrag":8,"core":"4.4.6","canUpdate":"false","page":1,"numPages":12,"tftDriver":"Other","tftWidth":480,"tftHeight":480}
#[20:09:38.498][102388/111940  8][25364/26012  3] MQTT PUB: sensors => {"time":"2024-04-21T20:09:38","uptimeSec":37576,"uptime":"0T10:26:16"}
#[20:09:47.082][102388/111940  8][25364/26012  3] HASP: First touch Disabled
#[20:09:47.096][98292/108772  9][25364/26012  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#[20:09:47.108][94196/108768 13][25364/26012  3] MQTT PUB: idle => off
#[20:09:47.121][94196/107184 12][25364/26012  3] MSGR: File not found: L:/idle_off.cmd
#[20:09:47.150][102388/111816  8][25364/26012  3] MQTT RCV:  = backlight {"state": "on", "brightness": 255}
#[20:09:47.163][98292/110228 10][25364/26012  3] MSGR: backlight={"state": "on", "brightness": 255}
#[20:09:47.178][98292/110228 10][25364/26012  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#[20:09:59.989][102388/111876  8][25364/26012  3] MQTT RCV: p0b3.text = 20:10
#[20:10:04.515][98292/110356 10][25364/26012  3] MQTT PUB: discovery => {"node":"nappali_uj","mdl":"1-S3 4848S040","mf":"openHASP","hwid":"806599c88d40","pages":12,"sw":"0.7.0-rc12","node_t":"hasp/nappali_uj/","uri":"http://192.168.31.162","input":{},"power":[],"light":[40],"dim":[]}
#

Other one. I not see any special

#[20:20:59.988][102388/111876  8][25448/26020  3] MQTT RCV: p0b3.text = 20:21
#[20:21:08.632][102388/111940  8][25448/26020  3] HASP: First touch Disabled
#[20:21:08.646][98292/108772  9][25448/26020  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#[20:21:08.658][94196/108768 13][25448/26020  3] MQTT PUB: idle => off
#[20:21:08.672][94196/107184 12][25448/26020  3] MSGR: File not found: L:/idle_off.cmd
#[20:21:08.697][102388/111816  8][25448/26020  3] MQTT RCV:  = backlight {"state": "on", "brightness": 255}
#[20:21:08.710][98292/110228 10][25448/26020  3] MSGR: backlight={"state": "on", "brightness": 255}
#[20:21:08.725][98292/110228 10][25448/26020  3] MQTT PUB: backlight => {"state":"on","brightness":255}
#

vampywiz17 avatar Apr 21 '24 18:04 vampywiz17

Well it doesn't look like anything is waking it via command, so it may just be a faulty screen / local interference ?

I haven't seen this issue with my screen.

smcgann99 avatar Apr 26 '24 13:04 smcgann99

This all sounds to me like electromagnetic interference on the device/microcontroller. Make sure all the needed signals have an appropriate pull-up/pull-down resistor. Fixing an issue that only occurs randomly is nearly impossible without knowing the root cause...

fvanroie avatar May 13 '24 12:05 fvanroie

Is this problem resolved now?

fvanroie avatar May 28 '24 19:05 fvanroie

I have the same problem. And also with the display 1-S3 4848S040. Sometimes it wakes up randomly and (it seems to me) it clicking in a random place. QWE Firmware: 0.7.0-rc12

username-AL avatar Jun 03 '24 21:06 username-AL

Is this problem resolved now?

not solved, unfortunately...

vampywiz17 avatar Jun 03 '24 22:06 vampywiz17

This sounds more like a hardware issue than a bug. e.g. the screen is registering a touch when there is none.

smcgann99 avatar Jun 04 '24 00:06 smcgann99

More troubleshooting is needed to determine the root-cause.

  • Does it happen when you detach the screen from the PSU? Power it with a stable 5V power-supply and see what happens.
  • Does this also happen with other firmware?
  • Do you have multiple screens? Do they all have the same symptoms?

fvanroie avatar Jun 05 '24 13:06 fvanroie

More troubleshooting is needed to determine the root-cause.

  • Does it happen when you detach the screen from the PSU? Power it with a stable 5V power-supply and see what happens.
  • Does this also happen with other firmware?
  • Do you have multiple screens? Do they all have the same symptoms?

@fvanroie

- Does it happen when you detach the screen from the PSU? Power it with a stable 5V power-supply and see what happens.

  • Try with USB port, it also happen

- Does this also happen with other firmware?

  • I try more RC firmware, it happen all of them

- Do you have multiple screens? Do they all have the same symptoms?

  • Only one screen, but others are also affect it.

vampywiz17 avatar Jun 11 '24 13:06 vampywiz17

Thanks for your feedback. It really sounds like a hardware issue to me. Maybe you can try other software like Tasmota, ESPhome, ... and see if that also have the problem.

Like stated before, without a way to replicate the random problem, it will be very hard to fix it.

fvanroie avatar Jun 11 '24 14:06 fvanroie

It might be that the touch driver chip is reacting to electrical noise and generating an interrupt. Been digging in to the GT911 programming notes, and I see a couple of config registers that can be set to filter out noise (and adjust the touch sensitivity). There are a couple of functions within the Arduino Goodix driver for the GT911 that read the config registers. Whilst there is a function call to set the resolution, there isn't one to adjust sensitivity. It would only take a few lines of code to craft a suitable function, but the question is where within openHASP to put it (and when to call). Perhaps add something to the Configuration->Display screen in the web interface ?

FreeBear-nc avatar Jun 15 '24 23:06 FreeBear-nc

The goodix repo is a fork which already has some openHASP tweaks. So it is fine to add the settings function to the goodix driver repo.

Then, openHASP can simple call that function when initializing the driver. At first, a simple test is needed to see if it actually works before thinking about UI changes.

fvanroie avatar Jun 16 '24 11:06 fvanroie

If you do this I glad to test it!

vampywiz17 avatar Jun 16 '24 13:06 vampywiz17

Hacked a few lines of code to read the config registers inside the GT911 chip. In the process, learned a little... My trivial little hack causes openHASP to crash & burn with a panic. Not had time to work out why.

In the meantime, I do have a standalone utility that could be used to tweak the relevant register in the GT911 chip.

FreeBear-nc avatar Jun 17 '24 00:06 FreeBear-nc

OK so it seems that my screen has developed this problem now ;-( Recently noticed that devices were switching on randomly, and traced it to the screen registering a button press when there was none.

smcgann99 avatar Jun 28 '24 00:06 smcgann99

Tried adding a short bit of code to openHASP to modify the relevant register in the GT911 chip during setup. Unfortunately, this addition triggered a panic and infinite reboots. As life is short, and using the JTAG interface to debug is impossible, I've put together a standalone "project" - https://github.com/FreeBear-nc/HA-openHASP/tree/main/GT911 Compile, upload, and then reload the openHASP firmware.

To adjust the noise sensitivity, edit the NR_LEVEL flag in the platformio.ini and recompile/upload - I would suggest 6 or 7 to start with.

FreeBear-nc avatar Jun 29 '24 18:06 FreeBear-nc

Does this register fix the ghost touches?

fvanroie avatar Aug 15 '24 21:08 fvanroie

@fvanroie

I can not able to test it...

vampywiz17 avatar Aug 15 '24 22:08 vampywiz17

If @FreeBear-nc could provide a (tested) pre built binary or 2 with different values, I'm willing to try it (not wishing to brick my screen) ;-)

In my case I seem to get a bunch of false touches, a power cycle seems to stop them. It can then go for days without problem, so will not be easy to be sure its helping for some time.

smcgann99 avatar Aug 15 '24 23:08 smcgann99

Had a spell of phantom touches on my Guition display. Didn't get round to uploading my code, and the events haven't reoccurred. Intermittent ghost events are a pig to diagnose and to say with any certainty that they have been fixed.

@smcgann99 Do you not have platformio set up on your computer ?

FreeBear-nc avatar Aug 15 '24 23:08 FreeBear-nc

Had a spell of phantom touches on my Guition display. Didn't get round to uploading my code, and the events haven't reoccurred. Intermittent ghost events are a pig to diagnose and to say with any certainty that they have been fixed.

@smcgann99 Do you not have platformio set up on your computer ?

Sounds like you are seeing similar issues to me then, I had it on my desk for weeks before I noticed the problem. I suspect that it may be present on all Guition screens, but others may not have noticed. It would be great to get it fixed as these are really nice screens for the price.

I don't have it setup, I have managed to fumble my way to using gitpod in the past. But if you can do a couple of builds with different values then you can test one value and I can test another. I can leave it running for a week or so and see if I get any events. Would also need to see if it effects usability of the screen.

smcgann99 avatar Aug 15 '24 23:08 smcgann99

@smcgann99 Catch me on Discord over the weekend to discuss options.

FreeBear-nc avatar Aug 15 '24 23:08 FreeBear-nc

Pushed three firmware images to my repository. You'll need to use esptool to upload them to your board. Once loaded, do a reset and let it run. Then upload the openHASP firmware. If the nr-7 or nr-10 builds don't work, the nr-5 build should put everything back to stock.

FreeBear-nc avatar Aug 18 '24 19:08 FreeBear-nc

Pushed three firmware images to my repository. You'll need to use esptool to upload them to your board. Once loaded, do a reset and let it run. Then upload the openHASP firmware. If the nr-7 or nr-10 builds don't work, the nr-5 build should put everything back to stock.

Have you installed one of the values to your screen, if so which ?

smcgann99 avatar Aug 18 '24 21:08 smcgann99

Have you installed one of the values to your screen, if so which ?

Tried 6 and 7. But I've only had one evening of phantom touch events, and can't say for sure if it made any difference.

FreeBear-nc avatar Aug 18 '24 21:08 FreeBear-nc