-
Notifications
You must be signed in to change notification settings - Fork 833
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
srp errors #6870
Comments
Hi @AchimPieters , Have you confirmed you are setting Thanks, |
Hi @AchimPieters & apologies for my tardy response. I've taken a look at your latest changes. Looks like you are making good progress, I saw that you had opened this issue on your esp32-homekit-demo repo, but later deleted it? After typing a reply in #5909 I see you opened this issue. Good. @dgarske is correct: you are missing some settings. See my commit that adds those settings to your user_settings.h There's still an error in the
|
Hi @gojimmypi my fiend! No worries! I'm makeing good progress indeed, en these finil changes seem to be te solution to my problem, i'll will give you an update a.s.a.p. @dgarske Thank you for your swift response, as siad above , it seems to do the trick! You are bothe awesome! |
unfortunally I was to fast:
have too liook into this one... |
A couple of things come to mind: flash space and stack size. I see this "Warning: The smallest app partition is nearly full" at build time:
Still, only "nearly" full, but... Try using the When I run the app, the assert fails to initialize, as
also consider using Let me know if you have any tips on initializing with |
@gojimmypi did you follow the reproduction steps here: https://github.com/AchimPieters/esp32-homekit-demo Keep in mind that 12288 (bytes) is size for ESP32 which is rather small compared to how much memory ESP32 has (512KB, although almost half of that is taken by the system, it's still a decent amount of available memory). For ESP8266 it's only 2048 (words, which is 8192 bytes). Considering a basic ESP8266 example (e.g. an LED) has ~36K of RAM available not being able to generate a 5K response means that you have something else taking a lot of memory. I recommend exploring possibilities to reduce that part. E.g. HomeKit server itself tries to minimize amount of memory it uses when it generates it's responses. E.g. for JSON generation it has a custom manual generation which allows to generate JSON in order as it would appear in output and thus it can send chunked responses as they are being generated.
partiions.cvs
also consider using ESP_LOGI() (from #include <esp_log.h>) instead of printf in debug.h . - have to look in too. PS go to Component config then homekit an select debug output |
Basically, yes (although I'm not on a Mac), the instructions at AchimPieters/esp32-homekit-demo but I see there are additional instructions at the recently updated esp32-homekit/components/homekit @ 9acee90 needed for first-time users that include the custom
yes, from the docs: And so for the LED example, I am now much more successful, although I do see these warnings in the code at build time:
The LED example otherwise builds, flashes, and runs... but I don't see the srp errors mentioned in this issue.
I see a bit more output, but still no SRP errors, as mentioned #6870 (comment):
Can you please confirm the LED example is where this message originates?
There's mention of an HTTP server, but I am unable to connect to it: in my case: sta ip: 192.168.1.17, connection refused, no ESP32 error message. As I am otherwise unable to reproduce this problem. Perhaps there's some other client software involved? |
@gojimmypi good to hear you are getting up to date, message originates when trying to add the LED to homekit with the QR-Code or manual by typing the code: 338-77-883 |
You mean an Apple HomeKit? I don't have one. I have an ESP32 with no camera.
where do I do this? |
@gojimmypi take your iphone:
|
I also don't have an iPhone. |
Well that's a bummer.... |
lol, I was hoping for an answer just a little something better. ;) Surely there's a way to test this without me needing to have a Homekit device or iPhone? Otherwise we can get one of the other engineers involved. |
@gojimmypi do you know where I can find the description |
Hi @AchimPieters I've been unable to get an iPhone emulator running on my Windows machine. I do have a friend with an iPhone, so I hope to try that soon.
That appears to originate in esp32-homekit/src/crypto.c. The Just out of curiosity, have you tried increasing the amount of stack space? Also consider sprinkling some stack high water mark checks:
|
@gojimmypi the stack size is defined in port.h
What stack size would you recommend? Regarding the stack high water mark checks: on my todo list ;) |
hm, well, that depends. I wonder how much memory is available? I might try adding another 10K or 20K and see if there's a difference in operation. It's hard to say without seeing the problem myself. We don't even know that it's a stack error. Speaking of which: I should be able to have an iPhone to test on Saturday. So let me know if there are any other details I might need to be aware of. btw - now that you are not using a managed component, feel free to clone the latest wolfSSL. If parallel to your project clone, the cmake should find it automatically. Upcoming version will support environment variable for I have a more recent CMakeLists.txt if you'd like to experiment with that. It includes the option to assign |
@gojimmypi thank you for reply, I personally don't think it's a stack error, but I will give it a try. That's great news, when you open the HomeKit app, just select the + to add the accessory and follow the steps. The only thing is to open a new terminal window and type At this point, we got a "working" setup, I want to follow through until it's fully working, before tweaking and using the latest wolfSSL. |
Hi @AchimPieters , I'm the guy with the iPhone. I can reproduce your error. I also tried to raise the stack size of 20k as suggested by @gojimmypi but it does not solve the problem. @gojimmypi and I are going to do some tests later in the day. |
@jucham thank you for joining and testing! |
Hi @jucham and @AchimPieters , This sounds like a math variable size issue. Based on the code here (https://github.com/AchimPieters/esp32-homekit/blob/main/src/crypto.c#L129) for a 1024 sized verify request I think you need 8192 bit math support. If you are building with If that does not work please share me your current Thanks, |
Hi @dgarske , thank you very much for the hint, I was a bit lost to be honest. You're right. In this case it's built with @AchimPieters can you confirm that ? In this file : /* rsa primitive specific definition */
#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE)
/* Define USE_FAST_MATH and SMALL_STACK */
#define ESP32_USE_RSA_PRIMITIVE
#define FP_MAX_BITS (8192 * 2)
/* threshold for performance adjustment for hw primitive use */
/* X bits of G^X mod P greater than */
#define EPS_RSA_EXPT_XBTIS 36
/* X and Y of X * Y mod P greater than */
#define ESP_RSA_MULM_BITS 2000
#endif |
@dgarske thank you for joining the discussion! And providing the missing solution! @jucham and @gojimmypi the solution provide from @dgarske and presented by you worked. I will update the repo, and then you can test it too. This is awesome, thank you guys. @gojimmypi Now that the code is working, we can do some fine-tuning ;) |
@AchimPieters and @jucham thank you both for all your help. That's so cool it's working! I put together a little blog to acknowledge your work. Ok to close this issue, @AchimPieters ? |
Thanks to everybody who help with the issues! |
The spelling has been fixed @AchimPieters & we look forward to seeing your ESP32 HomeKit progress! |
Hi @gojimmypi how are you doing? I saw there is a new version 5.6.6 with support for more than only the esp32, but for more esp32 series, but how to incorporate this into my project? Now compiling only possible for the ESP32, and not for: esp32s2, esp32c3, esp32s3, esp32c2, esp32c6, esp32h2 and esp32p4 the current one gives me errors when compiling, for example esp32c2:
|
Hello @AchimPieters ! Good to hear from you.
Great news! The latest code works with all the ESP32 flavors! Please confirm you are using files from the 5.6.6 release (or later). The examples now contain an updated components/wolfssl directory, in particular a user_settings.h that has a section to detect which ESP32 flavor was selected with the Hardware acceleration is enabled for all the SoC's supported by ESP-IDF v5.1. Newer chips will work, with HW disabled for any of those undetected. Note there was a post release change in #7148 that fixed the environment variable option to point to your wolfssl source, if not in the same If you cannot get it working, please open a new issue so we can track it with visibility. Thanks! Best Regards. |
Version
5.6
Description
On my project : https://github.com/AchimPieters/esp32-homekit-demo and in this case the submodule: https://github.com/AchimPieters/esp32-homekit
reproductions steps can be found here: https://github.com/AchimPieters/esp32-homekit-demo
I tried to look into the encodign errors like:
here: https://www.wolfssl.com/documentation/manuals/wolfssl/coding_8h.html#function-base64_encode_nonl
and
for these here: https://www.wolfssl.com/documentation/manuals/wolfssl/srp_8h.html
But I can't get my head around it.
The text was updated successfully, but these errors were encountered: