Comments (4)
This is a good issue.
First, the answer for your question is NO.
I have struggled with the wtd(watchdog) for a long time before I made this library work.
Actually, the most painful function is the mp_exptmod
in integer.c
.
-
Pair Setup 1/3 (= Preinit) total ~9s
(1)crypto_srp_init
~6s
includes ①mp_exptmod
(winsize=6) ~6s
(2)crypto_srp_get_public_key
~3s
includes ②mp_exptmod
(winsize=5) ~3s -
Pair Setup 2/3 total ~12s
(3)crypto_srp_compute_key
(2 calls of mp_exptmod) ~12s
includes ③mp_exptmod
(winsize=6) ~8s
and ④mp_exptmod
(winsize=5) ~4s
Note: running on CPU@160Mhz.
The watchdogs (both hardware and software watchdog ) are disabled in these (1)(2)(3) functions. And as you can see, the 99% of total time is cost by mp_exptmod
.
The hardware watchdog of ESP8266 is ~8.2s, and the software watchdog is ~3.2. (Refer to esp8266/arduino/watchdogs_en)
I know it is not good to disable the watchdogs for running long time functions since it will lead to a unstable WiFi connection. But in my tests, it did not show any visible bad influence to WiFi connection since these long time functions are not that too long. On the other hand, I am also finding a better way to handle this issue. In my opinion, it is not easy and good to insert yield()
or delay()
in mp_exptmod
.
Anyway, this issue is caused by (the low performance && the ESP8266_NONOS_SDK). Note that the mp_exptmod
on ESP32 is mush faster than ESP8266 even without hardware acceleration.
BTW, the new ESP32-S2 with the following features may be a good replacement of ESP8266 to implement HomeKit projects:
- New Xtensa single-core 32-bit LX7 @240MHz (ESP32 is dual LX6 @240MHz, ESP8266 is L106 @160MHz, maybe ESP32-S2 is even faster than ESP32)
- WiFi only, no Bluetooth, lower price than ESP32 (maybe same as ESP8266)
- Crypto co-processors (will have a hardware accelerated
mp_exptmod
)
from arduino-homekit-esp8266.
ESP32-S2 appears to be a perfect choice due to low-power idling Wi-Fi. Unfortunately, boards aren't yet widely available and official espressif/esp-apple-homekit-adk does not integrate to arduino IDE, that's why I like this project so much.
Hardcoding yield/delay into integer.c or wolfcrypt isn't a good idea, but injecting optional timeout_callback function (NULL by default, {yield()} when called from time-heavy context) might be the way to go
from arduino-homekit-esp8266.
what does your injecting optional timeout_callback function
mean?
from arduino-homekit-esp8266.
regular function pointer, pointing to empty void func by default
from arduino-homekit-esp8266.
Related Issues (20)
- LDR Light Sensor HOT 4
- Sensors looses Connection HOT 9
- HAPStatus call anyone
- New architecture HOT 3
- Compatibility issue with ios 16.6 HOT 5
- Use Homekit-ESP8266 to control a stepper driver. HOT 3
- Loosing accessories with iOS 16.7 and powerloss HOT 12
- Accesorry not showing up in the home app HOT 2
- Lock Management Auto Security Timeout
- hiding accessories HOT 6
- Disconnect on pair setup step 3/3 HOT 6
- Can't find device in HomeApp
- Gives code -2 HOT 1
- esp8266 [ Error compiling for board NodeMCU 1.0 (ESP-12E Module).] issue
- Implement temperature, humidity and 2 switches and oled 0.96 to monitor the sensors. HOT 5
- Accessories not respond
- Sensor Pin
- Please help me code DS18B20 HOT 1
- Doesnt work relay in D2 port
- How can I remove from the example several sensors that I don’t need? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-homekit-esp8266.