Open GoRo33 opened 4 years ago
@GoRo33 seems some issue with printing float numbers. In order to confirm this, please add a call hap_http_debug_enable()
before hap_start()
in your app_main.c
and check if you see this line in the GET /accessories response
"characteristics":[{"iid":12,"value":,"type":"11","perms":["pr","ev"],"ev":false,"format":"float","minValue":,"maxValue":,"minStep":,"unit":"celsius"}
As you can see, the values are missing for multiple keys. Since this is not a valid JSON, iOS rejects this.
Please search for the below config option in your sdkconfig file and change it from y
to n
.
CONFIG_NEWLIB_NANO_FORMAT=y
Let me know if it fixes the issue for you.
@shahpiyushv Hi!
Thanks for the help. This solves my problem. As far I know there are some error with printing float numbers on ESP8266 RTOS SDK. When using printf
or ESP_LOG
, float format don't work.
Should I this solution be in default config for ESP8266?
@GoRo33 , If you mean the sdkconfig.defaults file (and not defaults within ESP8266_RTOS_SDK itself), then yes, atleast for the examples that have floats, this needs to be set.
Hi there,
I'm having the same issue while using the lightbulb example.
For my use case I wanted to add some DHT22 sensor to read temperature and humidity from.
In my test, I only used the temperature and passed it to the hap characteristics without updating the temperature later on.
When reading and printing the information from the sensor as int everything works fine.
Additionally, the CONFIG_NEWLIB_NANO_FORMAT=y
is set by default to yes but unfortunately I cannot print any float values.
I removed line hap_enable_mfi_auth(HAP_MFI_AUTH_HW);
as I'm not using the MFI variant of sdk.
Any suggestion what I might be missing? @GoRo33 do you have any example code for your solution?
Thanks in advance!
@Mike09 , as you can see in my comment above, search for CONFIG_NEWLIB_NANO_FORMAT=y
and change it from y to n. Probably you misread the comment and retained CONFIG_NEWLIB_NANO_FORMAT=y
?
Thanks @shahpiyushv for your quick reply! you were right, I was misreading that line.
I tried your suggestion, but now I get following error:
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000080, depc=0x00000000
I saw from the espressif docs that the cause is a access to invalid address. To exclude an issue with the DHT file, I excluded that one and passed a fixed float value to the characteristics, but the issue stays the same.
Did someone encounter similar issues?
In my experience, disabling CONFIG_NEWLIB_NANO_FORMAT
resulted in code size being too large for the ESP8266, which produces the Fatal exception (28)
error. Enabling release optimizations with CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
will reduce code size sufficiently to fix the problem.
I'm having the same issue on ESP32:
######## Starting Pair Verify ######## Pair Verify M1 Received Pair Verify M2 Successful Pair Verify M3 Received I (6198) HAP Lightstrip: Controller 73611AA3-78CF-4BFC-9316-98E46855FED2 Connected HomeKit Session active Pair Verify Successful for 73611AA3-78CF-4BFC-9316-98E46855FED2 Decryption error/Connection lost. Marking session as invalid I (11588) HAP Lightstrip: Controller 73611AA3-78CF-4BFC-9316-98E46855FED2 Disconnected HomeKit Session terminated
HomeKit SDK commit (master): eade505a
ESP-IDF commit (v4.4): 8153bfe412
I've tried the troubleshooting steps that @shahpiyushv suggested above, but this did not work. I also tried commenting out all ESP_LOGI()
calls with float values - again, same problem. Restarting my modem, router, DHCP server, etc. has not made any difference.
At this point I'm at a loss for what could be going on or how to properly debug it.
Here is the output from hap_http_debug_enable()
Any help would be much appreciated!
UPDATE: I was finally able to resolve this issue. Going into the Home app on my iPhone to "Delete my home" fixed everything. Once I added my HomeKit device again, it worked on the first try.
Step-by-step instructions for this can be found here
I have reported a problem with "data_tlv8" example. When I try to connect to device i getting connection problem at end of paring process:
Lightbulb example work fine with connection but when i change
cfg
structure to.cid = HAP_CID_SENSOR,
i getting this same error at connection.I have encounter this error because i try to add humidity and temperature characteristics. My os is Ubuntu 18.04 and sdk version is: commit f2a010a53f937305266e01664b0dece6ab1fa979 (HEAD -> master, origin/master, origin/HEAD) esp8266_rtos_sdk version is: commit 66dd5798803a96a9f2a7d77099bc36d7bef918dc (HEAD -> master, origin/master, origin/HEAD)