B4R Tutorial ESP Configurator based on B4RSerializator

SS-2017-07-09_16.48.51.png


This tool replaces the browser based solution (https://www.b4x.com/android/forum/threads/esp8266-wifi-remote-configuration.68596/). It is simpler and much more powerful.

B4RSerializator, which converts objects to bytes and vice versa, is used for the communication with the B4J app and to save the settings in the EEPROM. B4RSerializator is also compatible with B4A and B4i so you can also create a mobile app.

In this specific example the data includes MQTT related settings. It should be simple to change it to store other fields. Just make sure to set the field types correctly.

If the ESP is not connected to the local network then you should connect the PC to the ESP access point and set the ip address to 192.168.4.1, which is the default ip.
If it is connected to the network and you know its ip address then you can use it instead. The ESP local ip is printed in the logs.

Now click on Get to get the stored parameters or click on Set to send the parameters to the board.
In this example it is configured to connect to the network and then connect to a MQTT broker.

Note that the Get and Set features start a new connection and close it when done. This is a simpler and safer approach compared to maintaining a continuous connection.

If you are using Java 9+ then replace jControlsFX with jControlsFX9.
 

Attachments

  • B4R_ESPConfigurator.zip
    2 KB · Views: 2,561
  • B4J_ESPConfigurator.zip
    46.1 KB · Views: 2,297
Last edited:

KiloBravo

Active Member
Licensed User
Hi, Do you have the same example for b4A ? in place of the b4J example
Thanks

I do not. I am just working with B4J and B4R currently. Eventually, I plan on using B4A and B4i. I would like to make my app cross platform for all three. It should be pretty straight forward to make it cross platform if you watch Erel's video. It is not a complicated program. For my current project, Erel's code pretty much met all my needs. I made one or two small changes in B4J, but only because of my specific use case.
 
Hi,
I am an electronics guy and loving B4X to start with IoT. So configuring ESP8266 with B4J app is not viable in the field and handy solution is B4A Configuration App. Please help me with solution as I am learning and not at level to modify B4J configuration to B4A. Thanks.
 

KiloBravo

Active Member
Licensed User
How about using the search function on the forum ? :cool:

Found this is 300 mili-seconds ....


Lots of great & generous people on here sharing their code and creations !!!
 

KiloBravo

Active Member
Licensed User
Just kidding you a little :)

Start your next B4X journey with B4X pages. Watch Erel's Videos and read the manuals then post questions.
Took me some time to get the hang of it but it is well worth the effort. I am just a hack and liberally borrow code from other people's post.
Read the forum rules and post if you get stuck. Lots of helpful folks on here to point you in the right direction.
 
How about using the search function on the forum ? :cool:

Found this is 300 mili-seconds ....


Lots of great & generous people on here sharing their code and creations !!!

OMG how it was omitted in search... and thanks for your kind help.
I really appreciate your comments and try my best to solve things before to make some post.
The generosity of people and the power of B4X stuck me here and I am reading and learning everyday since some months to have vision of concept and broadness of the B4X. Thanks to all and Special Erel.
 
Top