homeaccessorykid / esp8266-homekit Goto Github PK
View Code? Open in Web Editor NEWHomeKit server Native on ESP8266_RTOS with an API approach
Home Page: https://www.youtube.com/watch?v=Xnr-utWDIR8
License: Apache License 2.0
HomeKit server Native on ESP8266_RTOS with an API approach
Home Page: https://www.youtube.com/watch?v=Xnr-utWDIR8
License: Apache License 2.0
Hi, sorry I wasn't sure exactly where to put a question like this.
I'm new to GitHub and I'm just trying to follow the Build Instructions, when I try to compile the ESP8266-HomeKit using deploy.sh but instead of the expected success message Im getting "/bin/sh: xtensa-lx106-elf-gcc: command not found" a number of time after large blocks of what look like file paths, then at the end it says:
"make[2]: xtensa-lx106-elf-gcc: No such file or directory
make[2]: *** [.output/eagle/debug/obj/chacha.o] Error 1
make[1]: *** [.subdirs] Error 2
make: *** [.subdirs] Error 2"
I restarted from the beginning following the instruction as carefully as I could but have come up with the same thing, any advice would be appreciated
Either rest API or website for config would be good, like some of the other firmwares have.
I've already written the code, need to make a pull request and merge it...
Hi!
The code works as charm, but if I change my device e.g. to an iPad, the accessory is unreachable (while from the iOS device I've paired from is still works). Any idea?
I followed the Instructions in the Wiki. With the gen_misc.sh
script i used the defaults and edited the files as recommended. I also tried it with flashing blank.bin
and esp_init_data_default.bin
: ~/Python/esptool/esptool.py --baud 230400 -p /dev/cu.SLAB_USBtoUART write_flash 0x00000 ../ESP8266_BIN/eagle.flash.bin 0x14000 ../ESP8266_BIN/eagle.irom0text.bin 0x3fe000 bin/blank.bin 0x3fc000 bin/esp_init_data_default.bin
The esp i am using is the: NodeMcu Amica V3 ESP-12E ESP12E 4MB FLASH
Workstation is a MacBook
This is what i receive if i connect to my esp via uart:
$ pio device monitor --port /dev/cu.SLAB_USBtoUART --baud 74880
--- Miniterm on /dev/cu.SLAB_USBtoUART 74880,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
load 0x40100000, len 30372, room 16
tail 4
chksum 0x88
load 0x3ffe8000, len 2860, room 4
tail 8
chksum 0xe9
load 0x3ffe8b40, len 3152, room 0
tail 0
chksum 0x9a
csum 0x9a
OS SDK ver: 1.5.0-dev(488a5a6) compiled @ Feb 27 2017 11:49:07
rf_cal[0] !=0x05,is 0xFF
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 30372, room 16
tail 4
chksum 0x88
load 0x3ffe8000, len 2860, room 4
tail 8
chksum 0xe9
load 0x3ffe8b40, len 3152, room 0
tail 0
chksum 0x9a
csum 0x9a
OS SDK ver: 1.5.0-dev(488a5a6) compiled @ Feb 27 2017 11:49:07
rf_cal[0] !=0x05,is 0xFF
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
...
...
...
keeps rebooting as long as the power is connected
Any Idea what to do?
Hey !
I found a firmware pre-compile on the internet (here) and it runs great but I would like to make a change so that the switch is recognized as a tootgle (dry contact).
Can anyone help me ?
Hello
I wish I could use homekit on the arduino IDE, does anyone know how?
Thanking you in advance
cordially
Hi!
https://developer.apple.com/homekit/specification/
(non-commercial version)*
The build steps mention this file, but I can't find it anywhere.
../third_party/make_lib.sh
I paired and unpaired my ESP8266 with HomeKit. Now when I try to repair, they fail. I have traced this to the SRP Key and stored Wi-Fi credentials. How can I clear this part of the flash on the ESP8266?
This is the output in my console:
pairing 0, heap 19848, system time=7652
pairing 0, heap 19808, system time=10652
pairing 0, heap 19808, system time=13652
chas: 1.9=valF -> bool
pairing 0, heap 19808, system time=16652
pairing 0, heap 19808, system time=19652
pairing 0, heap 19808, system time=22652
pairing 0, heap 19808, system time=25652
pairing 0, heap 19808, system time=28652
chas: 1.9=valT -> bool
pairing 0, heap 19808, system time=31652
With pride and quite some delay I present to you my code base for the ESP8266
See https://youtu.be/Xnr-utWDIR8 for a demo
I am well aware that sections of the code need clean up, that I tend to use short variable names that everybody advices against and that not all code is optimal.
Yet I feel that the community will be able to improve on this and make the ESP8266 a very nice HomeKid platform. I hope to learn how to use GitHub with your help and to see many exciting Accessories in the years to come.
Enjoy! (and spread the word...)
HacK
I've started thinking about FOTA and how it should work for us.
Please add to these thoughts? Anyone got experience?
Some objectives I see for now:
Some issues I already see:
Positive news:
Part of my doubt is that I would like people to be able to build and sell devices based on this library.
I see GPLv2 as an obstacle for that.
Still I consider to publish the same initial code under GPLv2 for a true open source community
Please indicate if there are people in favour of that and would prefer to deliver their attributions to the GPLv2 distribution over the Apache2 distribution.
TIA,
HacK
Hi
I'm very interesting about this project, it looks very promise.
I'm not a developer guru, but can read and modify some code :)
I'm looking how to write thermostat code, I understand how to read temperature sensor
But can't understand how to store HEATING_THRESHOLD_TEMPERATURE_C
and where it can be stored
Also in your demo, I see how to get state from a sensor when it requested,
but how to get state continuously?
Like get the temperature from a sensor, compare with stored HEATING_THRESHOLD_TEMPERATURE_C and turn on or off relay when it needed, without interacting with homekit?
Hello, I have done everything as instructed in wikis and the result is below
esptool.py
v2.0-beta2
Connecting....
Detecting chip type... ESP8266
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 230400
Changed.
Attaching SPI flash...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0040
Compressed 36432 bytes to 26362...
Wrote 36432 bytes (26362 compressed) at 0x00000000 in 1.2 seconds (effective 249.8 kbit/s)...
Hash of data verified.
Compressed 391572 bytes to 283524...
Wrote 391572 bytes (283524 compressed) at 0x00014000 in 12.5 seconds (effective 249.9 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting...
but the esp8266 is not connecting to my AP although I have uncommented the user_init function and inserted my APssid and password correctly
Any ideas?
Recently Maxim released a similar repository delivering the same functionality, based on my code.
This code is still in development and I would not run it for real life accessories just yet.
At the same time, Maxim does know how to write code a lot better than me.
I intend to invest in his code and bring it to the level where my code is currently, and beyond.
My code had also hit the limits of memory and flash size and I feel that Maxim's code will allow to overcome these better than my spaghetti code.
Finally, because he based his code in esp-open-rtos, more drivers and support are available to make real accessories come to life.
So, the effort has just been shifted sideways and up one gear.
I hope you will also join that bandwagon.
When the accessory just started to run, it worked fine. After a while, when I open the Home app again, the accessory sometimes shows "no response".Who can give me some advice?
This is my first GitHub project and also writing c-code for ESP_RTOS is a first time.
In order to make this project as accessible as possible to others, help to suggest how to setup the directory structure and include structures etc... in a better way
Thanks in advance,
HacK
... understanding more it seems the problem does not exist ... see last answer
Currently the API works but is a bit limited.
We can upload an initial value and a callback for a set of predefined cTypes.
All this is coded in the function addCharacteristic
However, there are cTypes that need more variables than that.
How do we feel we want additional variables to be conveyed to the more complex characteristics?
My best guess for now is to set up a few variables like item1 through item9 that if you set them before defining a characteristic they will set a particular variable of a particular characteristic.
Does anyone have a better idea??
PS, do not overcomplicate it please...
Thank you for your hard work.
I just setting my environment for esp dev. So I new in C.
Please tell me what point of using RTOS?
Is it possible to use NONOS?
Thank you.
sers=addAccessory(accs,++aid);
//service 0 describes the accessory
chas=addService( sers,++iid,APPLE,ACCESSORY_INFORMATION_S);
addCharacteristic(chas,aid,++iid,APPLE,NAME_C,accname,NULL);
addCharacteristic(chas,aid,++iid,APPLE,MANUFACTURER_C,"Bio*X HOME",NULL);
addCharacteristic(chas,aid,++iid,APPLE,MODEL_C,"0.0.1 talqini",NULL);
addCharacteristic(chas,aid,++iid,APPLE,SERIAL_NUMBER_C,"BHQYKCH-2017-0001",NULL);
addCharacteristic(chas,aid,++iid,APPLE,IDENTIFY_C,NULL,identify);
//service 1
chas=addService( sers,++iid,APPLE,LIGHTBULB_S);
addCharacteristic(chas,aid,++iid,APPLE,NAME_C,"QYK Chiroq",NULL);
addCharacteristic(chas,aid,++iid,APPLE,ON_C,"1",led);
//service 2
chas=addService( sers,++iid,APPLE,LIGHTBULB_S);
addCharacteristic(chas,aid,++iid,APPLE,BRIGHTNESS_C,"1",rgbled);
addCharacteristic(chas,aid,++iid,APPLE,HUE_C,"1",rgbled);
addCharacteristic(chas,aid,++iid,APPLE,SATURATION_C,"1",rgbled);
It would be great if you could turn this into a library for esp8266/Arduino so that it could easily be used in the familiar Arduino IDE as part of Arduino sketches.
I've got everything to run up to the point where my ESP8622 with ESP8622-HomeKit-Demo is discoverable in the Home app. The app then asks me for the pairing code, which for me still is the default one.
However, the procss doesn't finish after 25 seconds for me as the tutorial states. It instead times out after 120 seconds, when the app tells me it cannot connect to the device. I tried to increase the clock speed to 80MHz in the build process, thinking that would help speeding up the crypto but to no avail.
Is there anything I can do to debug this process? How do I compile the code with debugging on?
I am, by the way on the current iOS 11 beta with all my devices, is anyone else experiencing problems on these?
can someone make a video with instructions on how to make a homekit accessory from esp8266
A homekit village has been started by me.
I will attend at SHA2017, the famous hacker festival in the Netherlands held every 4 years.
I hope we can meet with likeminded HomeKit hackers and make the Arduino library or assembly crypto. And make those hardware items that have shown up the other day...
If you are interested, please leave a message or contact me at home-accessory-at-xs4all.nl
1/20 times successfully paired.
Is there a way to speed up?
Debug has been switched off.
This issue is intended is a working to do list. It will probably remain open during the life of this project.
I have compiled the code, and have been playing around with it a bit. Everything works fine for me, but if i want to change SWITCH_S service (button_led DEMO project) for example to MOTION_SENSOR_S
chas=addService( sers,++iid,APPLE,MOTION_SENSOR_S); addCharacteristic(chas,aid,++iid,APPLE,NAME_C,"motion",NULL); addCharacteristic(chas,aid,++iid,APPLE,MOTION_DETECTED_C,"1",NULL);
pairing doesnt work anymore and for other services - the same issue. What am i doing wrong? Thx in advance .
Hi Thanks for such great firmware.
Just wondered that any particular reason that you are using queue system?
It increases complex and causing race conditions issue. Sometimes I am not able to pair due to packet sent before lock being removed.
Cheers
Jimmy Fan
Hello!
I'm using GNU toolchain (Windows)
After compiling and creating libwolfcrypt.a there is an error:
hkc.c: In function 'crypto_setup5':
hkc.c:1931:17: error: implicit declaration of function 'wc_HKDF' [-Werror=implicit-function-declaration]
r = wc_HKDF(SHA512, srp.key, srp.keySz, esalt, esaltSz, einfo, einfoSz,
^
Can in my case it is necessary to include any define?
ESPHKD#12 gives initial reason for opening this issue.
hello !
someone have included this Github to iTead Sonoff touch?
thank you very much.
keepalive doesn't kill because events keep it awake or it is just broken!
use state=4 as criterion not to send more...
might be related to the ESP8266_RTOS_SDK lwip fix of 21 nov 2016
investigating...
I keep running into this error, what are the steps to fix it?
xtensa-lx106-elf-gcc -L/Volumes/ESPopenSDK/esp-open-sdk/ESP8266_RTOS_SDK/lib -Wl,--gc-sections -nostdlib -T/Volumes/ESPopenSDK/esp-open-sdk/ESP8266_RTOS_SDK/ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lcirom -lcrypto -lespconn -lespnow -lfreertos -lgcc -lhal -ljson -llwip -lmain -lmesh -lmirom -lnet80211 -lnopoll -lphy -lpp -lpwm -lsmartconfig -lspiffs -lssl -lwpa -lwps -lhkc user/.output/eagle/debug/lib/libuser.a driver/.output/eagle/debug/lib/libdriver.a wolfcrypt/.output/eagle/debug/lib/libwolfcrypt.a -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
/Volumes/ESPopenSDK/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: cannot find -lhkc
collect2: error: ld returned 1 exit status
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1
I've been trying like crazy to build an example of a motion sensor working from a button/pir/etc (short IO to GND or High). I seem to fall short with the interrupts and having the push working as it should. Have anyone else tried this and had success?
Hello!
After replacing the file hkc.c with a new one, this error occurs when compiling. The old file is compiled normally
I've used espconn_mdns in ESP8266_NONOS_SDK to send HAP Bonjour Discovery packets with:
- host_name = "HAPTest"
- server_name = "hap"
- server_port = 661
- ipAddr = ...
- txt_data = {"c# = 1", "ci = 1", "ff = 0", "id = 1A:2B:3C:25:67:4F", "md = HAPTest", "pv = 1.0", "s# = 1", "sf = 1"}
These packets have been showing up in Discovery - Bonjour Browser (https://itunes.apple.com/us/app/discovery-bonjour-browser/id305441017?mt=8) but Home app cannot find them (there is no accessory showing up in Home app).
My question is why you use mdns char array instead of espconn_mdns to send HAP Bonjour Discovery packets; and why Home app can not find accessory was made by espconn_mdns in ESP8266_NONOS_SDK as i did?
This would be perfect for the Sonoff type of line. But they use ESP8285 that's almost the same as the ESP8266 but with built-in 1MB flash.
Line of products example:
https://www.itead.cc/smart-home/sonoff-touch.html
https://www.itead.cc/smart-home/motor-reversing-wifi-wireless-switch.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.