-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Unable to connect to esp32 in AP mode #70
Comments
please attach your sketch. In theory BT and WiFi should be able to co-exists |
I simply used the WiFiAccessPoint.ino example. |
Would you mind attaching the |
Surely. I thought it was enough to get it from the library, like I did. |
I can confirm this issue. I am attaching a sketch here:
|
This sketch works with my ESP32 when I don't use the bluepad32 board type |
The problem only occurs in access point mode, whether using WiFi.mode(WIFI_AP_STA) or WiFi.mode(WIFI_AP). Using WiFi.mode(WIFI_STA) connects to network without problems. I tried from an Android smartphone and a Windows PC. |
And in my use case, the WIFI_STA mode is not applicable as I am trying to gather a local SSID and password via a local AP. Then I could connect in WIFI_STA mode after. |
I have the exact same problem with my code. I want to drive a little tank around that has a camera built in that I view via access point. I can connect it to a network but the camera will not load in browser. |
interesting... perhaps I forgot to enable a feature in the |
I tried to see if I could use ps4 controller with https://github.com/aed3/PS4-esp32 in stead and it does seem to be a bluetooth and wifi issue. The moment I connect the controller I can't connect the wifi and if I connect the wifi first the board crashes and reboots the moment i connect the controller. I'm using an esp32 cam. |
I can confirm that this example fails for me also when the board type is one with bluepad32 enabled. Works fine with an ordinary ESP32 board type. |
Watchdog is enabled in Bluepad32 version... so your code should never have a E.g: from https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino, you should add in line 98 something like // close the connection:
client.stop();
Serial.println("Client Disconnected.");
}
vTaskDelay(1); // <-- ADD THIS LIE
} reopen if that doesn't work |
This does not work for me. So re-opening. |
Please copy paste the patched sketch. I want to double-checked that it was patched correctly |
|
My sample code does NOT even have any contents in |
There is a |
how long is |
I confirm that with the attached sketch from @jsolderitsch using the template project in (just rename After the connection, I see these messages on the console, that confirms that the connection was Ok:
I don't know why it doesn't work from the Arduino IDE... I'll look at it next week |
Thanks for checking. I will check this out real soon. I would like the Arduino IDE to be happy with this as well as my class is planning on using an extension of this example with gamepads in an assignment in a couple of weeks. |
@jsolderitsch this one: #70 (comment) |
Great, will use this one. |
Code for sketch.cpp:
|
This is with an AdaFruit ESP32 Feather. I had to use menuconfig to set a large partition size. |
I reused an existing my_project folder rather than starting from scratch. I replaced the sketch.cpp with the contents I pasted above and refreshed git with the command sequence:
and then did the idf.py commands like I have always been doing. |
Further up in the output from the idf.py flash command I see:
Is this a serious error that must be resolved? If so, how? |
Gently asking if there might be time to investigate this now that the 4.0 release is available? |
not clear what's the issue.
I used an Android phone to connect to it. And it got the 192.168.4.2 IP address. My logs has more info that yours... so not sure why it didn't work for you. There is some kind of "balance between WiFi and Bluetooth" settings. It would be great if you can play with it and tell me which one works for you. E.g: Go to the template project and from there do:
and I wouldn't know which option you have to change, but IIRC search for "component config" -> "Wi-Fi" and play with the different options. And do:
|
What version of idf.py are you running? I tried this example back in the Arduino IDE, after converting the console prints back to serial ones, and I get the same failure to complete the password challenge. Used the iPhone this time rather than my Mac WiFi. So I will set up a new template project and try again. I will also try with a Dev Kit version of the ESP32 instead of my AdaFruit Feather. |
I tested it using v4.4.7 using SparkFun ESP32 Thing. If you can play a bit with the different WiFi options I mentioned on the previous comment. But guess is that this is not related to Bluepad32... but to how to use both Bluetooth and WiFi at the some time on ESP32... search online to see whether there are some hints. Perhaps you need to disable Bluetooth scanning with |
Can anyone connect to access point using this code? Because at present, with Arduino Ide it is still not possible to connect... |
@antonix883 I can try later today/tomorrow. In the meantime, could you add this:
to see whether that helps? |
"'BP32' was not declared in this scope" The problem is that the connection in Access Point mode does not occur only if the code is compiled with the "ESP32 Arduino + Bluepad32" library cards. If the same code is compiled with "ESP32 Arduino" the connection is successful. This is regardless of whether the features of the Bluepad32 library are used or not. I hope I was clear. |
@antonix883 add at the top: #include <Bluepad32.h> and try again with I understand what you are saying... my guess is that Bluetooth is scanning while WiFi is broadcasting its AP... and that might be the issue |
I tried this approach to my example, adding in the |
Of course I tried to include the library just to try. It did not work. Besides, if the code doesn't use the library, I don't think the problem could be Bluetooth. Also because it works in station mode. So the problem only affects wifi in access point mode. |
What happened?
Today I noticed that using the bluepad32 library boards, the wifi in Access Point mode does not allow connection to any device. With the same code, compiling using standard esp32 boards, there are no problems. Has anyone else encountered the same issue? The controller however connects without problems and works. The board also connects in Station mode.
Bluepad32 Version
3.10.3
Bluepad32 version custom
Example: Using Git develop branch commit hash #xxxxxxx
Bluepad32 Platform
Arduino IDE
Platform version
Arduino IDE 1.8.4
Controller
DS4 AceGamer
ESP32 chip
ESP32
ESP32 board
ESP32-Wroom 32
OS
Windows
Relevant log output
No response
Relevant sketch
No response
The text was updated successfully, but these errors were encountered: