Code Monkey home page Code Monkey logo

Comments (9)

shahpiyushv avatar shahpiyushv commented on July 20, 2024 1

@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.

from esp-homekit-sdk.

shahpiyushv avatar shahpiyushv commented on July 20, 2024

@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.

from esp-homekit-sdk.

GoRo33 avatar GoRo33 commented on July 20, 2024

@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?

from esp-homekit-sdk.

Mike09 avatar Mike09 commented on July 20, 2024

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!

from esp-homekit-sdk.

shahpiyushv avatar shahpiyushv commented on July 20, 2024

@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?

from esp-homekit-sdk.

Mike09 avatar Mike09 commented on July 20, 2024

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?

from esp-homekit-sdk.

danieldegrasse avatar danieldegrasse commented on July 20, 2024

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.

from esp-homekit-sdk.

andrewteta avatar andrewteta commented on July 20, 2024

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!

from esp-homekit-sdk.

andrewteta avatar andrewteta commented on July 20, 2024

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

from esp-homekit-sdk.

Related Issues (20)

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.