Hi to all, I'm newbie about arduino.
I'm testing some code found on the web
As first test I'm working on a DS18B20 web interface to read temperature from my smartphone.
I can correctly connect to hotspot but to access to DS18B20 web interface I need to set "fly mode" then enable WiFi.
DS18B20 has 192.168.4.1 but I suppose route for 192.168.4.1 has default gateway....
How solve this?
Thanks.
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
sensors.begin(); // inizializzo DS18B20
Serial.print("Setting AP (Access Point)…");
// Remove the password parameter, if you want the AP (Access Point) to be open
WiFi.softAP(ssid, password);
IPAddress IP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(IP);
// Print ESP8266 Local IP Address
Serial.println(WiFi.localIP());
When you set your Arduino to be an "Access Point" you are creating a NEW WiFi network. Did you want your Arduino to join an existing network? That would be "Station" mode, not "Access Point".
I don't think you can have your phone connected to two WiFi networks at the same time. If you connect to the WiFi network created by your Arduino it seems normal that you would need to disconnect from any other WiFi network.
If you connect your ESP8266 to your home WiFi network then your phone, connected to the same WiFi network, could fetch the temperature at any time.
If you switch to an ESP32 you can have the phone connect to the Arduino with BLE and fetch the temperature whenever it was within BLE range.
My phone is not connected on two wifi: is connected on the web through PPP (modem) and to wlan (wifi), so there is no way it can't work if there are two different networks.
PPP gives me public or private network (depending from operator settings) different from Wifi network 192.168.4.0/24.
So I just need to find setting to add 192.168.4.0/24 via wlan.
I don't want add additional AP just to read temperature few times in a day...
your English is very difficult to understand.
I didn't understand what kind of network you have.
I wrote this text in German and had it translated into english / Italian by google-translate.
I am sure that you understand this translation well.
This would prove that google-translate works well.
Write a detailed description in Italian and let google-translate translate it into English.
The most common situation is that there is a home Wi-Fi network that your smartphone, tablet, computer, etc. connect to.
An ESP8266 or ESP32 can ALSO connect to home WiFi.
Once this connection is established, you can access the ESP from your smartphone.
However, you haven't described anything at all about what your program does. As long as you don't describe it in detail and post your sketch, it's all just guesswork and constant misunderstanding because of too few words
the same text in italian language translated from german to italian by google-translate
ciao elberto,
il tuo inglese è molto difficile da capire.
Non ho capito che tipo di rete hai.
Ho scritto questo testo in tedesco e l'ho fatto tradurre in italiano da google-translate.
Sono sicuro che capisci bene questa traduzione.
Ciò dimostrerebbe che google-translate funziona bene.
Scrivi una descrizione dettagliata in italiano e lascia che google-translate la traduca in inglese.
La situazione più comune è che sia presente una rete Wi-Fi domestica a cui si collegano smartphone, tablet, computer, ecc.
Un ESP8266 o un ESP32 può ANCHE connettersi al WiFi di casa.
Una volta stabilita questa connessione, puoi accedere all'ESP dal tuo smartphone.
Tuttavia, non hai descritto nulla di ciò che fa il tuo programma. Finché non lo descrivi in dettaglio e pubblichi il tuo schizzo, sono solo congetture e continue incomprensioni a causa di troppo poche parole