Comments (13)
If you have a luxury of running a Linux based system, you can use a much more decent and Linux-ready implementations, e.g. https://github.com/KhaosT/HAP-NodeJS or https://github.com/brutella/hc.
from esp-homekit.
Not desktop Linux, embedded mips (no golang) with 4mb flash (no gnome libs or JavaScript).
We're almost done porting. But it's quite ugly due to the different threading stuff. Have a look at https://github.com/korhalio/esp-homekit at let me know if you'd still take it. Well clean it up then.
from esp-homekit.
@maximkulkin we're done i think but my test iTHing doesnt accept the characteristics. any idea where I broke it?
>>> homekit_client_process: [Client 6] Got 94 incomming data
>>> homekit_client_process: [Client 6] Decrypting data
>>> homekit_client_process: [Client 6] Decrypted 76 bytes, available 0
>>> HomeKit: [Client 6] Get Accessories
>>> client_send: [Client 6] Sending payload: HTTP/1.1 200 OK\x0D\x0AContent-Type: application/hap+json\x0D\x0ATransfer-Encoding: chunked\x0D\x0AConnection: keep-alive\x0D\x0A\x0D\x0A
>>> client_send: [Client 6] Sending payload: 3fb\x0D\x0A{"accessories":[{"aid":1,"services":[{"iid":1,"type":"3E","hidden":false,"primary":false,"characteristics":[{"aid":1,"iid":2,"type":"23","perms":["pr"],"description":"Name","format":"string","value":"Sonoff Switch-040506"},{"aid":1,"iid":3,"type":"20","perms":["pr"],"description":"Manufacturer","format":"string","value":"iTEAD"},{"aid":1,"iid":4,"type":"30","perms":["pr"],"description":"Serial Number","format":"string","value":"037A2BABF19D"},{"aid":1,"iid":5,"type":"21","perms":["pr"],"description":"Model","format":"string","value":"Basic"},{"aid":1,"iid":6,"type":"52","perms":["pr"],"description":"Firmware Revision","format":"string","value":"0.1"},{"aid":1,"iid":7,"type":"14","perms":["pw"],"description":"Identify","format":"bool"}]},{"iid":8,"type":"49","hidden":false,"primary":true,"characteristics":[{"aid":1,"iid":9,"type":"23","perms":["pr"],"description":"Name","format":"string","value":"Sonoff Switch"},{"aid":1,"iid":10,"type":"25","perms":["pr","pw","ev"],"ev":false,"description":"On","format":\x0D\x0A
>>> client_send: [Client 6] Sending payload: 1d\x0D\x0A"@\x19'\x17\x10V","value":false}]}]}]}\x0D\x0A
>>> client_send: [Client 6] Sending payload: 0\x0D\x0A\x0D\x0A
>>> homekit_client_process: [Client 6] Finished processing
>>> HomeKit: [Client 6] Closing client connection
iphone says "could not connect"
from esp-homekit.
It looks like there was a bug in json library handling var args on buffer boundaries. I just pushed a patch. Please update and see if it fixes.
from esp-homekit.
thanks! we got it working on x86 but not mips. this the output on the mips machine.
mips is big endian, so might be something about endianness?
>>> client_send: [Client 6] Sending payload: HTTP/1.1 200 OK\x0D\x0AContent-Type: application/pairing+tlv8\x0D\x0AContent-Length: 3\x0D\x0AConnection: keep-alive\x0D\x0A\x0D\x0A\x06\x01\x04
>>> HomeKit: [Client 6] Verification successful, secure session established
>>> homekit_client_process: [Client 6] Finished processing
>>> homekit_run_server: client read
>>> homekit_client_process: [Client 6] Got 84 incomming data
>>> homekit_client_process: [Client 6] Decrypting data
>>> homekit_client_process: [Client 6] Decrypted 66 bytes, available 0
>>> HomeKit: [Client 6] Get Accessories
>>> client_send: [Client 6] Sending payload: HTTP/1.1 200 OK\x0D\x0AContent-Type: application/hap+json\x0D\x0ATransfer-Encoding: chunked\x0D\x0AConnection: keep-alive\x0D\x0A\x0D\x0A
>>> client_send: [Client 6] Sending payload: 404\x0D\x0A{"accessories":[{"aid":0,"services":[{"iid":0,"type":"3E","hidden":false,"primary":false,"characteristics":[{"aid":0,"iid":0,"type":"23","perms":["pr"],"description":"Name","format":"string","value":"Switch-040506"},{"aid":0,"iid":0,"type":"20","perms":["pr"],"description":"Manufacturer","format":"string","value":"kh"},{"aid":0,"iid":0,"type":"30","perms":["pr"],"description":"Serial Number","format":"string","value":"037A2BABF19D"},{"aid":0,"iid":0,"type":"21","perms":["pr"],"description":"Model","format":"string","value":"Basic"},{"aid":0,"iid":0,"type":"52","perms":["pr"],"description":"Firmware Revision","format":"string","value":"0.1"},{"aid":0,"iid":0,"type":"14","perms":["pw"],"description":"Identify","format":"bool"}]},{"iid":0,"type":"49","hidden":false,"primary":true,"characteristics":[{"aid":0,"iid":0,"type":"23","perms":["pr"],"description":"Name","format":"string","value":"Switch"},{"aid":0,"iid":0,"type":"25","perms":["pr","pw","ev"],"ev":false,"description":"On","format":"bool","value":false}]}]}]}\x0D\x0A
>>> client_send: [Client 6] Sending payload: 0\x0D\x0A\x0D\x0A
>>> homekit_client_process: [Client 6] Finished processing
>>> homekit_run_server: client read
>>> homekit_client_process: [Client 6] Got 186 incomming data
>>> homekit_client_process: [Client 6] Decrypting data
>>> homekit_client_process: [Client 6] Decrypted 168 bytes, available 0
>>> homekit_server_on_pairings: HomeKit Pairings
>>> tlv_debug: Got following TLV values:
>>> tlv_debug: Type 1 value (36 bytes): 458964B5-9CFC-4E4A-848D-838022FF525E
>>> tlv_debug: Type 6 value (1 bytes): \x01
>>> tlv_debug: Type 0 value (1 bytes): \x04
>>> HomeKit: [Client 6] Remove Pairing
>>> HomeKit: Removed pairing with 458964B5-9CFC-4E4A-848D-838022FF525E
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Configuring mDNS
from esp-homekit.
got it. it must be json_write(json, "%lld", x); in json_integer
from esp-homekit.
I see all your aid and iid attributes being zero. Not sure if this is related to printf format.
from esp-homekit.
yes it is. using %lld instead of %ld fixed it. I got it running on a tplink hs110 now :)
https://twitter.com/arvidep/status/956611266985934848
from esp-homekit.
This is awesome, I love having a posix implementation!
This means I can integrate HomeKit with my home automation system, without relying on nodejs based stuff.
I added another file descriptor in server.c to communicate events from my home automation system into esp-homekit, and that works fine.
Anyway, thanks guys, keep up the good work!
from esp-homekit.
Cool! But we're not maintaining this fork since it's rather messy. Instead we started implementing the whole thing in rust . https://github.com/korhalio/hap-rs
from esp-homekit.
I'm sorry to hear that, rust is a no go for me.
maximkulkin: Let me know if you need a bit of development resources put into this, I'll do what I can.
from esp-homekit.
@user623523 Just to let you know, I do not plan to port it to POSIX in the near future. Currently I'm working on ESP32 port and maybe later I will look into Arduino port (where ESP8266 is used as WiFi module), but no other plans so far.
from esp-homekit.
@maximkulkin
I am done with ESP32.
Please visit my repository.
https://github.com/younghyunjo/esp32-homekit
from esp-homekit.
Related Issues (20)
- Cannot find device after removing it. HOT 1
- QUESTION : Dynamic "name" after init_accessory - without esp restart HOT 3
- Server limited to 25 characteristics HOT 4
- How to use ESP8266 as AccessPoint
- 'Hidden' Flag Doesn't Work?
- Separate Accessories - Causes Intermittent 'No Response' HOT 6
- Performance on iOS 16 beta HOT 1
- HOMEKIT_SERVICE_DOORBELL not found
- Can this be used as a proxy for the Level Lock? HOT 1
- Request pairing on demand by variable HOT 3
- Failed to dump SPR public key (code -199) HOT 3
- How to install in ESPhome running on Home Assistant HOT 1
- HOMEKIT_SERVICE_HUMIDIFIER_DEHUMIDIFIER
- wifi:bcn_timeout,ap_probe_send_start HOT 2
- Question: arduino as esp-idf component HOT 1
- Question: esp-idf v5.0
- Reason using PORT 5556 HOT 3
- ESP8266 not reachable after MDNS restart HOT 7
- ESP8266 Accessory No Response HOT 2
- I can't name the switch with different name in same accessory HOT 2
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 esp-homekit.