I am working on ESP32CAM AI Thinker and need to configure it in Adhoc WiFi Mode.
Is it possible? If yes, please share the method to do so.
Regards
Shaunak
I am working on ESP32CAM AI Thinker and need to configure it in Adhoc WiFi Mode.
Is it possible? If yes, please share the method to do so.
Regards
Shaunak
@alanesq Thank you for the reply. Actually the method shared by you sets up the ESP32CAM as an Access Point and not in Adhoc mode. The reason for me to prefer Adhoc to Access Point is that in my application, I need almost no time for my device to get connected to ESP32CAM. If I set up ESP32CAM as an access point, it takes at least 8-10 seconds to get the IP address of ESP32CAM and connect. If I use the Adhoc method, this connection time latency can be reduced drastically.
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
... bunch of setup you don't need
WiFi.mode(WIFI_STA);
I think that's what you're looking for.
Appears that some links are available for investigation; normally I would investigate further, but for your need it is best if you review for value and appropriateness.
https://www.google.com/search?q=esp32+%22ad+hoc%22
You may already be familiar with the ESP32-Arduino official docs:
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html
Caveat: one forum member reports "painlessMesh" does not play well with some sensor libraries.
@cedarlakeinstruments Thank you for the reply. The wifi mode setting mentioned by you sets ESP32 to be able to connect to access point. The problem using access point is the time it takes to connect to it and start communicating. For example, the very first time we connect the computer with the router after finding its SSID and entering the password, it takes a few seconds to get connected. While in an Adhoc wifi mode, there is no access point and hence the connection gets established within almost no time.
@mrburnette Thank you for the reply. I went through the google search results shared by you and also the ESP32 Arduino doc. It seems to me that ESP32, itself does not support the Adhoc wifi mode where it can be set as an Adhoc point, but it seems to have the features that let it connect to an access point. In my application, I do not require any mesh architecture to be implemented between two or more ESP32s, so I went through the "painlessmesh" link shared by you, but I won't be able to use that resource due to my different application requirement.
Found the answer here : Can ESP32 be configured in Adhoc WiFi Mode? - ESP32 Forum
ESP32 can not be configured in Adhoc wifi mode.
/facepalm
Sorry. I uncommented that line (this is from a sensor that I built) because I forgot that it was already in AP, not Station mode.
// WiFiMode_t MODE = WIFI_STA;
WiFiMode_t MODE = WIFI_AP;
That said, it's interesting because I was under the impression that AP mode was the same as Ad-hoc mode and I always used the terms interchangeably. TIL!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.