Code Monkey home page Code Monkey logo

esp-homekit-demo's People

Contributors

bowerymarc avatar dave1001 avatar dbsqp avatar erpayo avatar fonger avatar g3ntleman avatar homeaccessorykid avatar jlusiardi avatar maximkulkin avatar neptunix avatar pcsaito avatar ream88 avatar renssies avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-homekit-demo's Issues

Error upload firmware

Hello!

I have a trouble with flashing to Wemos D1 mini pro device.
I followed instructions and compiled "exemples/led" projet but can't flash to device.

My trace log:

MacBook-Pro:esp-homekit-demo admin$ make -C examples/led test
esptool.py -p /dev/tty.SLAB_USBtoUART --baud 115200 write_flash -fs 32m -fm qio -ff 40m ...
WARNING: Flash size arguments in megabits like '32m' are deprecated.
Please use the equivalent size '4MB'.
Megabit arguments may be removed in a future release.
esptool.py v2.3
Connecting........

Detecting chip type... ESP8266
Chip is ESP8285
Traceback (most recent call last):
File "/usr/local/bin/esptool.py", line 2637, in
_main()
File "/usr/local/bin/esptool.py", line 2630, in main
main()
File "/usr/local/bin/esptool.py", line 2360, in main
print("Features: %s" % ", ".join(esp.get_chip_features()))
File "/usr/local/bin/esptool.py", line 897, in get_chip_features
features += ["Embedded Flash"]
TypeError: cannot concatenate 'str' and 'list' objects
make: *** [flash] Error 1

Can you help me? Thanks for any help!

dynamically generated characteristic ?

Is it possible to generate characteristic
I try to explain
if I have multiple one wire temperature sensor like ds18b20
If I have one sensor I can write code,
if I want to add more, I need to recompile code for supporting next sensor
maybe it's possible to add some cycle that sees how many onewire sensors I have
and add characteristic for new one
This is just crazy idea :)

Add: An Example to control Ws2812b / SK6812 RGB(W) Stripes

Hey maximkulkin,

you really did an amazing job creating all those examples for HomeKit on an ESP8266. I used it to create a bunch of different accessories, but I was wondering how to control RGB(W) LED Stripes using HomeKit. I took a look in your Light example, but couldn't work it out.

David

Button debounce behavior in button examples

In the current button example, debouncing does not behave quite properly.

After the first edge, the interrupt handler ignores further edges for the debounce period - this makes sense. However, immediately after the first edge is detected the button GPIO state is read to determine if it is pressed or depressed. This can result in reading the state of a "bounce" rather than the stable button state and cause undefined button behavior.

I solved this in my code by adding sdk_os_delay_us(1000*button->debounce_time); before the if statement to determine state.

This seems to give much more stable button response, although I realize adding hard delays in the interrupt handler isn't ideal.

Issue with flashing

Hey,

sorry to bother again, but I'm having trouble to run the monitor command on all of the demos.
Again I'm using a WeMos Lolin32 and right now, I can properly make the code and (looks like it) correctly flash the code to the ESP, but the functionality isn't there. I was using the wifi_config example to create an AP from the ESP, but it won't happen. I've tried a bunch of things now, compared the commands with the one from the Arduino IDE wich are certain to work (even wit the wifi.h imported), and googled my way around the internet but can't exactly figure out whats going on here.

I'm using the following commands:

Ferdinands-MacBook-Pro:esp-homekit-demo Ferdi$ make -C examples/wifi_config all
[Note from me: Seems to be running the Makefile properly. Didn't want to post ALL of the output, because it's way too much.]



Ferdinands-MacBook-Pro:esp-homekit-demo Ferdi$ make -C examples/wifi_config flash
esptool.py -p /dev/cu.SLAB_USBtoUART --baud 115200 write_flash -fs 8m -fm qio -ff 40m \
		0x0 /Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos/bootloader/firmware_prebuilt/rboot.bin 0x1000 /Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos/bootloader/firmware_prebuilt/blank_config.bin 0x2000 ./firmware/wifi_config.bin 
WARNING: Flash size arguments in megabits like '8m' are deprecated.
Please use the equivalent size '1MB'.
Megabit arguments may be removed in a future release.
esptool.py v2.3-dev
Connecting........__
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 3104 bytes to 2169...
Wrote 3104 bytes (2169 compressed) at 0x00000000 in 0.2 seconds (effective 126.7 kbit/s)...
Hash of data verified.
Compressed 2048 bytes to 23...
Wrote 2048 bytes (23 compressed) at 0x00001000 in 0.0 seconds (effective 2324.3 kbit/s)...
Hash of data verified.
Compressed 457968 bytes to 322494...
Wrote 457968 bytes (322494 compressed) at 0x00002000 in 28.5 seconds (effective 128.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...



Ferdinands-MacBook-Pro:esp-homekit-demo Ferdi$ make -C examples/wifi_config monitor
/Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos//utils/filteroutput.py --port /dev/cu.SLAB_USBtoUART --baud 115200 --elf ./build/wifi_config.out
Opening /dev/cu.SLAB_USBtoUART at 115200bps...
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
^CTraceback (most recent call last):
  File "/Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos//utils/filteroutput.py", line 105, in <module>
    main()
  File "/Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos//utils/filteroutput.py", line 87, in main
    line = port.readline()
  File "/Library/Python/2.7/site-packages/serial/serialposix.py", line 483, in read
    ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())
KeyboardInterrupt

Any ideas what I am doing wrong here?

Error during paring

After last update i have paring error each time:

dhcp client start...
ip:172.20.10.8,mask:255.255.255.240,gw:172.20.10.1

HomeKit: Got IP, starting
HomeKit: Configuring mDNS
HomeKit: Got new client connection: 4
HomeKit: [Client 4] Pair Setup Step 1/3
HomeKit: [Client 4] Pair Setup Step 2/3
!!! HomeKit: [Client 4] Failed to compute SRP shared secret (code -2)

Captive portal or web interface to set WiFi SSID and password

Would it be possible (especially memory wise) to implement something like the Arduino WiFiManager that allows for setting the WiFi SSID and password using a simple web interface?

I want to gift some small HomeKit sensors and devices to friends and family, but of course, you don't want the wifi to be hardcoded in those cases.

How can I see the change in the app when a local button changes an output on the ESP

Hi all,

First of all GREAT work!
I have got it up and running by starting with the LED example.
I then changed it to 2 services instead of 1 so that only 1 ESP8266 controls 2 outputs.
This al works fine, in the Home app on the iPhone I see 2 devices that comes from 1 ESP.
But I will control the outputs (lights) also locally via buttons connected to the ESP.
I do NOT want to know the state of these buttons but if I turn an output via a button ON or OFF, the light goes ON or OFF and I want to see this change in the app as well.
How do I do this?
I suppose I need to send a notify/event every time a light changes from state (via the hardware button).
I'm not so familiar with the calls, so how do I implement this?

Can somebody help me to to get this functionallity inside my program?

Korstiaan

Shades support?

Sorry if this is not an issue not used to github.

Is it possible to control shades with this?
Making that homekit see's the device as a shade and is able to pass open/close/% data to the controller?

Can't flash ESP8266

Hey,

I'm working with a WeMos Lolin32 with an OLED display.
I've managed to get the LED example to run be made properly, and now I'm at the step of trying to flash the code to the ESP chip.

The command make -C examples/led testbrings out the following output:

Ferdinands-MacBook-Pro:esp-homekit-demo Ferdi$ make -C examples/led test
esptool.py -p /dev/cu.SLAB_USBtoUART --baud 115200 write_flash -fs 8m -fm qio -ff 40m \
		0x0 /Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos/bootloader/firmware_prebuilt/rboot.bin 0x1000 /Users/Ferdi/Desktop/RISE/Code/ESP/ESP_examples/esp-open-rtos/bootloader/firmware_prebuilt/blank_config.bin 0x2000 ./firmware/led.bin 
esptool.py v1.2
Connecting...

A fatal error occurred: Failed to connect to ESP8266
make: *** [flash] Error 2

The funny thing at this point is, that the chip is reset multiple times (3 to be precise) at the flashing process, so I can confirm that the connection works. Apparently the issue lies within the flashing. What am I doing wrong? Am I missing something here?

If you need any infos from me just ask, I don't know what could factor into this, so I don't know which exact informations to provide.

Sonoff Basic issue flashing

I can run flash without any issues BUT once the monitor phase begins it just sits and sits at
Opening /dev/ttyUSB0 at 115200bps...

any guidance?

running Ubuntu in virtual box with the device auto attaching.

Port to ESP_IDF

ESP_IDF is considered to be the standard for ESP32 SDK toolchain source and API's
Would you consider porting this great work to ESP_IDF?

thanks

Simple dev tooling on a Mac

Hey folks,

I'm new to using the esp SDK and building from the command line.

I've just got the exmples/led working after a couple of hours of messing around with repos, building, make errors and environment vars. I can see how #54 might help.

Anyway.. what's a really simple dev workflow/toolset for improving on the simple examples? For example, I can use vscode and the terminal to build but I don't have some of the "built in" features of the Arduino IDE.

  • What's the best approach to syntax/api validation?
  • Where can I get basic help on the differences between setup() and loop() as compared to how this works with the SDK?
  • what's the solution to serial monitoring when building and flashing from the command line?

Are most of the Arduino compatible libs going to "just work" using the SDK?
I'm keen to augment a simple relay implementation of example/led with the WiFiManager and DoubleResetDetector. Is this going to be straightforward?

temperature sensor demo question

I think it may be better to use ESP-OPEN-RTOS. for base
it has more sensor support
but what type of temp sensor this demo is supported?

Add Coprocessor i2c

Is it possible to connect mfi chip i2c -> esp8266?

1491f862-6cc6-49aa-bbf4-7cf733841f20

Part Number : MFI337S3959
Package : QFN 8-1 Pin, Apple Inc.
Shelf iPod, iPhone, iPad video / headphone / battery-related Apple (Apple) to decrypt ic:
APN337S3959
MFI337S3959
APN337S3957
MFI337S3957
MFI341S2159
MFI341S2257
MFI341S2592
MFI341S2748
MFI341S2159
MFI341S2161
MFI341S2162
APN337S3957
MFI341S2164
MFI341S500
MFI353S2429
MFI353S2430

Chips are sold on ebay and aliexpress.

Won't compile due to missing lip/dhcp.h

I have tried to compile the led example and I am getting an error that lwip/dhcp.h can't be found as required by user_main.c. These files seem to be part of the esp-open-rtos and not yours so maybe this isn't where the issue should be raised. I also looked in user_main.c and it does have the include line in there. I also checked the path and lip/dhcp.h isn't there. I cloned your repository using --recursive, did I do something wrong? Sorry, I'm a little new to some of this stuff.

Web Server for configuration

Hello I have implemented a motor example
https://github.com/ageorgios/esp-homekit-motor

And would like to hear feedback how to implement an HTTP Server in order to change variables and configuration of the accessory.

I know this goes out of the spec of Homekit, but with Homekit there is no way to create a generic implementation of a motor and then configure it.

Thank you.

Documentation and understanding

Hey,

I've now gotten my NodeMCU and tested the code on it. It works like a charm so far! Thanks so much for creating this library and the examples.

However, now that I want to get into developing some functionalities myself, I'm having some trouble getting the right information. Since the code is not documented at all, I can only assume what's happening in the different functions, etc.

I'm currently going through some of the examples and trying to create inline documentation. I'm also willing to publish them when they're done, but for now I need to get things straight in my head first!

Can anyone help me what these two functions then from the led example do?

// No idea what this does...
void led_identify_task(void *_args) {
    for (int i=0; i<3; i++) {
        for (int j=0; j<2; j++) {
            led_write(true);
            vTaskDelay(100 / portTICK_PERIOD_MS);
            led_write(false);
            vTaskDelay(100 / portTICK_PERIOD_MS);
        }

        vTaskDelay(250 / portTICK_PERIOD_MS);
    }

    led_write(led_on);

    vTaskDelete(NULL);
}

// No idea what this does either...
void led_identify(homekit_value_t _value) {
    printf("LED identify\n");
    xTaskCreate(led_identify_task, "LED identify", 128, NULL, 2, NULL);
}

Other devices and license questions

Hello @maximkulkin,

I'm a HomeKit fan, and I'm following all your work. It's amazing!

I'm using your actual work to code final versions of firmwares that can be distributed in binary format to let users to install them without a dev environment. For now, I have a Sonoff Basic with some extra functions: a reset option pushing quickly the button, and a option to connect a wall switch to GPIO14 and ground. And actually, I'm working with a Sonoff TH to convert it to a HomeKit thermostat. Please, can you tell me if my work is right with license terms.

Many thanks.

Licensing for commercialisation

It seems that the ESP SDK is complex enough, let alone this open source HomeKit collection of dependancies. Can anyone help me figure out if a fork of this codebase can be legally packaged into an off-the-shelf product (eg. Sonoff Basic, etc) and then sold?

Sonoff basic support

Hi
I try to upload code to SonOff basic device
I add
EXTRA_CFLAGS += -DSPIFLASH_BASE_ADDR=0x7A000
to Makefile
I change FLASH_SIZE to 8 (maybe it's wrong ? it have 1 Mbyte)
add FLASH_MODE and set it to DOUT
compile and successfully flash it
but when it generates the accessory key, it says that key can't be stored in flash
And failed to pair
Maybe I miss something?

Is using a static IP possible?

Hi,

Can you use a static IP instead of DHCP?
I already looked at the esp-open-rtos site but I don't find anything that works.
Can somebody help me to set this up?
Thanks.
Korstiaan

Proposal: Create Discussion Group for "esp-homekit"

Is there interest in creating a Facebook group (or Reddit)? That way the users could support each other while the developer(s) can spend more time focusing on bugs and improvments. If someone is unsure if something should be reported as a bug it could be discussed there first.

It could also be a place to brag about the interesting and creative ways you have put this library to use! 😉

HOMEKIT_CHARACTERISTIC getter

Is there a getter for the HOMEKIT_CHARACTERISTIC? When I open the Home app the current_position is not kept and there is no method to get it updated. How is it done? What method is called when opening Home app?

homekit_characteristic_t current_position = HOMEKIT_CHARACTERISTIC_(CURRENT_POSITION, 0);
homekit_characteristic_t target_position  = HOMEKIT_CHARACTERISTIC_(TARGET_POSITION, 0, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(on_update_target_position));
homekit_characteristic_t position_state   = HOMEKIT_CHARACTERISTIC_(POSITION_STATE, 0);

homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, "ESP Homekit Motor");
homekit_accessory_t *accessories[] = {
    HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_window, .services=(homekit_service_t*[]){
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
            &name,
            HOMEKIT_CHARACTERISTIC(MANUFACTURER, "iTead"),
            HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "037A2BABF19D"),
            HOMEKIT_CHARACTERISTIC(MODEL, "Sonoff T1 EU"),
            HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
            HOMEKIT_CHARACTERISTIC(IDENTIFY, led_identify),
            NULL
        }),
        HOMEKIT_SERVICE(WINDOW, .primary=true, .characteristics=(homekit_characteristic_t*[]){
            HOMEKIT_CHARACTERISTIC(NAME, "ESP Homekit Motor"),
            &current_position,
            &target_position,
            &position_state,
            NULL
        }),
        NULL
    }),
    NULL
};

make -C /example/led all error

hi all,
i setup as the readme, when make -C /example/led all , got the error bellow, could someone give any advices ,thanks

$ make -C ./examples/led all
make: Entering directory '/home/bi4wms/projects/esp-open-sdk/ESP8266_RTOS_SDK/esp-homekit-demo/examples/led'
CC /home/bi4wms/projects/esp-open-sdk/esp-open-rtos/open_esplibs/libmain/user_interface.c
/home/bi4wms/projects/esp-open-sdk/esp-open-rtos/open_esplibs/libmain/user_interface.c:11:23: fatal error: lwip/dhcp.h: No such file or directory
#include "lwip/dhcp.h"
^
compilation terminated.
/home/bi4wms/projects/esp-open-sdk/esp-open-rtos//open_esplibs/component.mk:15: recipe for target 'build/open_esplibs_libmain//user_interface.o' failed
make: *** [build/open_esplibs_libmain//user_interface.o] Error 1
make: Leaving directory '/home/bi4wms/projects/esp-open-sdk/ESP8266_RTOS_SDK/esp-homekit-demo/examples/led'

Merge efforts

@maximkulkin, thank you for taking this to the next level
I fully agree that my code looked messy and that is no surprise since I actually learned coding doing this project :-).
I propose that we join forces and together we bring this even further
I'll contact you to see how we could do that.
Again, kudos for investing!
HacK

Debug output keeps sending data when I don't want to

Hi,

I noticed that, even when HOMEKIT_DEBUG=0 the debug messages keep coming out via the serial output. (And I want the GPIO/TXT output for something else).
Is it because
#ifdef HOMEKIT_DEBUG
is used instead of
#if HOMEKIT_DEBUG > 0
Also when I don't have a HOMEKIT_DEBUG environment variable I still get the output?

Automations not working reliable

I have been testing the examples with automations and found a strange behavior.

My setup Sonoff with the example compiled with the latest build in the page only change mDND buffer increased to 1.5k, WEMO D1 with the Led example, HUE lamps

Create 2 automations were one device is the On/Off master and the others are On/Off slave so if master is turned ON slaves should turn on, if master is turned Off slaves are turned Off

Steps to reproduce:

Power up both devices and wait for the connection and open the homeApp
turn on master -> slaves will turn on, wait 5 seconds
turn off master -> slaves will turn off, wait 5 seconds
turn on master -> Slaves will stay off
Wait 1-2 min
Turn on master -> Slaves will turn on

I also tested the sonoff as master and HUE as Slave and the result is the same

Using a HUE lamp as master and the Sonoff and Led example as slave, works as expected

Using a HUE lamp as master and another HUE lamp as Slave works as expected

Wondering if its something only happening to me or something common to other makers

Initial State not reported after power cycle

I don't know if this is an issue, I hope some one may help me clarify this behavior:

Using de Led or Sonoff switch examples:

  1. Power On and Pair, and turn it ON, the status is reflected on the home app
  2. Power off the ESP by disconnecting from the power supply
  3. Power On again, both examples will fall back to off status, but in the home app the status stays as ON
  4. Close the home app, open again, the status is refreshed after few seconds, the log shows a pair and characteristics updates

I tested with commercial HomekIt solutions and this is not the case for example HUE lamps that after a power lost fall back to ON status, the status is refreshed in the home App with no problem in a very short time.

After studied the sonoff example (with my limited knowledge on this topic) I tried by including a homekit_characteristic_notify during gpio_init, but no luck, interesting is that the same homekit_characteristic_notify in the interrupt routine to detect button activation works perfect and the status is updated.

Is this an expected behavior?

Valid Values

Haw can i set valid values for characteristic:
homekit_characteristic_t TARGET_HEATING_COOLING_STATE = {
.type = HOMEKIT_CHARACTERISTIC_TARGET_HEATING_COOLING_STATE,
.format = homekit_format_uint8,
.permissions = homekit_permissions_paired_read
| homekit_permissions_paired_write
| homekit_permissions_notify,
.min_value = (float[]) {0},
.max_value = (float[]) {2},
.min_step = (float[]) {1},
0,
1,
2,
};

unstable accessory

hello I have created
https://github.com/ageorgios/esp-homekit-motor

but I find the accessory quite unstable
in the log I have this when the accessory is marked unresponsive, I cannot understand the reason it is happening and when.

>>> homekit_client_process: [Client 6] Finished processing
>>> mdns_recv: pbuf too big
>>> HomeKit: [Client 5] Closing client connection
>>> homekit_client_process: [Client 6] Got 129 incomming data
>>> homekit_client_process: [Client 6] Decrypting data
>>> homekit_client_process: [Client 6] Decrypted 111 bytes, available 0
Decrypted data (111 bytes): "GET /characteristics?id=1.11,1.10 HTTP/1.1\x0D\x0AHost: ESP\\032Homekit\\032Motor\\03212\\0581C\\0584C._hap._tcp.local\x0D\x0A\x0D\x0A"
>>> HomeKit: [Client 6] Get Characteristics
>>> homekit_server_on_get_characteristics: Free heap: 23136

any ideas?

two touch switch motor homekit device

I am trying to implement a two touch switch device that controls a motor. I am only starting though. I plan to use a Sonoff T1 2CH EU

I am trying to figure out how to implement the interlocking between the two buttons.
To clarify, AT NO TIME should both switches be ON at the same time, because this may damage the motor. So it is crucial that there will be no possibility such a thing to happen.

I am wondering if such code works so as to exclude this kind of situation

void button_callback(uint8_t gpio_num, button_event_t event) {
    taskENTER_CRITICAL();
    if (mutex == 0) {
        mutex = 1;
        taskEXIT_CRITICAL();
        if (gpio_num == button1_gpio) buttonUP_handle(4000);
        else if (gpio_num == button2_gpio) buttonDOWN_handle(4000);        
        mutex = 0;
    }
    else {
        taskEXIT_CRITICAL();
        printf("race condition, doing nothing");
    }
}

multiple sonoff

First, i have problem with debugging sonoff example
it won't boot in low power mode (from firmware update USB stick)
wifi_config seems nice (and working) feature
but If I try to use multiple this device
I have worked only one, the previous pairing seem to fail after new pairing
and if I can't debug this, I thought maybe problem with generating device UUID or certificate?
or maybe this problem with mDNS names?

Connection after wifi restart

I test my device. And after my wifi router restart, ios can not connect to device. Can you help me?
This repeated:
{"characteristics":[{"aid":1,"iid":13,"value":22}]}

client_send: Encrypting payload
send_tlv_response: Sending TLV response
tlv_debug: Got following TLV values:
tlv_debug: Type 6 value (1 bytes): \x04
homekit_client_task: Got 92 incomming data
homekit_client_task: Decrypting data
homekit_client_task: Decrypted 74 bytes, available 0
Decrypted data (74 bytes): "GET /accessories HTTP/1.1\x0D\x0AHost: Temperature\032Sensor._hap._tcp.local\x0D\x0A\x0D\x0A"
homekit_server_on_get_accessories: HomeKit Get Accessories
homekit_server_on_get_accessories: Free heap: 10692
send_json_response: Sending JSON response
Fatal exception (28):
epc1=0x4000bf80
epc2=0x00000000
epc3=0x40202578

0x40202578: sdk_system_pp_recycle_rx_pkt at /Volumes/cs/esp-open-sdk/esp-open-rtos/open_esplibs/libmain/user_interface.c:620

excvaddr=0x00000000
depc=0x00000000
excsave1=0x40002ad0
Registers:
a0 40002ad0 a1 3fffa4d0 a2 00000000 a3 fffffffc
a4 000000ff a5 0000ff00 a6 00ff0000 a7 ff000000
a8 0000001f a9 00000022 a10 00000002 a11 0000005c
a12 3fff4070 a13 3fffdb60 SAR 00000008

Stack: SP=0x3fffa4d0
0x3fffa4d0: 4021657d 3fffdb60 3fff4070 40216575

0x4021657d: send_json_response at /Volumes/cs/esp-open-sdk/esp-open-rtos/esp-homekit-demo/components/homekit/src/server.c:781

0x40216575: send_json_response at /Volumes/cs/esp-open-sdk/esp-open-rtos/esp-homekit-demo/components/homekit/src/server.c:780

0x3fffa4e0: 3fff3ff8 402354e0 000000c8 40230600

0x402354e0: homekit_characteristic_has_notify_callback at ??:?

0x40230600: cJSON_strdup at /Volumes/cs/esp-open-sdk/esp-open-rtos/esp-homekit-demo/components/cJSON/cJSON/cJSON.c:1200

0x3fffa4f0: 3fff1728 3fffdc98 3fffdb60 3fff3ff8
0x3fffa500: 00000000 3fffdb60 00000000 40217cb9

0x40217cb9: homekit_server_on_get_accessories at /Volumes/cs/esp-open-sdk/esp-open-rtos/esp-homekit-demo/components/homekit/src/server.c:1828

0x3fffa510: 3fffdc98 3ffe898c 3fffc4b0 3ffe8970
0x3fffa520: 3fff99f8 3fff4070 00000000 00000001
0x3fffa530: fffffffe 00000001 00000001 3fffa8c9
0x3fffa540: 00010000 3fffa8ca 3fff3ff8 40218909

0x40218909: homekit_server_on_message_complete at /Volumes/cs/esp-open-sdk/esp-open-rtos/esp-homekit-demo/components/homekit/src/server.c:2530

Free Heap: 2260
_heap_start 0x3fff1930 brk 0x3ffff854 supervisor sp 0x3ffffb00 sp-brk 684 bytes
arena (total_size) 57124 fordblks (free_size) 1576 uordblocks (used_size) 55548

ets Jan 8 2013,rst cause:2, boot mode:(1,6)

ets Jan 8 2013,rst cause:4, boot mode:(1,6)

wdt reset

Failed boot

If I compile with make test, it works
but after restarted all demo wont boot

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

ets_main.c 

stepper delay

Hi, I'm trying to make door lock with stepper motor. I implemented code for stepper instead of led in your user_main.c, but I need delay of 2ms between the steps and vTaskDelay is 10ms. I tried to change configTICK_RATE_HZ from 100 to 1000 in FreeRTOSConfig.h, but with no effect. Can you please help me with this? Can I change vTaskDelay to 1ms? or can I use some other way to make 2ms pauses between steps? thank you!

unpair and repair

Hello.

I build example successfully, make pair, delete accessory. But can not repair. There is not accessory in list.

Detailed instructions on how to do this

Hello,
I am kinda new to all this and I am currently using my WeMos D1 mini in connection with Homebridge. It would be very cool, if it was possible to do all this without Homebridge, but even if you have instructions, I still can not manage to get this on my board. I would very appreciate it if anyone had detailed step by step instructions on how to do this ! :)

LED Example: On/Off Inverted in Homekit Display

When I ran the LED example Homekit showed that the Light was off when the LED was on (and vice versa). I got the expected result by modifying the following line:

gpio_write(led_gpio, on ? 0 : 1);

gpio_write(led_gpio, on ? 1 : 0);

The way you have it currently the when on = true the LED is set to 0 (which turns it off), so I believe that should be reversed.

Disclaimer: I only have a basic electronics understanding so I could be wiring things backwards. (I have a resistor pulling the negative lead to ground when the GPIO pin is activated.) But this change caused the expected results for me. :)

Thank you for the wonderful code! Homebridge has been too unreliable for me once I add more than one or two plugins, so I am excited to be able to create my own devices which can speak directly to Homekit!

memory: stack overflow

I am creating a TASK with xTaskCreate with stack size 128 and I am getting stack overflow errors.
Is the memory so small that it could happen?

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.