Embed aws iot device sdk to Micropython as user C module

119 views Asked by At

Since there's no official aws iot device sdk for micropython, I'd like to compile embed the official C SDK into micropython as a user module.

I following the guide from micropython official documentation on how to compile an external C modules into micropython.

The first method I'd like to use is initializeMqtt(). I added the include directories to the makefile (e.g.: CFLAGS_USERMOD += -I$(LIBS)/$(OPENSSL_DIR)/include/). Then I could compile it, but after I got some linker errors in connection with openssl. I cloned openssl from the official openssl Github page, and update the include directories, and started to add the missing .c files to the makefile, to compile it in. After I had the same results, and tried to found the missing references (search in openssl source), and I add the neccessary .c files, to the makefile (e.g.: SRC_USERMOD += $(LIBS)/$(OPENSSL_DIR)/crypto/cryptlib.c). Now I got more and more linking, errors like:

  • undefined reference to X509_VERIFY_PARAM_move_peername.
  • undefined reference to tls1_set_groups_list and so on.

I use MacOS, I have installed openssl, added the must have flags to .profile.

Is it even possible achieve what I want?

0

There are 0 answers