-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Wifi Examples Building, Hanging #83
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
Comments
So are you using esp32-arduino as idf component? Or are you using it through Arduino IDE? |
That will initialize the hardware, but not make you run through setup/loop. |
I followed your instructions here #13 (comment) to run it as an idf component. I've been using the esp-idf in part to get around the necessity of using setup and loop, so I will try an example using initArduino(); Are the "run arduino as idf component" and "use initArduino(); to start" in the documentation anywhere? I imagine that many people are using Arduino with esp32 simply for the library compatibility! |
To clarify: I set autostart to true previously. If I disable autostart, can I omit setup and loop completely? |
I did some digging and it looks like when you set So when esp32-hal.h is included config_autostart_arduino is not defined, and is defined as 1. I think this is causing the default app_main() in the ESP32 core to be defined instead of the users. |
Fixes issue where switch will not properly trigger if Arduino is used in IDF as component. See #83 (comment) 071
Oh you are so correct! What was I thinking when I wrote that :D Pull and try now |
so if you do not autostart arduino, you need to call initArduino(); in app_main to start WiFi/BLE or anything else that might be needed by the Arduino framework to function, except to run the setup/loop routine. So no thread is started for Arduino and you can do whatever you want, while using all Arduino API to access peripherals and so on. |
Ok so I pulled esp-idf, and cloned arduino into component folder in project folder. Now I'm getting these messages when trying to build:
I am not sure if this is between the component and my example or the esp-idf and my example. and my code looks like this:
Not sure what's going on here, thanks much for your help so far! |
this is probably cpp file so you need to add |
@forthlightning A few days before, I was doing the same thing as you, you can git clone this link as starting project template. I was using Eclipse IDE but it is not necessary. You might need to run make menuconfig before you start building it. The esp-idf setup I was simply following the setup guide by Espressif. |
@me-no-dev Yes! That was the problem. Thanks so much. Please consider adding some documentation about working with the arduino core as a component, I think many others will share my desire for the library compatibility of arduino and the flexibility of the esp-idf and freeRTOS. @bengchet thanks for the tip! this looks super useful, but I think I'll stick with the official repo for now. |
Great news :) I will add some info about using it as IDF component also. |
Fixes issue where switch will not properly trigger if Arduino is used in IDF as component. See espressif/arduino-esp32#83 (comment) 071
Fixes issue where switch will not properly trigger if Arduino is used in IDF as component. See espressif/arduino-esp32#83 (comment) 071
I am trying to run the wifi examples, they build and upload fine but the program hangs after initial boot. I've tried WiFiClient, WiFiClientBasic, WiFiEvents, and WiFiScan and they all result in similar output as below:
This may be unrelated but I have also been seeing this line recently
W (706) cpu_start: failed to load RF calibration data, falling back to full calibration
For reference I have freshly pulled esp-idf and arduino-esp32
The text was updated successfully, but these errors were encountered: