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

How to use C/C++ PlatformIO/Arduino Framework (Not MaixPy) to use wifi #126

Open
marcusobrien opened this issue Oct 11, 2022 · 3 comments
Open

Comments

@marcusobrien
Copy link

Hi,

How can I use the ESP32 Wifi module from C/C++ ? It only seems to work using the MaixPy wifi example. When I run the default ESP32 firmware, and this C++ application code

` Serial.begin(115200); // initialize serial for debugging
WiFi.init(); // initialize ESP32 WiFi module

if (WiFi.status() == WL_NO_SHIELD)
{
Serial.println("No WiFi HW - Halting FW");
while (true);
}

int8_t numberNetworks = WiFi.scanNetworks();
Serial.print("Scan Wifi Found : ");
Serial.println(numberNetworks);`

This just prints the following output....

Error 4
Scan Wifi Found: 0

Note that the wifi works if I use MaixPy firmware and the example code. Also I have 2 Maixduinos both of them dont work with the C++ SDK, but both work with the Python way.

Where is the ESP32 FW that will allow me to use the wifi from the Maixduino C/C++ application ?

@romainreignier
Copy link

See my comment #87 (comment)

@marcusobrien
Copy link
Author

See my comment #87 (comment)

Hi - So which firmware do I put on the ESP32 on the Maixduino ? My ESP32 doesnt have the original firmware anymore - as I've been experimenting with lots of different ones - there are 4 prebuilt binaries in the Maixduino web portal - do I sue one of those ? ie https://dl.sipeed.com/shareURL/MAIX/factory_firmware/esp32

Has the following
maixduino_esp32_firmware_v1.4.1_0x0.bin
maixduino_esp32_firmware_v1.4.0.bin
NINA_W122_33.bin
NINA_W122_25.bin

"I have managed to communicate it with the fork of WiFiEsp (branch esp32_spi) by @scpcom and using its fork of Maixduino."

Then you mention you have used two repos to talk to the Wifi, I'm not sure how I get this working. I have some demo code (as above), but once I have the above FW on the ESP32, do I just use this repo as the platform io library (branch esp32_spi) ?

https://github.com/scpcom/WiFiEsp/tree/esp32_spi

Or this one - the fork you mentioned ?

https://github.com/scpcom/Maixduino

@scpcom
Copy link

scpcom commented Oct 15, 2022

Yes, my fork of WifiEsp is integrated into my fork of Maixduino:
https://github.com/scpcom/Maixduino/releases
It may work standalone but using my board package is the easiest way.
PS: If the package is installed an the board is selected in the Arduino IDE you can open the Tools menu and change the new option "WiFi Driver" to SPI

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

3 participants