Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino IDE support #2

Open
Asteliks opened this issue Jun 6, 2020 · 20 comments
Open

Arduino IDE support #2

Asteliks opened this issue Jun 6, 2020 · 20 comments

Comments

@Asteliks
Copy link

Asteliks commented Jun 6, 2020

Could you make a version of this compatible with the Arduino IDE?

@Asteliks Asteliks changed the title Andino IDE suport Andino IDE support Jun 6, 2020
@jwktje
Copy link

jwktje commented Jun 25, 2020

I would also love this. But I think it’s probably unlikely to happen.

@shahpiyushv
Copy link
Collaborator

It isn't that straight forward because a majority of code and APIs is from the Apple ADK directly. The Arduino support for ESP32 is mostly in the form of pre-built libraries and a wrappers on top of that, which could be quite cumbersome (but not impossible) for this project. I do not plan to do this myself any time soon, but contributions from the community are always welcome :)

@jwktje
Copy link

jwktje commented Jun 25, 2020

Yeah that's what I figured. After looking through the Lightbulb example though, I gotta be honest; it looks like a lot.
I've used maximkulkin/esp-homekit for a couple DIY homekit devices around the house. It took some time to figure out the workflow but after getting past the initial learning curve the final code seemed reasonable in size.

I'm sure that this esp-apple-homekit-adk would work great once you take the time to master it. But as a hobbyist myself it feels like the barrier to entry is quite high. The code looks daunting to me (but probably not to actual embedded developers).

The reason that Arduino IDE support would be cool is not really because I would like to use Arduino. I guess the question (for me) boils down to; I wish it was as simple as Arduino to a newcomer.

If I imagine an arduino sketch that needs to connect to Wifi and would allow the on/off states of a GPIO (for something like a relay for example) through a HTTP server endpoint, I could make that work in less than 50 LOC with some libraries.

Obviously going through HomeKit for something like this adds complexity. And obviously Arduino libraries keep the sketch code short (but the compiled binary larger). And of course the IDF is way more "close to the metal", making for (on average) more includes at the top and more verbose code to get something running (with the added benefit of less dependencies, better performance and more freedom to make the firmware work exactly how you want without it being dictated by a library).

I totally understand all that. After hearing that the Homekit ADK was open source and supported by Espressif directly I was super stoked. But I've already had 3 different days where I had some free time wanting to get started with it, but ended up abandoning it. Mostly because there isn't much to tinker with.

Maybe someone can make a library on top of this esp-apple-homekit-adk port that would handle most of the universal HomeKit parts?

@vicfrancco
Copy link

vicfrancco commented Aug 3, 2020

I understand what jwktje has said. For Newbies like me, it’s a very high learning curve to get to know how to program in the ESP-IDF way and to match it with Apple ADK way.

Furthermore, I think the “monster” could be much shorter if we had examples that dealt with our world (makers world I mean).

After reading the Lightbulb example here and comparing to the Apple’s ADK one, what I’ve understood is that the Espressif’s example is a port of Apple’s example.

I think that if Espressif could bring us an example that shows us how to set the GPIO32 (or other GPIO) level (high or low) of an ESP32 that controls a relay to which that same Lightbulb of the example, it would be much more useful.

@bfaliszek
Copy link

I'm also looking for a Arduino version. I found recently - https://github.com/Mixiaoxiao/Arduino-HomeKit-ESP32 and the example works. It is a pity that the description says that the library will no longer be developed.

@vicfrancco
Copy link

vicfrancco commented Aug 16, 2020

I'm also looking for a Arduino version. I found recently - https://github.com/Mixiaoxiao/Arduino-HomeKit-ESP32 and the example works. It is a pity that the description says that the library will no longer be developed.

Yes, the example works for me too. Within 5 minutes reading the code I was able to find out how he changes the level of GPIO 2.

Unfortunately, it seems like the library will no longer be developed, because Espressif released the official Homekit ADK, witch, actually, seems to be not maker's friendly at all.

A well documented example of the simple led approach woud be very important.

@bfaliszek
Copy link

I found one more library to handle home kit on esp32. It seems significant and more stable to me than the previous one: https://github.com/Yurik72/ESPHap/tree/master

@Asteliks
Copy link
Author

I have managed to make some examples using this library. Actually ones everything starts working it's not that hard. So far it is stable. Link to my repo: https://github.com/Asteliks/AppleHomeKitADK-ESP32

@JohnWickham
Copy link

JohnWickham commented Sep 22, 2020

Wanted to +1 @bfaliszek’s recommendation of https://github.com/Yurik72/ESPHap. It’s the first HAP library that I’ve managed to get working with Arduino and it works nearly perfectly. I’m using it both with ESP8266 and ESP32 which is a big bonus.

Before that I was using https://github.com/maximkulkin/esp-homekit, but it was cumbersome and required Linux virtualization as Espressif’s 8266 toolchain no longer builds on macOS Catalina. As a HomeKit-hobbyist, that took a lot of the fun out of it.

@shahpiyushv
Copy link
Collaborator

We have now opened up our own implementation of HomeKit. Check out the ESP HomeKit SDK here and see if suits your requirements.

@JohnWickham
Copy link

Thanks @shahpiyushv, that looks interesting. But it seems that it only supports ESP32, not ESP8266, correct?

You can use esp-homekit-sdk with any ESP32 or ESP32-S2 board

@shahpiyushv
Copy link
Collaborator

Thanks @shahpiyushv, that looks interesting. But it seems that it only supports ESP32, not ESP8266, correct?

You can use esp-homekit-sdk with any ESP32 or ESP32-S2 board

@JohnWickham , actually, with some changes, it did indeed work fine with ESP8266. I will make the required changes in a few days.

@arihantdaga
Copy link

@shahpiyushv Does this mean that now it'll be Arduino compatible? What would one need to do to in order to use the sdk in an arduino project ?

@shahpiyushv shahpiyushv changed the title Andino IDE support Arduino IDE support Sep 28, 2020
@shahpiyushv
Copy link
Collaborator

@arihantdaga , Arduino support may still not be available anytime soon, but this new SDK has a different set of (simpler) APIs for writing an accessory with many more examples and ready to use functions for different services. It also has other integrations like use of the QR code based Wi-Fi provisioning and also gels well with our other products, particularly ESP RainMaker. We already have an example available which will give you Alexa + Google + Siri control. Since this new SDK is developed in-house, it may probably be easier for us to add into Arduino in future.

@Yurik72
Copy link

Yurik72 commented Sep 29, 2020

@shahpiyushv, could please comment realistic scenario for Arduino.
your opened repository https://github.com/espressif/esp-homekit-sdk looks very promise. I'd say, the efforts to support arduino for ESP32 is quite clear at least to me. But to support ESP8266, based on this code, we need Arduino for ESP8266 based on the FreeRTOS implementation . Those discussed a lot of times, Therefore a question, what is your realitys and plans ?
This question is only about that usage of ESP-IDF is not a problem for "experienced" users,l but for guys like schoolboys is not possible.

@shahpiyushv
Copy link
Collaborator

@shahpiyushv, could please comment realistic scenario for Arduino.
your opened repository https://github.com/espressif/esp-homekit-sdk looks very promise. I'd say, the efforts to support arduino for ESP32 is quite clear at least to me. But to support ESP8266, based on this code, we need Arduino for ESP8266 based on the FreeRTOS implementation . Those discussed a lot of times, Therefore a question, what is your realitys and plans ?
This question is only about that usage of ESP-IDF is not a problem for "experienced" users,l but for guys like schoolboys is not possible.

The esp-homekit-sdk would work with esp-idf and ESP8266-RTOS-SDK. With regards to Arduino, we may add it for ESP32, but not ESP8266. I guess ESP32 + Arduino should still be good enough for the "schoolboys" :)

@shahpiyushv
Copy link
Collaborator

We have now added support for ESP8266 in esp-homekit-sdk.

@tomdmt
Copy link

tomdmt commented Jul 21, 2021

Any news on that Arduino IDE support?

@shahpiyushv
Copy link
Collaborator

@tomdmt , sorry, but we aren't really working on adding this into Arduino :-/

@FloBer431
Copy link

@shahpiyushv Is there anything new about this topic? Almost 3 years now, is there still no Arduino IDE support for ESP Apple Homekit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants