Hi there,
I am clearly going to show my ignorance about sockets and connections and wifi, but I am a little bit confused.
I have written B4R code that creates an ESP point through which I can communicate via a B4J app which sends the Wifi Credentials that the ESP chip needs to connect to the Wifi.
The first part of the communication on the ESP8266 chip is done via Async comms listening out on a port.
Once the Wifi credentials are passed, they are stored and a Wifi Connection is made, and then comms are carried out using MQTT through a connection to the Wifi Connection.
The B4J app connects to the ESP through the Access point, then once it has programmed the ESP, it reverts back to the Wifi - but it needs an IP address.
Hmmm... where am I going with this?
I am trying to do the B4J app in B4A now.
Question 1)
Why is it that I can immediately set up MQTT communications in B4A without specifying any socket or connection? It obviously is working through the current wifi connection, but how?
Question 2)
If I connect to the ESP from the B4A app, how do I then switch back to the Wifi network that the B4A app was connected to in the first place? How do I get the IP address of the Wifi network?
Bit confused in how to switch between the Access Point and whatever network the device was connected to BEFORE I switched to the AP....
I hope this makes some sort of sense...
JMB
I am clearly going to show my ignorance about sockets and connections and wifi, but I am a little bit confused.
I have written B4R code that creates an ESP point through which I can communicate via a B4J app which sends the Wifi Credentials that the ESP chip needs to connect to the Wifi.
The first part of the communication on the ESP8266 chip is done via Async comms listening out on a port.
Once the Wifi credentials are passed, they are stored and a Wifi Connection is made, and then comms are carried out using MQTT through a connection to the Wifi Connection.
The B4J app connects to the ESP through the Access point, then once it has programmed the ESP, it reverts back to the Wifi - but it needs an IP address.
Hmmm... where am I going with this?
I am trying to do the B4J app in B4A now.
Question 1)
Why is it that I can immediately set up MQTT communications in B4A without specifying any socket or connection? It obviously is working through the current wifi connection, but how?
Question 2)
If I connect to the ESP from the B4A app, how do I then switch back to the Wifi network that the B4A app was connected to in the first place? How do I get the IP address of the Wifi network?
Bit confused in how to switch between the Access Point and whatever network the device was connected to BEFORE I switched to the AP....
I hope this makes some sort of sense...
JMB