0

I have this code in my custom micropython module:

#include <WiFi.h>

I use this code to build:

source ./esp-idf/export.sh

      
echo "cd ./micropython/ports/esp32"
cd ./micropython/ports/esp32
      
make BOARD=GENERIC_S3 USER_C_MODULES=../../../../micropython.cmake
#echo "cd ./boards/esp32/MICROLITE_S3"
#cd ./boards/esp32/MICROLITE_S3
echo "Building MICROLITE_S3"
rm -rf build
idf.py clean build

I get this error

fatal error: WiFi.h: No such file or directory #include <WiFi.h>
GILO
  • 2,444
  • 21
  • 47
  • 1
    Looks like your question is incomplete? What happens after running these commands? – Jardel Lucca Jun 21 '22 at 18:33
  • 1
    @JardelLucca Sorry forgot to add the error, now been added – GILO Jun 21 '22 at 18:44
  • Try adding the path for "WiFi.h" in your Makefile, or add it in the command line such as explained [here](https://stackoverflow.com/questions/7561509/how-to-add-include-and-lib-paths-to-configure-make-cycle). – Jardel Lucca Jun 21 '22 at 18:55

1 Answers1

0

It looks like you’re trying to use Arduino code in your module. MicroPython is not built on top of the Arduino framework, so that’s not going to work.

You’ll need to rewrite your code to only call ESP-IDF functions, not Arduino ones.

romkey
  • 6,218
  • 3
  • 16
  • 12
  • So do I add the esp-idf functions into the module, or do I reference them? – GILO Jun 22 '22 at 10:23
  • Just use them as you would anywhere. Be sure to #include the necessary header files. Make sure they’re actually esp-idf functions not Arduino functions. – romkey Jun 22 '22 at 14:24