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

Async full-refresh for EInkDynamicDisplay #3339

Merged
merged 9 commits into from Mar 11, 2024

Conversation

todd-herbert
Copy link
Contributor

@todd-herbert todd-herbert commented Mar 6, 2024

Aim

Minimize time where display code blocks execution, by running full-refresh asynchronously.

Code summary

A slight modification to GxEPD2 splits the nextPage() method into two parts (if variant uses EInkDynamicDisplay). The EInkDisplay base-class calls nextPage() as normal. If GxEPD2 detects a full refresh, it bypasses both the _WaitWhileBusy() method, and the remaining code of nextPage().

The EInkDynamicDisplay class sets a flag, then returns control to the loop(). As always, the next loop requests a new frame by calling EInkDynamicDisplay::display(). While processing new frames, the EInkDynamicDisplay class polls the display's BUSY pin. If it detects a completed async refresh, it calls the new GxEPD2_BW::endAsyncFull() method, which contains the post-update code transplanted from the original nextPage() method.

Prior to merge

  • Would like to hear if this does address [Bug]: eink updates causing packet loss #2356, mentioned recently by @GUVWAF
  • Will create pull-request for the GxEPD2 modifications
  • Will adjust lib_deps for Wireless Paper to point back at meshtastic/GxEPD2 (currently tracking personal repo, for draft)

Flow diagram

To aid future maintenance. Traces flow of an async full-refresh between meshtastic/firmware and modified GxEPD2.
flow diagram for an async full refresh

@GUVWAF
Copy link
Member

GUVWAF commented Mar 7, 2024

Just tested this on the Wireless Paper v1.1 while sending multiple 1-character text messages from another device in the same room quickly after each other. Previously it would sometimes not get an acknowledgment when I saw it doing a full refresh. With this, I can’t reproduce this anymore, even when it’s doing the full refresh.

Really nice to finally have a complete solution to this problem! The approach looks solid to me.

Do you know if the e-paper of the T-Echo also has this possibility? Currently we’re using only fast updates on that hardware.

@todd-herbert
Copy link
Contributor Author

todd-herbert commented Mar 8, 2024

Do you know if the e-paper of the T-Echo also has this possibility? Currently we’re using only fast updates on that hardware.

Hopefully it should be as simple as configuring the macros in platformio.ini for the variant, but I hadn't dared to set it for a bunch of devices I can't test first.

I've just pushed the same config used for the Wireless Paper v1.1 into T-Echo's platformio.ini; let me know if it works!

The values might want some adjusting to get best performance from the T-Echo's display.
There's a brief description of the config options in #3316.
If you do optimize the config, let me know and I can push it from here before merge if you'd like.
I know it goes without saying, but please do feel free to adjust config / implement for other boards wherever you think it could help.

@GUVWAF
Copy link
Member

GUVWAF commented Mar 8, 2024

I've just pushed the same config used for the Wireless Paper v1.1 into T-Echo's platformio.ini; let me know if it works!

Oh, it’s really that easy -- I really like the modular approach.

Also on the T-Echo I don’t miss any packets even when it does the full update.

I did not experience a lot of ghosting yet, so maybe we can increase the EINK_LIMIT_FASTREFRESH to 15 or 20? The rest seems okay for now.

Edit: One thing I noticed is that when shutting down, it stays on the page saying "Shutting down..." instead of going to the screen that says "Sleeping...". Also when booting, it looks like it skips the boot screen. This also happens on the Wireless Paper.

@todd-herbert
Copy link
Contributor Author

todd-herbert commented Mar 8, 2024

I did not experience a lot of ghosting yet, so maybe we can increase the EINK_LIMIT_FASTREFRESH to 15 or 20? The rest seems okay for now.

Will do!

Edit: One thing I noticed is that when shutting down, it stays on the page saying "Shutting down..." instead of going to the screen that says "Sleeping...". Also when booting, it looks like it skips the boot screen. This also happens on the Wireless Paper.

Ah well spotted. I can see where the issues is with shutdown, and I think I can see what might be different about the T-Echo's boot right now. I can't reproduce boot screen issues with the Wireless Paper though. Can you confirm whether the boot screen is skipped for both the T-Echo and the Wireless Paper?

Would it be possible to ask for your serial debug log? It might help be hone-in on the problem.

thebentern added a commit to meshtastic/artifacts that referenced this pull request Mar 8, 2024
@GUVWAF
Copy link
Member

GUVWAF commented Mar 8, 2024

Yes, for me it skips the boot screen on both the T-Echo and the Wireless Paper v1.1. It's fully white before showing the node list.

Here is the boot log from the T-Echo (from e-ink init):

INFO | 21:26:42 4 Doing EInk init
DEBUG | 21:26:42 4 determineMode(): ghostPixels=0, refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS
INFO | 21:26:42 4 Turning on screen
DEBUG | 21:26:42 4 Module wants a UI Frame
WARN | 21:26:42 4 SX126xInterface(cs=24, irq=20, rst=25, busy=17)
DEBUG | 21:26:42 4 SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at 1.800000 V
INFO | 21:26:42 4 Starting meshradio init...
DEBUG | 21:26:42 4 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=0, time 231 ms
DEBUG | 21:26:42 4 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=253, time 2115 ms
INFO | 21:26:42 4 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | 21:26:42 4 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | 21:26:42 4 Radio myRegion->freqStart -> myRegion->freqEnd: 869.400024 -> 869.650024 (0.250000 mhz)
INFO | 21:26:42 4 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | 21:26:42 4 Radio channel_num: 1
INFO | 21:26:42 4 Radio frequency: 869.525024
INFO | 21:26:42 4 Slot time: 42 msec
INFO | 21:26:42 4 Set radio: final power level=22
INFO | 21:26:42 4 SX126x init result 0
INFO | 21:26:42 4 Frequency set to 869.525024
INFO | 21:26:42 4 Bandwidth set to 250.000000
INFO | 21:26:42 4 Power output set to 22
DEBUG | 21:26:42 4 Current limit set to 140.000000
DEBUG | 21:26:42 4 Current limit set result 0
DEBUG | 21:26:42 4 Setting DIO2 as RF switch
DEBUG | 21:26:42 4 SX126X_RXEN not defined, defaulting to RADIOLIB_NC
DEBUG | 21:26:42 4 SX126X_TXEN not defined, defaulting to RADIOLIB_NC
DEBUG | 21:26:42 4 Using MCU pin -1 as RXEN and pin -1 as TXEN to control RF switching
INFO | 21:26:42 4 Set RX gain to boosted mode; result: 0
INFO | 21:26:42 4 SX1262 Radio init succeeded, using SX1262 radio
DEBUG | 21:26:42 4 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=237, time 2000 ms
DEBUG | 21:26:42 4 LoRA bitrate = 118.500000 bytes / sec
INFO | 21:26:42 4 PowerFSM init, USB power=1
DEBUG | 21:26:42 4 Enter state: BOOT
DEBUG | 21:26:42 4 [Power] Battery: usbPower=0, isCharging=0, batMv=3100, batPct=0
DEBUG | 21:26:42 4 [Screen] Screen: Started...
DEBUG | 21:26:42 4 [GPS] Probing for GPS at 9600
INFO | 21:26:42 4 [GPS] L76K GNSS init succeeded, using L76K GNSS Module
DEBUG | 21:26:43 5 [GPS] NMEA GPS time 2024-03-08 21:27:49
DEBUG | 21:26:43 5 [GPS] Upgrading time to quality 4
DEBUG | 21:27:49 5 [GPS] PCF8563_RTC setDateTime 2024-03-08 21:27:49 536954100
DEBUG | 21:27:49 5 [GPS] Read RTC time from PCF8563 as 536901740
DEBUG | 21:27:49 5 [GPS] publishing pos@0:2, hasVal=0, Sats=0, GPSlock=0
DEBUG | 21:27:49 5 [GPS] No GPS lock
DEBUG | 21:27:49 5 [GPS] onGPSChanged() pos@0, time=1709933269, lat=0, lon=0, alt=0
INFO | 21:27:49 5 [GPS] updatePosition LOCAL pos@0, time=1709933269, latI=0, lonI=0, alt=0
DEBUG | 21:27:49 5 [GPS] Setting local position: latitude=0, longitude=0, time=1709933269
DEBUG | 21:27:49 5 [GPS] Node status update: 1 online, 13 total
INFO | 21:27:49 5 [RangeTestModule] Range Test Module - Disabled
DEBUG | 21:27:49 5 [Screen] determineMode(): ghostPixels=0, refresh=FAST, reason=NO_OBJECTIONS, fastRefreshCount=0
DEBUG | 21:27:49 5 [Screen] Updating E-Paper... done
INFO | 21:27:51 8 [PowerFSM] Loss of power in Powered
INFO | 21:27:51 8 [PowerFSM] Loss of power in Powered
DEBUG | 21:27:51 8 [PowerFSM] Initializing NRF52 Bluetooth
INFO | 21:27:51 8 [PowerFSM] Initialize the Bluefruit nRF52 module
INFO | 21:27:51 8 [PowerFSM] Bluetooth pin set to ''
INFO | 21:27:51 8 [PowerFSM] Configuring the Device Information Service
INFO | 21:27:51 8 [PowerFSM] Configuring the Battery Service
INFO | 21:27:51 8 [PowerFSM] Configuring the Mesh bluetooth service
INFO | 21:27:51 8 [PowerFSM] Setting up the advertising payload(s)
INFO | 21:27:51 8 [PowerFSM] Advertising
DEBUG | 21:27:51 8 [PowerFSM] Enter state: ON
DEBUG | 21:27:51 8 [Screen] Screen: Unpowered...
DEBUG | 21:27:51 8 [Screen] determineMode(): ghostPixels=0, refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS
INFO | 21:27:52 9 [Screen] Done with boot screen...
DEBUG | 21:27:52 9 [Screen] showing standard frames
DEBUG | 21:27:52 9 [Screen] Showing 0 module frames
DEBUG | 21:27:52 9 [Screen] Total frame count: 103
DEBUG | 21:27:52 9 [Screen] Added modules. numframes: 0
DEBUG | 21:27:52 9 [Screen] Finished building frames. numframes: 6
DEBUG | 21:27:52 9 [Screen] determineMode(): ghostPixels=1277, refresh=FAST, reason=NO_OBJECTIONS, fastRefreshCount=1
DEBUG | 21:27:53 9 [Screen] Updating E-Paper... done

And on shutdown:

DEBUG | 21:31:34 231 [Screen] showing shutdown screen
DEBUG | 21:31:34 231 [Screen] determineMode(): ghostPixels=2860, refresh=FULL, reason=EXCEEDED_GHOSTINGLIMIT
DEBUG | 21:31:35 231 [Screen] Updating E-Paper... done
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] determineMode(): ghostPixels=0, refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:37 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 234 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
DEBUG | 21:31:38 235 [Screen] showing shutdown screen
INFO | 21:31:38 235 Shutting down from admin command
INFO | 21:31:38 235 Turning off screen
INFO | 21:31:38 235 Shutting down
INFO | 21:31:38 235 Entering deep sleep forever

And the boot log of the Wireless Paper v1.1:

DEBUG | ??:??:?? 5 determineMode(): ghostPixels=0, refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS
INFO | ??:??:?? 5 Turning on screen
DEBUG | ??:??:?? 5 Module wants a UI Frame
WARN | ??:??:?? 5 SX126xInterface(cs=8, irq=14, rst=12, busy=13)
DEBUG | ??:??:?? 5 SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at 1.800000 V
INFO | ??:??:?? 5 Starting meshradio init...
DEBUG | ??:??:?? 5 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=0, time 231 ms
DEBUG | ??:??:?? 5 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=253, time 2115 ms
INFO | ??:??:?? 5 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | ??:??:?? 5 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | ??:??:?? 5 Radio myRegion->freqStart -> myRegion->freqEnd: 869.400024 -> 869.650024 (0.250000 mhz)
INFO | ??:??:?? 5 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | ??:??:?? 5 Radio channel_num: 1
INFO | ??:??:?? 5 Radio frequency: 869.525024
INFO | ??:??:?? 5 Slot time: 42 msec
INFO | ??:??:?? 5 Set radio: final power level=22
INFO | ??:??:?? 5 SX126x init result 0
INFO | ??:??:?? 5 Frequency set to 869.525024
INFO | ??:??:?? 5 Bandwidth set to 250.000000
INFO | ??:??:?? 5 Power output set to 22
DEBUG | ??:??:?? 5 Current limit set to 140.000000
DEBUG | ??:??:?? 5 Current limit set result 0
DEBUG | ??:??:?? 5 Setting DIO2 as RF switch
DEBUG | ??:??:?? 5 SX126X_RXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 5 SX126X_TXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 5 Using MCU pin -1 as RXEN and pin -1 as TXEN to control RF switching
INFO | ??:??:?? 5 Set RX gain to power saving mode (boosted mode off); result: 0
INFO | ??:??:?? 5 SX1262 Radio init succeeded, using SX1262 radio
DEBUG | ??:??:?? 5 Initializing MQTT
DEBUG | ??:??:?? 5 Waiting for SSL Cert to be generated.
INFO | ??:??:?? 5 Checking if we have a previously saved SSL Certificate.
INFO | ??:??:?? 5 Existing SSL Certificate found!
DEBUG | ??:??:?? 5 Retrieved Private Key: 1191 Bytes
DEBUG | ??:??:?? 5 Retrieved Certificate: 792 Bytes
INFO | ??:??:?? 5 SSL Cert Ready!
[ 5775][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 0 - WIFI_READY
[ 5811][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 2 - STA_START
DEBUG | ??:??:?? 5 JOINING WIFI soon: ssid=
DEBUG | ??:??:?? 5 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=237, time 2000 ms
DEBUG | ??:??:?? 5 LoRA bitrate = 118.500000 bytes / sec
INFO | ??:??:?? 5 PowerFSM init, USB power=1
DEBUG | ??:??:?? 5 Enter state: BOOT
DEBUG | ??:??:?? 5 Setting CPU to 240mhz because WiFi is in use.
DEBUG | ??:??:?? 5 [Power] Battery: usbPower=0, isCharging=0, batMv=3494, batPct=26
DEBUG | ??:??:?? 5 [Screen] Screen: Started...
INFO | ??:??:?? 5 [RangeTestModule] Range Test Module - Disabled
INFO | ??:??:?? 5 [WifiConnect] Reconnecting to WiFi access point
INFO | ??:??:?? 10 [PowerFSM] Loss of power in Powered
INFO | ??:??:?? 10 [Screen] Done with boot screen...
DEBUG | ??:??:?? 10 [Screen] showing standard frames
DEBUG | ??:??:?? 10 [Screen] Showing 0 module frames
DEBUG | ??:??:?? 10 [Screen] Total frame count: 103
DEBUG | ??:??:?? 10 [Screen] Added modules. numframes: 0
DEBUG | ??:??:?? 10 [Screen] Finished building frames. numframes: 6
DEBUG | ??:??:?? 10 [Screen] determineMode(): ghostPixels=0, refresh=FAST, reason=NO_OBJECTIONS, fastRefreshCount=0
DEBUG | ??:??:?? 10 [Screen] Updating E-Paper... done

@todd-herbert
Copy link
Contributor Author

todd-herbert commented Mar 8, 2024

Yes, for me it skips the boot screen on both the T-Echo and the Wireless Paper v1.1

That's definitely weird! Maybe it only works on my device because of a different config taking longer to boot?
Thanks a lot for the logs. I'll get onto it today.

@GUVWAF
Copy link
Member

GUVWAF commented Mar 8, 2024

That's definitely weird! Maybe it only works on my device because of a different config taking longer to boot?

Seems indeed config related. If I disable Wi-Fi, the boot screen shows on the Wireless Paper.

@todd-herbert
Copy link
Contributor Author

todd-herbert commented Mar 8, 2024

The plan in the near future was to explicitly mark special frames like boot and sleep screens (in Screen.cpp) with setFrameFlag(COSMETIC) or setFrameFlag(DEMAND_FAST).

I think what I'll try is adding a BLOCKING flag, and then mark those special frames as setFrameFlag(COSMETIC | BLOCKING), which will tell the EInkDynamicDisplay class to sit and repeatedly poll the BUSY pin before returning control to the loop().

@todd-herbert
Copy link
Contributor Author

I'm not able to test it myself, but I believe I do have a fix for the bugs discussed above.
It is tied to code which I had hoped to open a separate pull-request for.

Rather than broadening scope, I am submitting this code as-is, and will quickly draft a new pull-request which handles these "special-case" frames, such as boot and sleep.

@todd-herbert todd-herbert marked this pull request as ready for review March 9, 2024 13:03
@todd-herbert todd-herbert marked this pull request as draft March 9, 2024 13:09
@todd-herbert todd-herbert marked this pull request as ready for review March 9, 2024 13:12
@todd-herbert
Copy link
Contributor Author

todd-herbert commented Mar 9, 2024

Please note that this code requires meshtastic/GxEPD2#6 to work correctly

@GUVWAF
Copy link
Member

GUVWAF commented Mar 9, 2024

I'm not able to test it myself, but I believe I do have a fix for the bugs discussed above.

Good to hear.

Rather than broadening scope, I am submitting this code as-is, and will quickly draft a new pull-request which handles these "special-case" frames, such as boot and sleep.

That's fine, it's not a really big issue anyways.

Approving (assuming meshtastic/GxEPD2#6 gets merged).

@thebentern thebentern merged commit cf4753f into meshtastic:master Mar 11, 2024
3 of 43 checks passed
upchui added a commit to upchui/firmware-Meshtastic-Unleashed that referenced this pull request Mar 11, 2024
* Move Wireless Paper V1.1 custom hibernate behavior to GxEPD2

* Async full-refresh for EInkDynamicDisplay

* initial config for T-Echo

* formatting
responds to meshtastic#3339 (comment)

* increase fast-refresh limit for T-Echo
meshtastic#3339 (comment)

* change dependency from private repo to meshtastic/GxEPD2

* rename setFrameFlag() method

* move storeAndReset() to end of update()

* change order of determineMode() checks

* add init code as a determineMode() check

* add BLOCKING modifier to frameFlagTypes

* add frameFlags to LOG_DEBUG() messages

* function macro for tidier addFramFlag() calls

* handle special frames in Screen.cpp

* fix fallback behavior for unmodified GxEPD2
Issues exposed by meshtastic#3356 (comment)

* while drafting, build from todd-herbert/meshtastic-GxEPD2#async

* reorder determineMode() checks

* Swap Wireless Paper V1.0 dependency to meshtastic/GxEPD2

* purge unused enum val

* refactor: remove ACKs in range tests so zero hops is honored (meshtastic#3374)

* fix heap use after delete (meshtastic#3373)

* fix of tryfix SHT31 sensor (meshtastic#3377)

* Don't spam logs if no position with map reporting (meshtastic#3378)

---------

Co-authored-by: Todd Herbert <herbert.todd@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Andre K <andrekir@pm.me>
Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
@todd-herbert todd-herbert deleted the eink-async branch March 18, 2024 12:07
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.

None yet

3 participants