So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By BobAGI
#64646 Excuse the long post below, but I really would like to describe the situation so you understand our need...

We are investigating ways to expand access to our data collection system and I have been looking at ESP8266 for the last week. I have seen that there seems to exist a WiFi mode called "STATIONAP" which implements both an AP on the ESP8266 while at the same time(?) making it possible for it to join an existing hotspot...
Or did I misunderstand this mode? Maybe it means that it can be connected either to a hotspot or accept connections to itself? But not being connected both ways simultaneously.

Our field data collection system is designed to implement an Access Point to which another device (PC, Smartphone, tablet) can connect in order to communicate with it. The communication on the system is RS232 so we run a serial server on our current WiFi adapter (non-ESP8266).
But we found that when using the AP from an Android device that device loses Internet connection itself so it cannot channel data from the data collection unit to a server on the Internet....

Would the following be possible in order to keep the Internet connection on the controlling Android device:
1) ESP8266 implements an AP so that we can connect to it just as we do now.
2) ESP8266 also implements a station mode so it can connect to the Android device as client.
3) We create a new command for the data collection system where we can transfer connection data (SSID + Passphrase) to the data collection system
4) Then we first connect to our data collection system via its AP to send the connection info to it
5) Next we disconnect the AP from Android and start the Android hotspot instead
6) Finally we wait for the ESP8266 to connect as station to the hotspot
7) Once that connection is running we again connect to the data collection system but now we also have the mobile Internet connection running and we can transfer data directly from the data collection system to the home server.

Is this possible?
Is it overly complex such that it should be possible to simplify?

For example, is it possible to talk directly to the ESP8266 when connected to its AP mode and tell it to instead connect to our hotspot as client? That is bypassing the need for adding a WiFi control command to the command set for the data collection system?

I am a bit confused regarding how to actually control the ESP8266 in this case since we must use the serial port to connect to our data channel on the field system.