Giter Site home page Giter Site logo

Comments (17)

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024 1

Finally I find the solution about how to turn the AP and STA at the same time so I can still reconfigure my ESP8266 anytime I want.

In AutoConnect.cpp :
bool AutoConnect::begin(const char* ssid, const char* passphrase, unsigned long timeout)
line 99, I just change the WiFi.mode from WIFI_STA to WIFI_AP_STA and add this line below.
WiFi.softAP(_apConfig.apid.c_str(), _apConfig.psk.c_str(), _apConfig.channel, _apConfig.hidden);

from autoconnect.

Hieromon avatar Hieromon commented on September 28, 2024

I can not understand your request well, but you can not do that an ESP8266 connected to some AP connects to another AP via a captive portal again. It is not an ESP8266 problem or an AutoConnect problem.

I can't find my ESP8266 AP WiFi Connection

What does this mean?

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

Sorry for my bad language. Let me explain what I mean. For example I have 2 WiFi connection called Wifi-A and Wifi-B. First I connect my ESP8266 to Wifi-A through my phone via captive portal. But the next day I want to change my ESP8266 connection to Wifi-B. How can I do this when my ESP8266 already connected to Wifi-A?

from autoconnect.

ageurtse avatar ageurtse commented on September 28, 2024

Go to the ipadres of this module when in wifi-a network and add /_ac to the ip adress

For a device in my network it looks like this
http://192.168.1.185/_ac

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

Go to the ipadres of this module when in wifi-a network and add /_ac to the ip adress

For a device in my network it looks like this
http://192.168.1.185/_ac

I understand what you mean. But to do that I need to connect to Wifi-A and know the IP Address first and it's hard to make it portable. What I'm looking for is how to configure it via my ESP8266 AP without need to connect to Wifi-A first as the first time I set my ESP8266. Is there any other way to keep my ESP8266 act as AP and STA even it's already connect to a WiFi Connection so I can connect to the AP anytime I want?

from autoconnect.

ageurtse avatar ageurtse commented on September 28, 2024

i don't think this is possible, maybe you could temporarly disable wifi-a, reboot your device.
it can't connect so it will go to AP mode, now you can connect to wifi-B

or you need to make a ap-mode button on your device. when hitting this button the device goes to AP mode, from there you could connect to its wifi and alter the wifi settings.

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

i don't think this is possible, maybe you could temporarly disable wifi-a, reboot your device.
it can't connect so it will go to AP mode, now you can connect to wifi-B

or you need to make a ap-mode button on your device. when hitting this button the device goes to AP mode, from there you could connect to its wifi and alter the wifi settings.

So the only way to set my ESP8266 to AP-mode is by let it timeout when trying to connecting to saved WiFi? Is that what u mean?

from autoconnect.

ageurtse avatar ageurtse commented on September 28, 2024

yes, that is what i mean, i don't think there is an easy different way.

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

yes, that is what i mean, i don't think there is an easy different way.

Okay, thank you very much for your response and help. I'll hope I can find another option for this case.

from autoconnect.

Hieromon avatar Hieromon commented on September 28, 2024

I think the method shown by @ageurtse is effective basically. I feel like what @lukiusnatanael wants is some gateway facility or the router. It needs to cross different networks, right?

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

I think the method shown by @ageurtse is effective basically. I feel like what @lukiusnatanael wants is some gateway facility or the router. It needs to cross different networks, right?

Yeah, maybe more like I'm trying to set the ESP8266 as AP and STA at the same time always. So it's still can connected to a router but it's also always act as AP so I can reconfigure it everytime I want.

from autoconnect.

Hieromon avatar Hieromon commented on September 28, 2024

Indeed, the method you have shown will expose the ESP8266's SSID at AP_STA. However, if your request is that ESP8266 will always stay at AP_STA, the following steps may be more appropriate:

  1. Comment out the below line.

    _apConfig.autoReconnect = false;

  2. Configure the immediateStart & the autoReconnect.

  3. Performs AutoConnect::config with the above options.

  4. Performs AutoConnect::begin.

This method may have some little difference with your request because it cannot still span different networks. But you can try this. If some problems occur, we can consult again.

from autoconnect.

lukiusnatanael avatar lukiusnatanael commented on September 28, 2024

Indeed, the method you have shown will expose the ESP8266's SSID at AP_STA. However, if your request is that ESP8266 will always stay at AP_STA, the following steps may be more appropriate:

  1. Comment out the below line.

      [AutoConnect/src/AutoConnect.cpp](https://github.com/Hieromon/AutoConnect/blob/c2eeafe759be409a5b80b1fc1cf00c9344df6990/src/AutoConnect.cpp#L127)
    
    
         Line 127
      in
      [c2eeafe](/Hieromon/AutoConnect/commit/c2eeafe759be409a5b80b1fc1cf00c9344df6990)
    
    
    
    
    
        
          
           _apConfig.autoReconnect = false;
    
  2. Configure the immediateStart & the autoReconnect.

  3. Performs AutoConnect::config with the above options.

  4. Performs AutoConnect::begin.

This method may have some little difference with your request because it cannot still span different networks. But you can try this. If some problems occur, we can consult again.

Okay I'll try it, I'll tell you the result later.
Thankyou very much for your help.

from autoconnect.

scropion86 avatar scropion86 commented on September 28, 2024

wifi.disconnect() to dissconnect and clear the saved WiFi credentials (By SDK not the library)

then

portal.begin() to start AutoConnect again and join another wifi SSID

from autoconnect.

Hieromon avatar Hieromon commented on September 28, 2024

@scropion86
That's right. It's simple.

from autoconnect.

Hieromon avatar Hieromon commented on September 28, 2024

Since there was no response even after one month passed, closed this issue.
When some reports are posted, reopen it.

from autoconnect.

antoniocgg avatar antoniocgg commented on September 28, 2024

Had the same issue.
Wanted to access my esp32 anytime, was it connected or not. The solution from lukiusnatanael Apr 20, worked.

from autoconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.