B4R Tutorial ESP8266 - WiFi Remote Configuration

positrom2

Active Member
Licensed User
Longtime User
The PC not (it is on LAN), but therefore I tried with the android smartphone, connected to the esp network and calling that address.
 

positrom2

Active Member
Licensed User
Longtime User
After connecting with the Android to the esp and calling that address I get this B4R log, the Android saying "not connected" despite being connected to esp Wlan.
(Can't copy the text because of the junk characters.)
 

positrom2

Active Member
Licensed User
Longtime User
Yes, that works. On Android: Password etc had been set and then new page: "connected to network", "ESP8255 IP address: 192....
Thank you very much.
 

Bladimir Carrillo

Member
Licensed User
Longtime User
Hi all,
I am testing the provided code but have a problem when parse a large parameter on browser, the buffer received is not complete on Astream_NewData sub.
This is the url containing parsed paramter ....

http://192.168.4.1/set/Claro_NETWOR...1042/0/0/0/0/1/0/0/0/0/0/1/2/3/4/5/6/7/8/9/10

The uncomplete text parsed is ...
Claro_NETWORKSSID000012345/3915852319442/192/168/0/3/51042/0/0/0/0/1/0/0/0/0/0/1/2/3/4/5/6/7

Any idea ?
 

Peter Simpson

Expert
Licensed User
Longtime User
This is absolutely brilliant @Erel, I've been trying to create my own version of this all day on my ESP8266 devices, then I came across this post. Your solution worked 'First Time of asking' with ease. I tested it on all my mobile devices and laptops, it just works seamlessly, and setting up the network is a breeze through the browsers.

Cheers, you have once again saved us all plenty of time with an absolutely great solution.

I do have one question though. Ever since writing to the EEPROM on 2 of my ESP8266 devices, I now have to add a delay of around 2 seconds just under 'Serial1.Initialize(115200)'. I take it that writing to the EEPROM somehow causes something to happen speed wise for a second or two at first boot. I mean nothing serious, maybe because it reading the EEPROM. But without the delay it will miss the start of the program.

It really does not matter though, as adding the 2 second delay remedies the situation, I was just wondering why it happens though?

Thank you again
 

pappicio

Active Member
Licensed User
Longtime User
Hi all,with example on page 1, I've coded a home automation relays with a wemos mini, and configured also remote access by username and password. the problem now is:
by using GET, all works well, but username and password are visible in web page title, while, using POST, the http buffer is truncated and cannot see in header username and password to process them, but, if I configure also:
Astream.WaitForMoreDataDelay = 500
Astream.MaxBufferSize = 512

the I can see complete http POST header

B4X:
Private Sub Server_NewConnection (NewSocket As WiFiSocket)
   Astream.Initialize(NewSocket.Stream, "astream_NewData", "astream_Error")
   'configure them only with POST Connections
   Astream.WaitForMoreDataDelay = 500
   Astream.MaxBufferSize = 512
End Sub

but in this way, when call by webpage the POST, the esp8266 restart, with error (3), and sometime with error (9) or erro (2), there is other way to obtain all header chars, without use:
Astream.WaitForMoreDataDelay = 500
Astream.MaxBufferSize = 512

becouse all seems to work well, but only with GET, cos HTTP buffer header is shorter.
thanks a lot.
 

pappicio

Active Member
Licensed User
Longtime User

okok, solved with POST in http header, so now no more visible userame and password, thanks a lot!
 

rbghongade

Active Member
Licensed User
Longtime User
Dear friends,
Is it possible to store the IP address and port number of a server running mqtt broker service in EEPROM via the same method? i.e; accessing the esp through browser.
regards,
 

rbghongade

Active Member
Licensed User
Longtime User
Dear friends,
Tried but not able to succeed. Can anyone please post a code snippet for configuring mqtt server ip and port number via browser?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…