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

WiFiWebClient sketch from Mbed WiFi library does not connect to AP with Pico and ESP-Host #1

Open
lyusupov opened this issue Apr 24, 2024 · 12 comments

Comments

@lyusupov
Copy link

Board: Raspberry Pico
Core: ArduinoCore-Mbed 4.1.1
Sketch: WiFiWebClient

I can see numerous messages in a loop:

Attempting to connect to SSID: TestSSID
Attempting to connect to SSID: TestSSID
Attempting to connect to SSID: TestSSID
Attempting to connect to SSID: TestSSID
Attempting to connect to SSID: TestSSID

When I monitor UART messages from ESP-C3 Host - the log is empty.

My boards,local.txt file contains the following:

pico.build.extra_flags=-DESPHOST_RESET=9 -DESPHOST_HANDSHAKE=7 -DESPHOST_DATA_READY=6 -DESPHOST_CS=17 -DESPHOSTSPI=SPI

This issue happens with ESPHost-EMAC and Arduino-Mbed Core only.

The same hardware works fine with ESPHost driver integrated into Arduino PRP2040 Core developed by Earle Philhower (3.8.0).

boards,local.txt file for Earle's Core contains the following:

rpipico.build.extra_flags=-DESPHOST_RESET=D9 -DESPHOST_HANDSHAKE=D7 -DESPHOST_DATA_READY=D6 -DESPHOST_CS=D17 -DESPHOSTSPI=SPI

When I monitor UART messages from ESP-C3 Host connected to the Pico with Earle's Core - I can see regular boot log messages and connection session.

@JAndrassy
Copy link
Member

JAndrassy commented Apr 24, 2024

@JAndrassy
Copy link
Member

right sorry.
did you do this from README?

In WiFi.cpp add this line at the end of the file. arduino::WiFiClass WiFi(WiFiInterface::get_default_instance());

@lyusupov
Copy link
Author

lyusupov commented Apr 24, 2024

Sure, I did:

$ tail -10 libraries/WiFi/src/WiFi.cpp
arduino::WiFiClass WiFi(WiFiInterface::get_default_instance());
#endif

// every specialization library should declare its own WiFI object: eg
//
// static ESP8266Interface wifi_if(PD_8, PD_9);
// arduino::WiFiClass WiFi(&wifi_if);

arduino::WiFiClass WiFi(WiFiInterface::get_default_instance());

As well as the header file:

#if 1 // defined(COMPONENT_4343W_FS)
#include "WhdSoftAPInterface.h"
#endif

@JAndrassy
Copy link
Member

the C3 version of the firmware uses 30 MHz SPI. I wonder that with Pico Core it worked without -DESPHOSTSPI_MHZ=30

@lyusupov
Copy link
Author

lyusupov commented Apr 24, 2024

Adding -DESPHOSTSPI_MHZ=30 to boards,local.txt file gives no positive effect to me.

$ tail -2 ~/.arduino15/packages/arduino/hardware/mbed_rp2040/4.1.1/boards.local.txt
pico.build.extra_flags=-DESPHOST_RESET=9 -DESPHOST_HANDSHAKE=7 -DESPHOST_DATA_READY=6 -DESPHOST_CS=17 -DESPHOSTSPI=SPI -DESPHOSTSPI_MHZ=30

I wonder why the ESPHost-EMAC does not apply RESET ( ESPHOST_RESET=9 ) to the ESP32-C3 every time the sketch boots up, like the Pico Core does.

@JAndrassy
Copy link
Member

did you restart the IDE after changing boards.local.txt?

reset is done by the ESPHost library so that should be the same

@lyusupov
Copy link
Author

lyusupov commented Apr 24, 2024

did you restart the IDE after changing boards.local.txt?

I use arduino-cli. It senses all the dependencies and makes a complete rebuild when necessary.
It did the complete sketch rebuild after boards.local.txt update as well.

reset is done by the ESPHost library so that should be the same

I wonder if the Mbed Core uses the same PinName-to-GPIO mapping as the Pico Core does...
If it does not - it may cause a lot of troubles.

@JAndrassy
Copy link
Member

for Pico in Mbed Core pins mapping is simple. pins 0 to 29 are p0 to p29.

last time I wired the Pico to C3 I didn't test with Mbed Core only with the Pico Core so now I wired them together again. I will test it tomorrow.

@lyusupov
Copy link
Author

last time I wired the Pico to C3 I didn't test with Mbed Core only with the Pico Core so now I wired them together again. I will test it tomorrow.

I guessed that by noticing "can work" words in the statement below:

Works with Nano RP2040 Connect and can work with Nano 33 BLE and Raspberry PI Pico with esp32 wired on SPI.

@JAndrassy
Copy link
Member

that is because Nano RP2040 has ESP32 on board and the other two require to wire an ESP32 to them

@JAndrassy
Copy link
Member

I tested it and it works. Maybe Mbed Core or the WiFi library has some problem with your WiFi? Is it WPA?

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

2 participants