Other B4R v2.00 BETA is available for download

Erel

B4X founder
Staff member
Licensed User
Longtime User
New features and improvements:
The ESP32 SDK is more mature. Communication works perfectly.

Download link: www.b4x.com/b4r/files/beta.exe
 

rbghongade

Active Member
Licensed User
Longtime User
1)BLINK works ok!
2)ANALOG READ works ok!
3) Wifi is having a problem:
B4X:
B4R version: 2.00 BETA #1
Parsing code.    (0.01s)
Compiling code.    (0.01s)
Building project    (0.01s)
Compiling & deploying Ino project (WEMOS LOLIN32 - COM32)    Error

In file included from D:\DEVELO~1\WEMOS_~2\MLX916~1\Objects\bin\sketch\B4RDefines.h:26:0,
                 from D:\DEVELOPMENT WORK\WEMOS_ESP32\MLX91614_MQTT\Objects\src\src.ino:1:
D:\DEVELO~1\WEMOS_~2\MLX916~1\Objects\bin\sketch\rESP8266WiFi.h:4:18: fatal error: WiFi.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board WEMOS LOLIN32.
Even though the files are present in the folder it throws an error!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Can you give an example on what "DefineExtra" does!?
Example: In this thread a user, using a non-standard Arduino, encountered an issue with memory alignment: https://www.b4x.com/android/forum/threads/numberformat-problem.79804/#post-505688

The solution that I provided was to create a custom template file for the defines file. With the new feature it can be solved with this line:
B4X:
#DefineExtra: #define B4R_MEMORY_ALIGNMENT 3
The line as-is will be added to to global defines file and will override the previous value (0).

Even though the files are present in the folder it throws an error!
Which folder? It should be:
C:\Users\<user name>\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
 
Upvote 0

kolbe

Active Member
Licensed User
Longtime User
Made some initial test and no problems so far. The rESP8266wifi library is working for me. Connected to a AP and have a IP address.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Example: In this thread a user, using a non-standard Arduino, encountered an issue with memory alignment: https://www.b4x.com/android/forum/threads/numberformat-problem.79804/#post-505688

The solution that I provided was to create a custom template file for the defines file. With the new feature it can be solved with this line:
B4X:
#DefineExtra: #define B4R_MEMORY_ALIGNMENT 3
The line as-is will be added to to global defines file and will override the previous value (0).


Which folder? It should be:
C:\Users\<user name>\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
So, is there a list of the possible DefineExtra entries and it's values and effects?
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Thank you @Erel,
It's looking good looking good looking good, I've just ordered some ESP32's :)
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Hi Erel thanks for the update. Is there any specific libraries for the ESP32 or we should use the ESP8266 ones?
 
Upvote 0

kolbe

Active Member
Licensed User
Longtime User
Used AsyncStreams in prefix mode + B4RSerializator to send data between B4A and B4J apps and all is working well.

If I2C, UART and the OLED SSD1306 work it's off to the races!
 
Upvote 0

kolbe

Active Member
Licensed User
Longtime User
1)BLINK works ok!
2)ANALOG READ works ok!
3) Wifi is having a problem:
B4X:
B4R version: 2.00 BETA #1
Parsing code.    (0.01s)
Compiling code.    (0.01s)
Building project    (0.01s)
Compiling & deploying Ino project (WEMOS LOLIN32 - COM32)    Error

In file included from D:\DEVELO~1\WEMOS_~2\MLX916~1\Objects\bin\sketch\B4RDefines.h:26:0,
                 from D:\DEVELOPMENT WORK\WEMOS_ESP32\MLX91614_MQTT\Objects\src\src.ino:1:
D:\DEVELO~1\WEMOS_~2\MLX916~1\Objects\bin\sketch\rESP8266WiFi.h:4:18: fatal error: WiFi.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board WEMOS LOLIN32.
Even though the files are present in the folder it throws an error!

I am using only the rESP8266WiFi library v1.30 and it works. There are no wifi.h files in my sketch folder or referenced in B4RDefines.h.

Don't include rESP8266 either or it won't compile.

Maybe clean project?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So, is there a list of the possible DefineExtra entries and it's values and effects?
There is no such list available and you should normally not use it. This is a tool for me or other developers who develop libraries. In the future it will probably be used to customize the behavior of some libraries.

Is there any specific libraries for the ESP32 or we should use the ESP8266 ones?
You need to use the ESP8266 libraries.


Still does not work with Wifi. Same error.
@rbghongade please start a new thread for this in the question forum. Also include the complete logs from the logs tab.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
New features and improvements:
I'll be testing the ESP32 support when I receive my ESP32's, but I really find the compilation and deployments logs extremely interesting.

I've flashed some of the devices in my home with B4R 2.00 Beta #1 and I have not come across any issues whatsoever.

Thank you for all the hard work that you put into B4R @Erel. For a free package B4R is just amazing...
 
Upvote 0

rbghongade

Active Member
Licensed User
Longtime User
Dear friends,
Just to update the test results:
1)MQTT -OK
2)DS18B20 (OneWire) -OK
3)DHT22 -OK
4)APDS9960-OK
5)WS2812-OK
6)ROTARY ENCODER-OK
....shall update again!
Big thanks to Erel!
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

started to test with an ESP32 Dev Module
LED Blink GPIO4 (IO4) - OK

MQTT - OK
[SOLVED] The behaviour below occurs if an already used client id is used to connect. See post #17 ( thanks to @rbghongade )

Constant connect & disconnect from the broker, although able to send commands to the ESP from Domoticz Home Automation to trigger LED on or off.
The Mosquitto MQTT broker runs on a Raspberry Pi 3. The program used is running fine on an ESP8266.
Log Snippet
Connected to wireless network with local IP 192.168.0.32
MQTT: Connected to the broker
{"idx":26, "nvalue":0, "svalue":"0"}
{"idx":27, "nvalue":1, "svalue":"LED switched OFF"}
LED set to 0
Disconnected
MQTT: Connected to the broker
Disconnected
MQTT: Connected to the broker
Disconnected
... continuous connect = disconnect
MQTT: Connected to the broker
{"idx":26, "nvalue":0, "svalue":"0"}
{"idx":27, "nvalue":1, "svalue":"LED switched OFF"}
LED set to 0
{"idx":26, "nvalue":0, "svalue":"1"}
{"idx":27, "nvalue":4, "svalue":"LED switched ON"}
LED set to 1
Disconnected
MQTT: Connected to the broker
Disconnected
MQTT: Connected to the broker
Disconnected
MQTT: Connected to the broker
... continuous connect = disconnect

MQTT Code Snippet
' Check if connected to mqtt. if not, then try again after 1 sec
Sub Mqtt_Connect(unused As Byte)
mqttCO.Initialize("", "")
If mqtt.Connect2(mqttCO) = False Then
Log("MQTT Error: trying to connect again")
CallSubPlus("Mqtt_Connect", 1000, 0)
Return
End If
Log("MQTT: Connected to the broker")
mqtt.Subscribe(mqttTopicLEDSet, 0)
End Sub

'MQTT New Message arrived
Sub Mqtt_MessageArrived (Topic As String, Payload() As Byte)
Dim bc As ByteConverter
Log("MQTT: Message arrived. Topic=", Topic, ", Payload=", Payload)
End Sub

'MQTT disconnected. If the server is nor reachable, then MQTT is disconnected.
Sub Mqtt_Disconnected
Log("Disconnected")
mqtt.Close
Mqtt_Connect(0)
End Sub
 
Last edited:
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Dear rwblinn,
I know you must have done it but please re-check if there are multiple esp devices trying to connect with same client name. This is a peculiar behaviour in such cases.
You are SPOT on - forgot to switch off another ESP device with same client name. Great Help = Appreciated.
 
Upvote 0

rbghongade

Active Member
Licensed User
Longtime User
Dear friends,
Update continued...
7)BMP280 -OK
8)BME280 -OK
9)HMC5883 -OK
10)TCS34725 -OK
11) SERVO S90 - NOT OK! ( library throws error that the MPU is not supported! However it works with ESP8266!)
...more updates coming up!!!
 
Upvote 0
Top