Hi @digodigo, this works for me as well. Thanks for the input to the author, btw!
In my case download is reliable every time, so I’d personally check network environment, screenshots (maybe try on a small dash with only few elements?) and the way they are generated (I am using the lanrat/hass-screenshot container to create screenshots).
@lanrat: It’s finally working!
The recent issue could be resolved by switching hass-screenshot from realtime
to cron
. It seems like generating the screenshot image took too long or the grace period of the newer hardware is more strict than the one of the older devices.
Anyhow: now it seems to run like clockwork. Thanks for the very decent project and the work you put into it!
@lanrat I saw this project a few weeks ago, and was so excited I ordered an inkplate 10 for my wife for Mother’s Day (same one as @digodigo above).
I have been struggling to get it working.
I am able to get the writing to work in PlatformIO (via VS code). I have created a dashboard that updates properly in a browser.
I cannot get anything to appear on the screen. Nothing at all. I was able to locate the MAC address for the esp32 and it is connecting to my Wi-Fi network properly. Homeplate is showing in Home Assistant through MQTT.
Any ideas?
Hi @michael, thanks for the reply. I wasnt sure how to do that but figured it out, that gets me about half way working. I was able to get the Wi-Fi QR code and info to show. just not the dashboard.
--- Terminal on COM4 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
07:24:16.901 >
07:24:16.901 >
07:24:16.901 > [SETUP] starting, version(May 28 2023, 07:22:56) boot: 0
07:24:16.901 > ESP Chip information:
07:24:16.901 > This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision 3, 4MB external flash
07:24:16.901 > Minimum free heap size: 4414903 bytes
07:24:16.901 > Heap summary for capabilities 0x00000C06:
07:24:16.901 > Totals:
07:24:16.901 > free 0 allocated 0 min_free 0 largest_free_block 0
07:24:16.901 > [ACTIVITY] startActivity(1) put into queue
07:24:16.901 > [STATUS] Boot 1 normal
07:24:16.901 > [SETUP] Battery: 100% (4.21v)
07:24:17.337 > [SETUP] starting button task
07:24:17.337 > [INPUT] Input monitoring not supported by this platform
07:24:17.342 > [SETUP] starting time task
07:24:17.345 > [TIME] local time (3) 00:00:03 Thursday, January 01 1970
07:24:17.351 > [SETUP] starting WiFi task
07:24:17.353 > [WIFI] Connecting...
07:24:17.353 > [SETUP] starting OTA task
07:24:17.356 > [SETUP] starting MQTT task
07:24:17.359 > [MQTT] starting MQTT
07:24:17.362 > [SETUP] starting sleep task
07:24:17.365 > [SETUP] starting activities task
07:24:17.367 > [ACTIVITY] starting activity: 1
07:24:17.370 > [SLEEP] delaying sleep for 15 seconds
07:24:17.537 > [WIFI] Connected to AP successfully!
07:24:18.087 > [WIFI] IP address: 192.168.5.52
07:24:18.089 > [STATUS] WiFi connected
07:24:18.096 > [TIME] Syncing RTC to NTP
07:24:18.100 > [MQTT] Connecting to MQTT...
07:24:18.121 > [OTA] OTA ready
07:24:18.122 > [SLEEP] delaying sleep for 20 seconds
07:24:18.125 > [STATUS] Downloading image...
07:24:18.183 > [WIFI] Connected: 192.168.5.52
07:24:18.201 > [MQTT] Connected to MQTT.
07:24:18.201 > [MQTT] Session present: 0
07:24:18.204 > [MQTT] Subscribing at QoS 2, packetId: 1
07:24:18.210 > [MQTT] Sending MQTT Config
07:24:18.210 > [MQTT] Connected
07:24:18.213 > [MQTT] Subscribe acknowledged: packetId: 1 qos: 2
07:24:19.127 > [TIME] NTP Sync failed
07:24:19.361 > [MQTT] sending status update
07:24:19.362 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/boot/state] {"boot":1,"activity_count":1,"boot_reason":"normal"}
07:24:19.573 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/wifi_signal/state] {"signal":-65}
07:24:20.154 > [IMAGE] Downloading image: http://192.168.5.3:5000/
07:24:20.157 > [ 6088][E][WiFiClient.cpp:313] setSocketOption(): fail on -1, errno: 9, "Bad file number"
07:24:20.170 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/temperature/state] {"temperature":21}
07:24:20.182 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/battery/state] {"voltage":4.21,"battery":100}
07:24:20.469 > [IMAGE] Download done
07:24:20.469 > [STATUS] Rendering image...
07:24:21.584 > [STATUS] Image display error
07:24:22.633 > [IMAGE] displaying....
07:24:24.506 > [IMAGE] displaying done.
07:24:25.182 > [MQTT] sending status update
07:24:25.183 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/boot/state] {"boot":1,"activity_count":1,"boot_reason":"normal"}
07:24:25.396 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/wifi_signal/state] {"signal":-65}
07:24:25.414 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/temperature/state] {"temperature":21}
07:24:25.423 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/battery/state] {"voltage":4.21,"battery":100}
07:24:38.361 > [ACTIVITY] startActivity(0) put into queue
07:24:38.364 > [ACTIVITY] starting activity: 0
07:24:38.367 > [SLEEP] prepping for sleep
07:24:38.369 > [MQTT] Stopping and disconnecting...
07:24:38.372 > [MQTT] Disconnected from MQTT.
07:24:38.375 > [WIFI] Stopping and disconnecting...
07:24:38.378 > [WIFI] Disconnected from WiFi access point
07:24:38.381 > [WIFI] WiFi lost connection. Reason: 8
07:24:38.388 > [SLEEP] entering sleep for 120 seconds (2 min)
07:24:38.389 >
07:24:38.389 >
07:24:38.425 > [MQTT] sending status update
Quasi - related, I am also using the HA HomePlate Card (copy and past from this link) and some of the sensors are not showing, which isn’t a big deal. However - the text input box for the message doesn’t show (which would be fun), and i’m curious what the formatting would look like for the image input as well.
Thank you again for the support!!!
For the sake of making sure to answer any questions as it may be relevant - the docker compose:
services:
app:
image: sibbl/hass-lovelace-kindle-screensaver:latest
environment:
- HA_BASE_URL=https://sub.domain.com
- HA_SCREENSHOT_URL=/lovelace/for-inkplate?kiosk=
- HA_ACCESS_TOKEN=sillylongstring
- CRON_JOB=*/20 * * * *
- RENDERING_TIMEOUT=10000
- RENDERING_DELAY=0
- RENDERING_SCREEN_HEIGHT=825
- RENDERING_SCREEN_WIDTH=1200
- GRAYSCALE_DEPTH=8
- OUTPUT_PATH=/output/output.jpg
- LANGUAGE=en
- UNSAFE_IGNORE_CERTIFICATE_ERRORS=true
- TZ=America/Chicago
ports:
- 5000:5000
volumes:
- ./output/:/output
There are plenty differences to my setup, so I better will just post my docker-compose for comparison and troubleshooting. But if I’d guess it should be png, not jpg.
version: '3.7'
services:
hass-screenshot:
container_name: hass-screenshot
image: lanrat/hass-screenshot
deploy:
resources:
limits:
memory: 1G
environment:
- TZ=Europe/Berlin
- HA_BASE_URL=http://internalip:8123
- HA_ACCESS_TOKEN=prettylongtokenfromha
- LANGUAGE=en
- MQTT_SERVER=internalip
- MQTT_USERNAME=scr
- MQTT_PASSWORD=pass
- REAL_TIME=false
- CRON_JOB=* * * * *
- RENDERING_DELAY=2
- COLOR_MODE=GrayScale
# - DITHER=false
# image 1
- HA_SCREENSHOT_URL=/hm-dash/0?kiosk
- RENDERING_SCREEN_HEIGHT=820
- RENDERING_SCREEN_WIDTH=1200
- GRAYSCALE_DEPTH=3
# image 2
# - HA_SCREENSHOT_URL_2=/lovelace-infra/hud2?kiosk
# - RENDERING_SCREEN_HEIGHT_2=800
# - RENDERING_SCREEN_WIDTH_2=600
# - GRAYSCALE_DEPTH_2=4
# image 3
# - HA_SCREENSHOT_URL_3=/lovelace-infra/hud3?kiosk
# - RENDERING_SCREEN_HEIGHT_3=800
# - RENDERING_SCREEN_WIDTH_3=600
# - GRAYSCALE_DEPTH_3=4
restart: unless-stopped
ports:
- 5000:5000
healthcheck:
test: "wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1"
interval: 60s
timeout: 5s
retries: 3
start_period: 60s
I spin up a fresh container with small modifications to yours. That’s one of the glories of docker, easy to test something different.
Thanks!
Tried it… Something isn’t working right with the rendering the screenshots.
[5/28/2023, 5:30:22 PM] Rendering https://sub.domain.com/lovelace/for-inkplate?kiosk= to image…
[5/28/2023, 5:30:32 PM] Failed to render Home Assistant
[5/28/2023, 5:30:32 PM] Error: TimeoutError: waiting for selector home-assistant
failed: timeout 7660ms exceeded
services:
hass-screenshot:
container_name: hass-screenshot
image: lanrat/hass-screenshot
deploy:
resources:
limits:
memory: 1G
environment:
- TZ=US/CHICAGO
- HA_BASE_URL=https://sub.domain.com
- HA_ACCESS_TOKEN=longtoken
- LANGUAGE=en
- MQTT_SERVER=192.168.5.5
- MQTT_USERNAME=mqttuser
- MQTT_PASSWORD=mqttpass
- REAL_TIME=false
- CRON_JOB=* * * * *
- RENDERING_DELAY=4
- COLOR_MODE=GrayScale
# - DITHER=false
# image 1
- HA_SCREENSHOT_URL=/lovelace/for-inkplate?kiosk=
- RENDERING_SCREEN_HEIGHT=820
- RENDERING_SCREEN_WIDTH=1200
- GRAYSCALE_DEPTH=3
# image 2
# - HA_SCREENSHOT_URL_2=/lovelace-infra/hud2?kiosk
# - RENDERING_SCREEN_HEIGHT_2=800
# - RENDERING_SCREEN_WIDTH_2=600
# - GRAYSCALE_DEPTH_2=4
# image 3
# - HA_SCREENSHOT_URL_3=/lovelace-infra/hud3?kiosk
# - RENDERING_SCREEN_HEIGHT_3=800
# - RENDERING_SCREEN_WIDTH_3=600
# - GRAYSCALE_DEPTH_3=4
restart: unless-stopped
ports:
- 5000:5000
Interesting… Considering timeout errors did you try to adjust RENDERING_TIMEOUT value?
Actually checking issues on GitHub for this particular timeout leads to #28 and #53 - in both cases failed auth due to errors in the token. Worth checking?
That did it! I updated the token at it immediately created the screenshot.
Now to get home and update the Inkplate with the new url for the dashboard.
Thanks for the amazing help, and wish me luck!!
Edit: victory! We have success. Thanks again!
Glad this worked! Enjoy your dashboard, it really is a great idea and implementation!
I thought since I asked questions, I better show my end results.
Shows current weather for home, local baseball park (2 miles away but you can see temperature difference) and in-laws house. Below that is current locations for quick glance.
Forecast card in the middle, along with last update time. Went with 20 minute update cycle
Last is the upcoming calendar for the next few days.
Best part of the whole project is the surprise on my wife’s face with the idea.
Future plans will be filling the blank space by editing the card sizes and modifying as ideas come along.
Thanks again @michael for the assistance and @lanrat for the amazing project.
Back again! starting to work on my edits to continue to increase the wife approval factor, and not sure where to begin with this.
I can edit the font sizes using some custom card mods, they appear in the web dashboard (size and color), but not in the kiosk mode.
Any ideas where to begin?
Great project and was exactly what i am looking for.
The price for the InkPlate 10 seems hight, but the quality is great and supporting an open source project feels good.
I have two questions.
-
Is there a way to set a refresh rate from 6am-22pm to every 10min and 22pm-6am to 30min?
I have set a#define TIME_TO_SLEEP_MIN 10
. -
Is it possible to disable the Guest WIFI QR code generation, to save some CPU usage?
Absolutely love this project @lanrat. Took me forever to get it set up but only because I’m completely new to docker containers and even MQTT. I also had a question on disabling the Guest WiFi QR code and also how to disable the clock in the bottom corner? I have my display in a vertical orientation with a card showing the time so it’d be great to get rid of the text in the corner. Thanks!
What test in the corner are you referring to?
There is some debug test that can be disabled. But the WiFi QR code is only shown if enabled in the config and if the button for it is pressed. It should not show by default.
There have been some recent commits/changes that fix the sleep bug and allow you to fully disable the QR code.