Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P097] Updating code and (later) documentation #5165

Open
wants to merge 15 commits into
base: mega
Choose a base branch
from

Conversation

chromoxdor
Copy link
Contributor

@chromoxdor chromoxdor commented Nov 18, 2024

  • added extra routine for esp32 s2 and s3
  • added option to wake up the esp for supported devices (tested with s3 and classic)
  • added second value "state" for easier handling
  • added "toggle state" option
  • failed epically to add a long press event because I am just a simple person, but left the remains for someone else to pick up
  • added "long press" event
  • pins 10 to 14 now available for ESP32 s2 and s3 they still cause crashes

And as always, please don't stone me. Me and c++ are not going to be friends in this life anymore. :)

If you agree to the changes i will update the documentation accordingly.

- added extra routine for esp32 s2 and s3
- added option to wake up the esp for supported devices (tested with s3)
- added second value "state" for easier handling
- failed epically to add a long press event because I am just a simple person, but left the remains for someone else to pick up

And as always, please don't stone me. me and c++ are not going to be friends in this life anymore. :)

If you agree to the changes i will update the documentatzion accordingly
@tonhuisman
Copy link
Contributor

  • add a long press event ..... left the remains for someone else to pick up

That's why a #define P097_FEATURE_LONG_PRESS 1 and matching guards can be helpful, easily enabling/disabling experimental stuff.

- added and tested wakeup on ep32 classic
get the actual valuename
- added "toggle state" option (since I am not able to add a long press :)  )
- added "long press" event
- disabled "Single event with all values" since it is not working with the recent code (suggestions are welcome) but there is also the question if it is necessary
src/_P097_Esp32Touch.ino Outdated Show resolved Hide resolved
src/_P097_Esp32Touch.ino Outdated Show resolved Hide resolved
src/_P097_Esp32Touch.ino Outdated Show resolved Hide resolved
- make all touch pins available on s2/s3
- check if touchpad exists
- reverting T10_to_T14 support
@chromoxdor
Copy link
Contributor Author

chromoxdor commented Nov 27, 2024

Something still smells fishy with the touch inputs on my S3. When i add and then delete a "touch task" and then hit reboot i get quite often a "Guru Meditation Error"

Edit: I'll do more testing to rule out other conditions...

[17:25:48]35.253 : (265884) Info   : WD   : Uptime 1  ConnectFailures 0 FreeMem 266028 WiFiStatus: WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
[17:25:55]42.697 : (265980) Info   : Time set to 1732724755.520
[17:25:55]42.698 : (265932) Info   : Current Time Zone: STD time start: 2024-10-27 03:00:00 offset: 0 min
[17:25:55]42.709 : (265932) Info   : Local time: 2024-11-27 16:25:55
[17:25:55]42.710 : (265844) Info   : EVENT: Clock#Time=Wed,16:25
[17:25:55]42.714 : (265932) Info   : EVENT: Time#Initialized
[17:26:00]47.697 : (265884) Info   : EVENT: Clock#Time=Wed,16:26
[17:26:16]00:01:03.732 : (261280) Info   : taskClear() save settings
[17:26:16]00:01:03.768 : (262356) Info   : ESPEasy console using ESPEasySerial
[17:26:16]00:01:03.789 : (262356) Info   : ESPEasy console fallback enabled
[17:26:16]00:01:03.947 : (262268) Info   : EVENT: TaskExit#km=1,0
[17:26:16]00:01:03.995 : (263060) Info   : EVENT: TaskExit#km=1,0
[17:26:18]00:01:05.253 : (263840) Info   : WD   : Uptime 1  ConnectFailures 0 FreeMem 263984 WiFiStatus: WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
[17:26:22]00:01:09.103 : (261872) Info   :      : Rebooting...
[17:26:22]00:01:09.904 : (263704) Info   : WIFI : Disconnected! Reason: '(1) Unspecified'
[17:26:22]00:01:10.005 : (263632) Info   : WIFI : Set WiFi to OFF
[17:26:23]ESP-ROM:esp32s3-20210327
[17:26:23]Build:Mar 27 2021
[17:26:23]rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
[17:26:23]Saved PC:0x4037bc86
[17:26:23]SPIWP:0xee
[17:26:23]mode:DIO, clock div:1
[17:26:23]load:0x3fce3000,len:0x970
[17:26:23]load:0x403c9700,len:0xa8c
[17:26:23]load:0x403cc700,len:0x2808
[17:26:23]entry 0x403c9868
[17:26:23]Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
[17:26:23]
[17:26:23]Core  1 register dump:
[17:26:23]PC      : 0x4037e752  PS      : 0x00060f33  A0      : 0x8207d1bd  A1      : 0x3fced600  
[17:26:23]A2      : 0xf4936c03  A3      : 0xffffffff  A4      : 0x0000abab  A5      : 0x3fced710  
[17:26:23]A6      : 0x0000abab  A7      : 0x00060f23  A8      : 0x40034c48  A9      : 0x3fced6f0  
[17:26:23]A10     : 0x40377170  A11     : 0x600c0004  A12     : 0x40057d3c  A13     : 0x00000000  
[17:26:23]A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000001f  EXCCAUSE: 0x0000001c  
[17:26:23]EXCVADDR: 0xf4936c03  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000  
[17:26:23]
[17:26:23]
[17:26:23]Backtrace: 0x4037e74f:0x3fced600 0x4207d1ba:0x3fced630 0x4207d200:0x3fced650 0x4207bd9d:0x3fced670 0x4207fbd9:0x3fced690 0x40377c3a:0x3fced6b0 0x403771df:0x3fced6d0 0x40043a43:0x3fced6f0 0x40034c45:0x3fced710
[17:26:23]
[17:26:23]
[17:26:23]
[17:26:23]
[17:26:23]ELF file SHA256: dd9fab5d356be553
[17:26:23]
[17:26:23]Rebooting...
[17:26:23]ESP-ROM:esp32s3-20210327
[17:26:23]Build:Mar 27 2021
[17:26:23]rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
[17:26:23]Saved PC:0x420ab038
[17:26:23]SPIWP:0xee
[17:26:23]mode:DIO, clock div:1
[17:26:23]load:0x3fce3000,len:0x970
[17:26:23]load:0x403c9700,len:0xa8c
[17:26:23]load:0x403cc700,len:0x2808
[17:26:23]entry 0x403c9868
[17:26:23]Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
[17:26:23]
[17:26:23]Core  1 register dump:
[17:26:23]PC      : 0x4037e752  PS      : 0x00060f33  A0      : 0x8207d1bd  A1      : 0x3fced600  
[17:26:23]A2      : 0xf4936c03  A3      : 0xffffffff  A4      : 0x0000abab  A5      : 0x3fced710  
[17:26:23]A6      : 0x0000abab  A7      : 0x00060f23  A8      : 0x40034c48  A9      : 0x3fced6f0  
[17:26:23]A10     : 0x40377170  A11     : 0x600c0004  A12     : 0x40057d3c  A13     : 0x00000000  
[17:26:23]A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000001f  EXCCAUSE: 0x0000001c  
[17:26:23]EXCVADDR: 0xf4936c03  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000  
[17:26:23]
[17:26:23]
[17:26:23]Backtrace: 0x4037e74f:0x3fced600 0x4207d1ba:0x3fced630 0x4207d200:0x3fced650 0x4207bd9d:0x3fced670 0x4207fbd9:0x3fced690 0x40377c3a:0x3fced6b0 0x403771df:0x3fced6d0 0x40043a43:0x3fced6f0 0x40034c45:0x3fced710
[17:26:23]
[17:26:23]
[17:26:23]
[17:26:23]
[17:26:23]ELF file SHA256: dd9fab5d356be553
[17:26:23]
[17:26:23]Rebooting...
[17:26:23]ESP-ROM:esp32s3-20210327
[17:26:23]Build:Mar 27 2021
[17:26:23]rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
[17:26:23]Saved PC:0x420ab038
[17:26:23]SPIWP:0xee
[17:26:23]mode:DIO, clock div:1
[17:26:23]load:0x3fce3000,len:0x970
[17:26:23]load:0x403c9700,len:0xa8c
[17:26:23]load:0x403cc700,len:0x2808
[17:26:23]entry 0x403c9868
[17:26:23]00.393 : (322612) Info   : Using PSRAM
[17:26:23]00.395 : (322436) Info   : 
[17:26:23]

@chromoxdor
Copy link
Contributor Author

Ok..it happens to other tasks too..

@TD-er
Copy link
Member

TD-er commented Nov 27, 2024

And what if you copy over the old code of this task to see if your changes made any difference?
Could be I need to perform some reset of the GPIO pin as it doesn't always properly reset the state of a GPIO pin.

Does this happen on a SPIFFS build or also on a LittleFS build? (different SDK version)

- type of threshold now dependent on model (uin32_t for s2 and s3)
- max threshold value now also dependent on the type of esp
@chromoxdor
Copy link
Contributor Author

chromoxdor commented Nov 28, 2024

And what if you copy over the old code of this task to see if your changes made any difference?

I tried this on a fresh esp32-s3 with a "normal" build to rule out that my changes have something to do with it.
(and i am not sure this is gpio related. The "fresh" esp32 already crashed right after the first boot...)
I also mentioned this in the forum
At this time i thought the crashes and connection errors are some kind of WiFi issues. It turns out , that the crashes and the connection errors are not related since the latter got fixed...

Does this happen on a SPIFFS build or also on a LittleFS build? (different SDK version)

SPIFFS... didn´t test it with LittleFS. The only usable option right now is neopixel_ESP32s3_4M316k_LittleFS_CDC_ETH right?

@@ -124,7 +126,7 @@ boolean Plugin_097(uint8_t function, struct EventStruct *event, String& string)
addFormCheckBox(F("Send Touch Event"), F("sendtouch"), P097_SEND_TOUCH_EVENT);
addFormCheckBox(F("Send Release Event"), F("sendrelease"), P097_SEND_RELEASE_EVENT);
addFormCheckBox(F("Send Duration Event"), F("sendduration"), P097_SEND_DURATION_EVENT);
addFormNumericBox(F("Touch Threshold"), F("threshold"), P097_TOUCH_THRESHOLD, 0, P097_MAX_ADC_VALUE);
addFormNumericBox(F("Touch Threshold"), F("threshold"), P097_TOUCH_THRESHOLD, 0, P097_MAX_THRESHOLD_VALUE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This defined value is only defined for ESP32S2 and ESP32S3... Not sure why the name is changed?

- Hopefully fixed compile errors for non-touch ESP32 variants by standardizing the use of uint32_t for the threshold parameter on ESP32 Classic. The value remains limited by P097_MAX_THRESHOLD_VALUE to 4095.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants