B4R Question Is there any plan to upgrade B4R to work fully with Arduino IDE V2 and ESP32 board V3?

RJB

Active Member
Licensed User
Longtime User
Is there any plan for this upgrade?

Updating the IDE to V2.3.2 and the Board to V3.0.2 solves some problems but causes many more, some raised in previous questions in the forum.
I thought I had finally got my current app working then found two more problems, one of them a killer!

First problem: Re-using an esp32 programmed on the previous IDE/ board settings I was using (V1.8.6/ V1.0.6 I think) gives the error: "assert failed: lfs_fs_grow_ lfs.c:5182 (block_count >= lfs->block_count)" when trying to initialise littleFS. This I can get around by compiling with the "Erase all flash before sketch upload" option in the Board Selector. Not ideal due to the time it takes, but it seems to work.

Second problem: The code to get the device MAC given in https://www.b4x.com/android/forum/threads/how-to-use-global-arrays-from-inline-c.68747/#content no longer works. This is crucial to the app and without it the app is dead! Any work around would be appreciated!

Whilst trying to solve these problems I came across these lists: https://randomnerdtutorials.com/esp32-migrating-version-2-to-3-arduino/ and https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html which seem horrendous! But, of course, I'm updating from V1 to V3 so the problems are even worse!

I also tried compiling another old app on the new settings. This gave over 1300 lines of error descriptions in the log! Mostly numberwrap errors in Select Case but difficult to find/ solve. It's really going to be a problem if I have to maintain it.

I haven't been able to make any progress for over three weeks now.

Hence the question "Is there a plan for an upgrade" - please!
 

derez

Expert
Licensed User
Longtime User
Any thoughts on getting the MAC address in the mean time?
Not a B4R solution but you can check in the router which device has been connected when you start your board and connect to wifi, the router shows the MAC as well as the ip.
 
Upvote 0

candide

Active Member
Licensed User
mac Address on esp32: in sdk esp32 3.0.2, you have a sketch : GetMacAddress.ino

with inline C, it is easy use it in B4R
 
  • Like
Reactions: RJB
Upvote 0

RJB

Active Member
Licensed User
Longtime User
Yes, brilliant, thanks very much.
Just need to tidy it up and then I can get on with some productive work again!
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
PLs, share working result in B4R - really big difference in code ?
 
Upvote 0

RJB

Active Member
Licensed User
Longtime User
PLs, share working result in B4R - really big difference in code ?
Not much different nor very complicated:

B4X:
'Arduino ESP32 board V3.X.X

Sub Process_Globals
    Dim MacArray(6) As Byte
End Sub

Sub GetMacAddress() As Byte()
    RunNative("getMac", Null)
    Return MacArray
End Sub
#if C
#include "esp_mac.h"  //required - exposes esp_mac_type_t values

void getMac(B4R::Object* u) {
    esp_read_mac((Byte*)b4r_main::_macarray->data, ESP_MAC_WIFI_STA);
}
#end if
 
Upvote 0
Top