How to install external C libraries? #11519
Replies: 1 comment
-
In theory this is possible, but this is not going to be at all straightforward. Here's how I would maybe approach it.
I mean this with kindness not criticism... this might not be the best thing to learn C with... there are a lot of parts here. Adding third-party code to a different existing build system is pretty much one of the most difficult things you can do in C. I think probably your best option to figure out how to make the Python implementation you linked to work on MicroPython. That is also easier said than done, but still much more clear how to proceed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to use Apple's HomeKit ADK, written in C, from within MicroPython.
There is a Python implementation of the HomeKit Accessory Protocol, but I'm not sure if it works with MicroPython on the Raspberry Pi Pico W.
I realize that I would have to write my own custom user module, as a bridge between the actual HomeKit ADK and MicroPython.
But I have no idea how adding external libraries even work. I have added the HomeKit ADK as a submodule inside the /lib directory, but that's as far as I've got.
Do I have to compile the external library separately, like adding a custom Makefile making it work with MicroPython? Or does the MicroPython compilation phase figure it all out using the library's source files?
What's the next step in creating the "bridge" user module? How do I import the external library in my custom user module? Is it as simple as this?:
How do I even know if this library will work on the port I want to use? (rp2, Pico W)
(There is a port of the HomeKit Accessory Protocol for the ESP32 and ESP8266.)
I'm completely lost. Can anyone guide me in the right direction?
Note: I have virtually no experience in writing C, but I guess I'll figure it out bit by bit. 😅
Beta Was this translation helpful? Give feedback.
All reactions