Giter VIP home page Giter VIP logo

homeplate's People

Contributors

elratt0r avatar gitlio avatar lanrat avatar mmornati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeplate's Issues

Sleep of 440min gets disrupted

Good morning,

I made the following observation, for the night time I have HA send an mqtt message to the inkplate-10 with a message action, content and a refresh of 440min. However I noticed that the inkplate only sleeps for about 10min and wakes up again.

I the device console it properly logged when I tested it the 440min as interval and also 10min is not configured anywhere (default is 20min). So I was wondering, since I am below the limit of 1 day as I looked through the code it should allow for that long period.

What am I missing?

Cheers
Tuxianer

Incompatible with InkplateLibrary 5.7.0

Something changed in the new InkPlate library causing HomePlate to hang.

Diff: SolderedElectronics/Inkplate-Arduino-library@5.5.1...5.7.0

related: #2

Error boot logs:

07:04:11.991 > [SETUP] starting, version(Mar 25 2022, 07:03:25) boot: 0
07:04:11.993 > ESP Chip information:
07:04:11.996 > This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision 1, 4MB external flash
07:04:12.004 > Minimum free heap size: 4426992 bytes
07:04:12.007 > Heap summary for capabilities 0x00000C06:
07:04:12.010 > Totals:
07:04:12.013 > free 0 allocated 0 min_free 0 largest_free_block 0
07:04:12.018 > [ACTIVITY] startActivity(1) put into queue
07:04:12.021 > Wavefrom load failed! Upload new waveform in EEPROM. Using default waveform.
07:04:12.212 > [STATUS] Boot 1 normal
07:04:14.363 > [SETUP] Battery: 85% (4.54v)
07:04:14.907 > [SETUP] starting button task
07:04:14.907 > [SETUP] starting time task
07:04:14.910 > [TIME] RTC local time (946685005) 1999-12-31 16:03
07:04:14.916 > [SETUP] starting WiFi task
07:04:14.917 > [SETUP] starting OTA task
07:04:14.921 > [SETUP] starting MQTT task
07:04:14.923 > [MQTT] starting MQTT
07:04:14.923 > [SETUP] starting sleep task
07:04:14.926 > [SETUP] starting activities task
07:04:17.907 > [INPUT] Starting input monitoring...

known Good boot logs

10:32:48.265 > [SETUP] starting, version(Mar 19 2022, 10:48:15) boot: 0
10:32:48.268 > ESP Chip information:
10:32:48.271 > This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision 1, 4MB external flash
10:32:48.279 > Minimum free heap size: 4426364 bytes
10:32:48.282 > Heap summary for capabilities 0x00000C06:
10:32:48.284 >   Totals:
10:32:48.287 >     free 0 allocated 0 min_free 0 largest_free_block 0
10:32:48.293 > [ACTIVITY] startActivity(1) put into queue
10:32:48.481 > [STATUS] Boot 1 normal
10:32:50.713 > [SETUP] Battery: 100% (4.86v)
10:32:51.310 > [SETUP] starting button task
10:32:51.311 > [SETUP] starting time task
10:32:51.313 > [TIME] RTC local time (1648229516) 2022-03-25 10:31
10:32:51.319 > [SETUP] starting WiFi task
10:32:51.322 > [WIFI] Connecting...
10:32:51.324 > [SETUP] starting OTA task
10:32:51.324 > [SETUP] starting MQTT task
10:32:51.327 > [MQTT] starting MQTT
10:32:51.330 > [SETUP] starting sleep task
10:32:51.333 > [SETUP] starting activities task
10:32:51.335 > [ACTIVITY] starting activity: 1
10:32:51.338 > [SLEEP] delaying sleep for 15 seconds
10:32:53.327 > [MQTT] sending status update
10:32:53.559 > [WIFI] IP address: 192.168.2.189
10:32:53.562 > [STATUS] WiFi connected
10:32:53.562 > [TIME] Syncing RTC to NTP
10:32:53.575 > [MQTT] Connecting to MQTT...
10:32:53.583 > [SLEEP] delaying sleep for 20 seconds
10:32:53.585 > [STATUS] Downloading image...
10:32:53.589 > [OTA] OTA ready
10:32:53.638 > [MQTT] Connected to MQTT.
10:32:53.638 > [MQTT] Session present: 0
10:32:53.641 > [MQTT] Subscribing at QoS 2, packetId: 1
10:32:53.648 > [MQTT] Sending MQTT Config
10:32:53.655 > [MQTT] Subscribe acknowledged: packetId: 1 qos: 2 
10:32:53.683 > [MQTT] Connected
10:32:53.712 > [WIFI] Connected: 192.168.2.189
10:32:53.828 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/boot/state] {"boot":1,"activity_count":1,"boot_reason":"normal"}
10:32:53.836 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/version/state] {"version":"Mar 19 2022, 10:48:15"}
10:32:54.042 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/homeplate_wifi/state] {"signal":-35}
10:32:54.322 > [INPUT] Starting input monitoring...
10:32:54.829 > [WIFI] IP address: 192.168.2.189
10:32:54.833 > [STATUS] WiFi connected
10:32:56.060 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/temperature/state] {"temperature":20}
10:32:57.264 > [W][HTTPClient.cpp:828] getStream(): getStream: not connected
10:32:57.266 > [E][WiFiClient.cpp:309] setOption(): fail on fd -1, errno: 9, "Bad file number"
10:32:57.275 > [W][HTTPClient.cpp:828] getStream(): getStream: not connected
10:32:57.280 > [E][WiFiClient.cpp:288] setSocketOption(): 1006 : 9
10:32:57.287 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/battery/state] {"voltage":4.86,"battery":100}
10:32:57.295 > [TIME] RTC local time (1648229576) 2022-03-25 10:32
10:32:57.662 > [IMAGE] Download done
10:32:57.662 > [STATUS] Rendering image...
10:33:02.609 > [IMAGE] Image render ready
10:33:02.609 > [IMAGE] displaying....
10:33:04.496 > [IMAGE] displaying done.
10:33:05.288 > [MQTT] sending status update
10:33:05.289 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/boot/state] {"boot":1,"activity_count":1,"boot_reason":"normal"}
10:33:05.300 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/version/state] {"version":"Mar 19 2022, 10:48:15"}
10:33:05.501 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/homeplate_wifi/state] {"signal":-39}
10:33:05.523 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/temperature/state] {"temperature":20}
10:33:05.531 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/battery/state] {"voltage":4.88,"battery":100}
10:33:14.325 > [ACTIVITY] startActivity(0) put into queue
10:33:14.328 > [ACTIVITY] starting activity: 0
10:33:14.331 > [SLEEP] prepping for sleep
10:33:14.333 > [MQTT] Stopping and disconnecting...
10:33:14.336 > [MQTT] Disconnected from MQTT.
10:33:14.339 > [WIFI] Stopping and disconnecting...
10:33:14.381 > [SLEEP] entering sleep for 1200 seconds (20 min)

Build currently fails

Building with the vs code pio plugin in a windows environment results in the following. Looking at the dependency graph, it's pulling in the versions specified in the platformio.ini, so I'm guessing something has changed in the platformio framework?

Let me know if I can supply any further info, this is my first foray into platformio.

> Executing task: platformio run <

Processing esp32 (platform: https://github.com/platformio/platform-espressif32.git; framework: arduino; board: esp32dev)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.1.0+sha.e34a21b) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 3.20002.0 (2.0.2) 
 - tool-esptoolpy 1.30100.210531 (3.1.0) 
 - tool-mkfatfs 2.0.1 
 - tool-mklittlefs 1.203.210628 (2.3) 
 - tool-mkspiffs 2.230.0 (2.30) 
 - toolchain-xtensa-esp32 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 39 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <InkplateLibrary> 5.7.0+sha.9339478
|   |-- <SPI> 2.0.0
|   |-- <Wire> 2.0.0
|   |-- <HTTPClient> 2.0.0
|   |   |-- <WiFi> 2.0.0
|   |   |-- <WiFiClientSecure> 2.0.0
|   |   |   |-- <WiFi> 2.0.0
|   |-- <WiFi> 2.0.0
|   |-- <EEPROM> 2.0.0
|-- <NTPClient> 3.1.0
|-- <Time> 1.6.1
|-- <Timezone> 1.2.4
|   |-- <Time> 1.6.1
|-- <QRCode> 0.0.1
|-- <AsyncMqttClient> 0.9.0
|   |-- <AsyncTCP> 1.1.1
|-- <ArduinoJson> 6.19.4
|-- <WiFi> 2.0.0
|-- <ArduinoOTA> 2.0.0
|   |-- <Update> 2.0.0
|   |-- <WiFi> 2.0.0
|   |-- <ESPmDNS> 2.0.0
|   |   |-- <WiFi> 2.0.0
Building in release mode
Compiling .pio/build/esp32/src/network.cpp.o
Archiving .pio/build/esp32/libcbf/libWiFi.a
Indexing .pio/build/esp32/libcbf/libWiFi.a
Archiving .pio/build/esp32/liba3a/libWiFiClientSecure.a
Indexing .pio/build/esp32/liba3a/libWiFiClientSecure.a
src/network.cpp: In function 'void WiFiStationDisconnected(arduino_event_id_t, arduino_event_info_t)':
src/network.cpp:44:25: error: 'union arduino_event_info_t' has no member named 'disconnected'; did you mean 'eth_connected'?
     Serial.println(info.disconnected.reason);
                         ^~~~~~~~~~~~
                         eth_connected
src/network.cpp: In function 'void wifiConnectTask()':
src/network.cpp:111:66: error: no matching function for call to 'WiFiClass::onEvent(void (&)(arduino_event_id_t, arduino_event_info_t), system_event_id_t)'
     WiFi.onEvent(WiFiStationConnected, SYSTEM_EVENT_STA_CONNECTED);
                                                                  ^
In file included from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiSTA.h:28,
                 from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFi.h:32,
                 from src/network.cpp:1:
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventFuncCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventSysCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventSysCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
src/network.cpp:112:52: error: no matching function for call to 'WiFiClass::onEvent(void (&)(arduino_event_id_t, arduino_event_info_t), system_event_id_t)'
     WiFi.onEvent(WiFiGotIP, SYSTEM_EVENT_STA_GOT_IP);
                                                    ^
In file included from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiSTA.h:28,
                 from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFi.h:32,
                 from src/network.cpp:1:
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventFuncCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventSysCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventSysCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
src/network.cpp:113:72: error: no matching function for call to 'WiFiClass::onEvent(void (&)(arduino_event_id_t, arduino_event_info_t), system_event_id_t)'
     WiFi.onEvent(WiFiStationDisconnected, SYSTEM_EVENT_STA_DISCONNECTED);
                                                                        ^
In file included from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiSTA.h:28,
                 from /home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFi.h:32,
                 from src/network.cpp:1:
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:147:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventFuncCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:148:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventSysCb, arduino_event_id_t)'
     wifi_event_id_t onEvent(WiFiEventSysCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);
                     ^~~~~~~
/home/ryan/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:149:21: note:   no known conversion for argument 2 from 'system_event_id_t' to 'arduino_event_id_t'
Archiving .pio/build/esp32/lib1b7/libHTTPClient.a
Indexing .pio/build/esp32/lib1b7/libHTTPClient.a
Archiving .pio/build/esp32/lib483/libEEPROM.a
Indexing .pio/build/esp32/lib483/libEEPROM.a
Compiling .pio/build/esp32/lib478/InkplateLibrary/boards/Inkplate2.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/boards/Inkplate5.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/boards/Inkplate6.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/boards/Inkplate6Color.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/boards/Inkplate6plus.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/include/Esp.cpp.o
Compiling .pio/build/esp32/lib478/InkplateLibrary/include/Frontlight.cpp.o
*** [.pio/build/esp32/src/network.cpp.o] Error 1
========================================================================================= [FAILED] Took 1.98 seconds =========================================================================================

Environment    Status    Duration
-------------  --------  ------------
esp32          FAILED    00:00:01.982
=================================================================================== 1 failed, 0 succeeded in 00:00:01.982 ===================================================================================
The terminal process "platformio 'run'" terminated with exit code: 1.

inkplate 10 doesn't show any image

Hello,
got my Inkplate 10 today, seting all up but it doesn't show any picture.
still have the "welcome to ihnkplate" screen.

The Logs said:

21:23:56.558 > [IMAGE] Downloading image: http://192.168.2.28:5000/1.png
21:23:56.563 > [  9036][E][WiFiClient.cpp:320] setSocketOption(): fail on -1, errno: 9, "Bad file number"
21:23:56.569 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/battery/state] {"voltage":0.28,"battery":0}
21:23:56.766 > [IMAGE] Download done
21:23:56.766 > [STATUS] Rendering image...
21:23:57.801 > [ 10282][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
21:23:58.827 > [ 11307][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
21:24:02.692 > [IMAGE] Image render ready
21:24:02.692 > [IMAGE] displaying....
21:24:03.703 > [ 16184][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263
21:24:03.954 > [IMAGE] displaying done.

The MQTT values have arrived in home assistant. Beside the temperature.
(maye thats the i2cRead error?)

Edit:
i think i have v1.3.1 , maye thats the Problem?

MQTT Entity Names include Device Name

I've noticed some warning logs (see below) in the Home Assistant logs. I've identified the root cause as this line: https://github.com/lanrat/homeplate/blob/191fc8b007c00d2e3723af7ffd220de82d0ac7cb/src/mqtt.cpp#L14C9-L14C18

I think mqtt_name doesn't serve a purpose, usages of it should be removed and the names should be passed directly into the mqtt StaticJsonDocument without prepending the device name.

2023-10-27 11:48:40.373 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'unique_id': 'homeplate_activity_count', 'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>, 'name': 'HomePlate Activity Count', 'state_topic': 'homeassistant/sensor/homeplate/boot/state', 'unit_of_measurement': 'activities', 'icon': 'mdi:chart-line-variant', 'value_template': Template<template=({{ value_json.activity_count }}) renders=0>, 'expire_after': 3600, 'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>, 'enabled_by_default': False, 'device': {'manufacturer': 'e-radionica', 'model': 'Inkplate 10', 'name': 'HomePlate', 'sw_version': 'Oct 15 2023, 20:28:10', 'identifiers': ['homeplate', '9C:9C:1F:F3:2F:84'], 'connections': []}, 'force_update': False, 'payload_available': 'online', 'encoding': 'utf-8', 'availability_mode': 'latest', 'qos': 0, 'payload_not_available': 'offline'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Activity Count'

Scope Errors During PIO Run

I get the following errors when I do PIO Run in VSCode:

Compiling .pio/build/esp32/src/time.cpp.o
src/image.cpp: In function 'bool hassImage()':
src/image.cpp:23:42: error: 'IMAGE_URL' was not declared in this scope
uint8_t buff = display.downloadFile(IMAGE_URL, &defaultLen);
^~~~~~~~~
src/info.cpp: In function 'void displayInfoScreen()':
src/info.cpp:212:20: error: 'MQTT_HOST' was not declared in this scope
display.printf(MQTT_HOST);
^~~~~~~~~
src/info.cpp:231:20: error: 'NTP_SERVER' was not declared in this scope
display.printf(NTP_SERVER);
^~~~~~~~~~
src/info.cpp:231:20: note: suggested alternative: 'SNTP_SERVER_DNS'
display.printf(NTP_SERVER);
^~~~~~~~~~
SNTP_SERVER_DNS
*** [.pio/build/esp32/src/image.cpp.o] Error 1
*** [.pio/build/esp32/src/info.cpp.o] Error 1
src/main.cpp: In function 'void setup()':
src/main.cpp:44:22: error: 'TOUCHPAD_ENABLE' was not declared in this scope
if (sleepBoot && TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
src/main.cpp:44:22: note: suggested alternative: 'TOUCH_PAD_MAX'
if (sleepBoot && TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
TOUCH_PAD_MAX
src/input.cpp: In function 'void checkButtons(void
)':
src/input.cpp:51:13: error: 'TOUCHPAD_ENABLE' was not declared in this scope
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
src/input.cpp:51:13: note: suggested alternative: 'TOUCH_PAD_MAX'
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
TOUCH_PAD_MAX
*** [.pio/build/esp32/src/main.cpp.o] Error 1
*** [.pio/build/esp32/src/input.cpp.o] Error 1
src/network.cpp: In function 'void keepWiFiAlive(void*)':
src/network.cpp:63:26: error: 'HOSTNAME' was not declared in this scope
WiFi.setHostname(HOSTNAME); // only works with DHCP....
^~~~~~~~
src/network.cpp:63:26: note: suggested alternative: 'ESTALE'
WiFi.setHostname(HOSTNAME); // only works with DHCP....
^~~~~~~~
ESTALE
src/network.cpp:64:20: error: 'WIFI_SSID' was not declared in this scope
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
^~~~~~~~~
src/network.cpp:64:20: note: suggested alternative: 'WIFI_STA'
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
^~~~~~~~~
WIFI_STA
src/network.cpp:64:31: error: 'WIFI_PASSWORD' was not declared in this scope
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
^~~~~~~~~~~~~
src/network.cpp:64:31: note: suggested alternative: 'WIFI_PS_NONE'
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
^~~~~~~~~~~~~
WIFI_PS_NONE
src/ota.cpp: In function 'void startOTATask()':
src/ota.cpp:40:28: error: 'HOSTNAME' was not declared in this scope
ArduinoOTA.setHostname(HOSTNAME);
^~~~~~~~
src/ota.cpp:40:28: note: suggested alternative: 'ESTALE'
ArduinoOTA.setHostname(HOSTNAME);
^~~~~~~~
ESTALE
src/qr.cpp: In function 'void displayWiFiQR()':
src/qr.cpp:11:51: error: 'QR_WIFI_NAME' was not declared in this scope
snprintf(buf, 1024, "WIFI:S:%s;T:WPA;P:%s;;", QR_WIFI_NAME, QR_WIFI_PASSWORD);
^~~~~~~~~~~~
src/qr.cpp:11:51: note: suggested alternative: 'WIFI_AP'
snprintf(buf, 1024, "WIFI:S:%s;T:WPA;P:%s;;", QR_WIFI_NAME, QR_WIFI_PASSWORD);
^~~~~~~~~~~~
WIFI_AP
src/qr.cpp:11:65: error: 'QR_WIFI_PASSWORD' was not declared in this scope
snprintf(buf, 1024, "WIFI:S:%s;T:WPA;P:%s;;", QR_WIFI_NAME, QR_WIFI_PASSWORD);
^~~~~~~~~~~~~~~~
*** [.pio/build/esp32/src/network.cpp.o] Error 1
src/sleep.cpp: In function 'void gotoSleepNow()':
src/sleep.cpp:31:9: error: 'TOUCHPAD_ENABLE' was not declared in this scope
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
src/qr.cpp:11:65: note: suggested alternative: 'WIFI_PS_NONE'
snprintf(buf, 1024, "WIFI:S:%s;T:WPA;P:%s;;", QR_WIFI_NAME, QR_WIFI_PASSWORD);
^~~~~~~~~~~~~~~~
WIFI_PS_NONE
src/sleep.cpp:31:9: note: suggested alternative: 'TOUCH_PAD_MAX'
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
TOUCH_PAD_MAX
src/sleep.cpp:40:9: error: 'TOUCHPAD_ENABLE' was not declared in this scope
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
src/sleep.cpp:40:9: note: suggested alternative: 'TOUCH_PAD_MAX'
if (TOUCHPAD_ENABLE)
^~~~~~~~~~~~~~~
TOUCH_PAD_MAX
*** [.pio/build/esp32/src/ota.cpp.o] Error 1
src/time.cpp: In function 'void ntpSync(void*)':
src/time.cpp:23:34: error: 'NTP_SERVER' was not declared in this scope
NTPClient timeClient(ntpUDP, NTP_SERVER);
^~~~~~~~~~
src/time.cpp:23:34: note: suggested alternative: 'SNTP_SERVER_DNS'
NTPClient timeClient(ntpUDP, NTP_SERVER);
^~~~~~~~~~
SNTP_SERVER_DNS
*** [.pio/build/esp32/src/qr.cpp.o] Error 1
*** [.pio/build/esp32/src/sleep.cpp.o] Error 1
*** [.pio/build/esp32/src/time.cpp.o] Error 1
src/mqtt.cpp: In function 'void startMQTTTask()':
src/mqtt.cpp:442:26: error: 'HOSTNAME' was not declared in this scope
mqttClient.setClientId(HOSTNAME);
^~~~~~~~
src/mqtt.cpp:442:26: note: suggested alternative: 'ESTALE'
mqttClient.setClientId(HOSTNAME);
^~~~~~~~
ESTALE
src/mqtt.cpp:443:24: error: 'MQTT_HOST' was not declared in this scope
mqttClient.setServer(MQTT_HOST, MQTT_PORT);
^~~~~~~~~
src/mqtt.cpp:443:35: error: 'MQTT_PORT' was not declared in this scope
mqttClient.setServer(MQTT_HOST, MQTT_PORT);
^~~~~~~~~
src/mqtt.cpp:443:35: note: suggested alternative: 'NOT_A_PORT'
mqttClient.setServer(MQTT_HOST, MQTT_PORT);
^~~~~~~~~
NOT_A_PORT
*** [.pio/build/esp32/src/mqtt.cpp.o] Error 1

Inkplate 10 'Bad file number' error on image download

I'm trying to set up an Inkplate 10 (v2), and I'm hosting a home assistant dashboard screenshot using sibbl/hass-lovelace-kindle-screensaver with the below configuration.

The firmware is successfully flashed to the device and the display shows "HomePlate" after flashing, but when the process tries to download the image from the server I get the error below. Why is this? Is the image server misconfigured somehow? I'm not sure what to make of the message Bad file number. I can successfully download the png image from the server using wget, curl or a web browser.

Full log from startup: https://0x0.st/X82m.txt

09:16:54.937 > [IMAGE] Downloading image: http://hass-inkplate.example.com
09:16:54.940 > [  6942][E][WiFiClient.cpp:320] setSocketOption(): fail on -1, errno: 9, "Bad file number"
09:16:59.960 > [IMAGE] Download failed
09:16:59.960 > [STATUS] Download failed!
HA_BASE_URL=https://homeassistant.example.com
HA_SCREENSHOT_URL=/dashboard-inkplate/0?kiosk
HA_ACCESS_TOKEN={{}}
CRON_JOB=* * * * *
RENDERING_TIMEOUT=30000
RENDERING_DELAY=0
RENDERING_SCREEN_HEIGHT=820
RENDERING_SCREEN_WIDTH=1200
GRAYSCALE_DEPTH=5
OUTPUT_PATH=/output
LANGUAGE=en
ROTATION=0
SCALING=1

Disable WIFI QR generation

Hello,
is there a way to disable the WIFI QR code generation?
I do not use this feature.
Comment the part in the config caused an error.

Thank you for this great project.

Timezone always stuck in one timezone

Because epoch is initialized with 0 here

time_t epoch = 0;

the tzOffset always returns the first DST-Parameter.
tzOffset should be called with the current unix time, and then returning the matching offset to put in rtc.offset:

time_t tzOffset(time_t epoch) {
    TimeChangeRule *tcr;
    time_t offset = epoch - tz.toLocal(epoch, &tcr);
    return offset
}

rtc.offset = tzOffset(rtc.getLocalEpoch());

Furthermore, the i2c rtc is not used anymore to set the esp32 time.
I would suggest to set ESP32 RTC from i2c RTC on startup.

epoch = display.rtcGetEpoch();
rtc.setTime(epoch)

Document recommended image settings

Hey,

I was wondering if you would be willing to document the config you used for hass-lovelace-kindle-screensaver.
I'm having issues with the image captured from mine looks extremely washed out on my inkplate, regardless of the greyscale setting I use.

I have updated the waveform on my device, which was a slight improvement, but there's still a noticeable difference when flicking between the homeplate info screen and the lovelace image

Inkplate6 color

hello

I think this has been asked before, but would you consider support for Inkplate6 color? Or know of anyone who has done it?

Stuck on input monitoring

Hey lanrat,

I managed to flash your homeplate software to my Inkplate, but after configuring it, it's stuck at "[INPUT] Starting input monitoring..." in the serial console - checking in my router, I don't see a wifi connection happening. This is the full boot log:

07:04:11.991 > [SETUP] starting, version(Mar 25 2022, 07:03:25) boot: 0
07:04:11.993 > ESP Chip information:
07:04:11.996 > This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision 1, 4MB external flash
07:04:12.004 > Minimum free heap size: 4426992 bytes
07:04:12.007 > Heap summary for capabilities 0x00000C06:
07:04:12.010 > Totals:
07:04:12.013 > free 0 allocated 0 min_free 0 largest_free_block 0
07:04:12.018 > [ACTIVITY] startActivity(1) put into queue
07:04:12.021 > Wavefrom load failed! Upload new waveform in EEPROM. Using default waveform.
07:04:12.212 > [STATUS] Boot 1 normal
07:04:14.363 > [SETUP] Battery: 85% (4.54v)
07:04:14.907 > [SETUP] starting button task
07:04:14.907 > [SETUP] starting time task
07:04:14.910 > [TIME] RTC local time (946685005) 1999-12-31 16:03
07:04:14.916 > [SETUP] starting WiFi task
07:04:14.917 > [SETUP] starting OTA task
07:04:14.921 > [SETUP] starting MQTT task
07:04:14.923 > [MQTT] starting MQTT
07:04:14.923 > [SETUP] starting sleep task
07:04:14.926 > [SETUP] starting activities task
07:04:17.907 > [INPUT] Starting input monitoring...

I already double checked my wifi-credentials but that is perfectly fine...

Thanks in advance,

Epi

Compile error NTP_SYNC_INTERVAL

I tried to update my installation with

git pull
pio upgrade
pio pkg update
pio run --target clean
pio run

I get the following compile error

Compiling .pio/build/inkplate10/lib767/Wire/Wire.cpp.o
src/time.cpp: In function 'void setupTimeAndSyncTask()':
src/time.cpp:102:38: error: 'NTP_SYNC_INTERVAL' was not declared in this scope
         bool resync = ((bootCount % (NTP_SYNC_INTERVAL)) == 0);
                                      ^~~~~~~~~~~~~~~~~
src/time.cpp:102:38: note: suggested alternative: 'TCP_TMR_INTERVAL'
         bool resync = ((bootCount % (NTP_SYNC_INTERVAL)) == 0);
                                      ^~~~~~~~~~~~~~~~~
                                      TCP_TMR_INTERVAL
*** [.pio/build/inkplate10/src/time.cpp.o] Error 1
Esp32ExceptionDecoder: firmware at /opt/homeplate/.pio/build/inkplate10/firmware.elf does not exist, rebuild the project?

Support for 6Plus/6Color

Is it possible to add support for 6plus and 6color? The 6 plus supports a touch panel interface while including a front light and the 6 color supports 7 colors. Thank you!

Homeplate waking up every 2mins but it should sleep for hours

First of all - love the project! I have my Inkplate 10 running a monthly calendar.
It runs on a 2600mAh battery and I'd like it to refresh a couple times (3-4 times) a day.

I set the homeplate.h parameter to sleep for 360mins and 120mins:

#define TIME_TO_SLEEP_SEC 360 * 60      // 360 instead of 20 minutes. How long ESP32 will be in deep sleep (in seconds)
#define TIME_TO_QUICK_SLEEP_SEC 120 * 60 // 120 instead of 5 minutes. How long ESP32 will be in deep sleep (in seconds)

but it seems to wake up every 2 mins:

17:03:19.628 >
17:03:19.628 >
17:05:24.100 > ets Jun  8 2016 00:22:57
17:05:24.101 >
17:05:24.101 > rst:0x5 (DEEPSLEEP_RESET),boot:0x32 (SPI_FAST_FLASH_BOOT)
17:05:24.107 > configsip: 0, SPIWP:0xee
17:05:24.109 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
17:05:24.114 > mode:DIO, clock div:2
17:05:24.117 > load:0x3fff0030,len:1184
17:05:24.120 > load:0x40078000,len:13132
17:05:24.123 > load:0x40080400,len:3036
17:05:24.125 > entry 0x400805e4
17:05:24.635 > 
17:05:24.636 > 
17:05:24.636 > [SETUP] starting, version(Oct 31 2022, 23:06:13) boot: 2
17:05:24.637 > [ACTIVITY] startActivity(1) put into queue
17:05:24.748 > [STATUS] Boot 3 timer
17:05:25.755 > [SETUP] Battery: 100% (4.72v)
17:05:25.756 > [SETUP] starting button task
17:05:25.758 > [SETUP] starting time task
17:05:25.761 > [TIME] RTC local time (1667340322) 2022-11-01 17:05
17:05:25.766 > [SETUP] starting WiFi task
17:05:25.769 > [WIFI] Connecting...
17:05:25.769 > [SETUP] starting OTA task
17:05:25.772 > [SETUP] starting MQTT task
17:05:25.775 > [MQTT] starting MQTT
17:05:25.778 > [SETUP] starting sleep task
17:05:25.780 > [SETUP] starting activities task
17:05:25.783 > [ACTIVITY] starting activity: 1
17:05:25.786 > [SLEEP] delaying sleep for 15 seconds
17:05:25.861 > [WIFI] Connected to AP successfully!
17:05:25.864 > [WIFI] IP address: 192.168.1.230
17:05:25.868 > [STATUS] WiFi connected
17:05:25.941 > [WIFI] Connected: 192.168.1.230
17:05:26.025 > [MQTT] Connecting to MQTT...
17:05:26.033 > [SLEEP] delaying sleep for 20 seconds
17:05:26.036 > [STATUS] Downloading image...
17:05:26.044 > [OTA] OTA ready
17:05:26.050 > [MQTT] Connected to MQTT.
17:05:26.051 > [MQTT] Session present: 0
17:05:26.053 > [MQTT] Subscribing at QoS 2, packetId: 1
17:05:26.059 > [MQTT] Sending MQTT Config
17:05:26.059 > [MQTT] Subscribe acknowledged: packetId: 1 qos: 2 
17:05:26.127 > [MQTT] Connected
17:05:27.784 > [MQTT] sending status update
17:05:27.784 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/boot/state] {"boot":3,"activity_count":1,"boot_reason":"timer"}
17:05:27.794 > [MQTT] Sending MQTT State: [homeassistant/sensor/homeplate/version/state] {"version":"Oct 31 2022, 23:06:16"}```

Just a question about MQTT push and sleep

Greetings... I set this up and actually modified what I'm doing to not integrate with homeassistant, but still using many of the bits of funcitonality (code is still largely identical).

My question is that there seems to be functionality to tell it to change display mode via mqtt. I assume since wifi is disconnected while device is sleeping, its basically going to just check for messages when it wakes and do stuff, and ultimately disconnect and sleep again. I assume if you have a 20min sleep interval, and you push a mqtt message to switch to a different screen... you wont acutally see any changes until the device wakes up (as long as 20minutes) and it picks up messages.

Other than question, everything actually seems to be working pretty well.

MQTT broker with username and password

Hi,
First of all, thanks a lot for this project. I was about to put together something similar with the help of some GitHub Repos out there. But this project fulfills all my needs!

However I am using a MQTT broker which needs a username and password to connect to.
It was very easy to implement this, that's why I like to share it here. I'm not so fluent with Git push/pull/change requests and such, therefore I just document the changes I made here:

extend config.h with two lines:

// MQTT Broker
#define MQTT_HOST "x.x.x.x"
#define MQTT_PORT 1883
#define MQTT_USER "mqtt username"
#define MQTT_PASSWORD "mqtt password"

add the line under mqttClient.setServer... in mqtt.cpp - line 415

  mqttClient.setClientId(HOSTNAME);
  mqttClient.setServer(MQTT_HOST, MQTT_PORT);
  mqttClient.setCredentials(MQTT_USER, MQTT_PASSWORD);

Maybe you are able (and willing) to put it into the code base.

Sleep

Hi there

quick question...// How long to sleep between image refreshes
#define TIME_TO_SLEEP_MIN 20. So am I right in thinking...It refreshes, then sleeps for 20 minutes? or refreshes and sleeps after 20 minutes?

Is it possible to disable to sleep function? and push the updates just over MQTT from Home Assistant?

Thanks

read only dashboard configuration

Hey, this inkplate program is great! I've been tinkering around with it, and have everything loading properly, but haven't found a good way to bring a read only Dashboard from Home Assistant in - is there a suggested method for this? I have a basic dashboard created using lovelace card mod, like some of the examples here, but can't find a good resource on making only this dashboard exposed. Or, is there a method with the current API call to include credentials or API token when we try to hit home assistant?

Activity deadlock when action is "hass"

When having a mqtt message pending with {"action": "hass"} and the homeplate boots from timer/wake button, it will start up with activity HomeAssistant, connect to the WiFi, pass the waitForWiFiOrActivityChange() but then during run of remotePNG gets aborted by the stopActivity() because resetActivity = true is set by the incoming mqtt message. The pending activity from mqtt is not run because debounce conditions apply.

I think it should get caugth here instead, but because activityCurrent gets set after the activity is done running, it never applies.

Two ideas for solutions:
Set activityCurrent = activityNext right after accepting the activity to be run (here)

Checking resetActivity after running remotePNG to check if it was aborted and then use "continue" in the while loop instead of falling through and setting activityCurrent = activityNext.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.