B4R Question ESPRESSIF board: ESP32-wroom-32 how to start?

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

I have 2 things. Please for advice.

I am using this board:
https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf

I have done this steps:
Upload ESP32 boards to arduino (board manager)
https://www.b4x.com/android/forum/threads/initial-support-for-esp32.75002/#content
upload ESP32SDK to the folder
https://www.b4x.com/android/forum/threads/resp32bluetooth-esp32-classic-bluetooth.93257/#content

but

1)
- The board ESP32-wroom-32 is not in the list, please what I must set for developing on this board?
I have set ESP32 DEV Module and I cant upload empty project. I gor error:
Serial port 11 - Error while uploading project

2)
- If I am trying : rESP32Bluetooth - Esp32 Classic Bluetooth then I got error:
The part of the way: additionallibraries/resp32bluetooth was not found
(but I have resp32bluetooth in this folder)

Please what I am doing wrong?
Best regards
p4ppc
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Janderkan,

I have done This Steps with other modules And IT was OK,

but with ESP 32 i have troubles I have described..
 
Last edited:
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0

emexes

Expert
Licensed User
I think I probably have a board identical to yours. I bought four of them on Ebay, from different suppliers. The one I am using right now has device code "ESP32-WROOM-32" on the square Espressif part.

There was a lot of mucking around to get it going. When I connect the device to my laptop via a micro-usb cable, it shows up in Device Manager as COM11

upload_2019-9-23_0-31-27.png


so that might be the first thing to check. Then, the B4R board settings that work here are:

upload_2019-9-23_0-29-16.png


I think the differences between the various ESP32 Board Types are mostly to do with memory layout/partitioning; currently I am probably getting away with using the first selection that worked, because my programs are small enough to fit anywhere.

The UploadSpeed 921600 seems to be fixed in the ESP32 module. The Baud Rate setting is the speed used by B4R to receive logging information, and 115200 seems to be what the device defaults to during reboot (after uploading/programming). You can change Baud Rate in your program to be some other speed, but then you miss ~ten lines of bootloader information which is still at the default speed before your program gets to change it.

The key thing that I missed is that when the compiling/uploading status gets to "Serial port COM11", then you need to put the ESP32 into upload mode. If you orient the module so that the writing on the Espressif part is right-way-up and the USB cable is at the bottom, then what I do is:

- press-and-hold the left (reset) button,
- press-and-hold the right (upload/programming) button
- wait two seconds
- release the left button
- wait one second
- release the right button.

I think the critical bit is that the right button has to be down when you reset the device by releasing the left button.

While I'm here, the program that is right now blinking the blue LED (on right, cf red power LED on left) is:
B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 300
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
 
    Private Serial1 As Serial
 
    Private LEDPin As Pin
 
End Sub

Private Sub AppStart
 
    Serial1.Initialize(115200)
    Log("AppStart")

    LEDPin.Initialize(2, LEDPin.MODE_OUTPUT)
 
    Do While True
        LEDPin.DigitalWrite(True)
        Delay(500)
        LEDPin.DigitalWrite(False)
        Delay(1000)
    
        Log("LED Blinked!")
    Loop
 
End Sub
and you can see the "LED Blinked!" messages at the bottom of the Log tab (plus also the programming and reset/bootloader messages):

upload_2019-9-23_0-49-26.png
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Emexes, Janderkan,

thank you very much for your help!!
Yes it is functioned perfect :)

please and POINT 2?
It does it mean - the message:
The part C:\additionallib\resp32bluetooth was not found.

Do you have experience with this message please? I see it if I compile project (chat) with rESP32Bluetooth LIB. This LIB I 100 percent have in folder: C:\additionallib\

I have installed (as I found on forum) this:
Note that you need to have a recent version of ESP32 SDK. If you encounter any error then download the complete SDK: https://github.com/espressif/arduino-esp32 and copy it to ESP32 SDK folder:
C:\Users\<user>\Documents\Arduino\hardware\espressif\esp32

I have in additionlib XML and this files - watch please the attached picture

but I can not start compilation...
The part C:\additionallib\resp32bluetooth was not found.
 

Attachments

  • library.jpg
    library.jpg
    15.4 KB · Views: 188
Last edited:
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
It does it mean - the message:
Do you have experience with this message please? I see it if I compile project (chat) with rESP32Bluetooth LIB. This LIB I 100 percent have in folder: C:\additionallib\

1.
Check that you have Arduino library installed:
Start Arduino and go to Sketch-Include Library and search for BluetoothSerial

2.
Check you have a file called rESP32Bluetooth.xml in your additional libs folder and a subfolder called rESP32Bluetooth with 2 files called rESP32Bluetooth.cpp and rESP32Bluetooth.h

3.
Check that you have set the correct path to your additional libs folder
Start B4R and go to Tools-Configure paths
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
JANDERKAN

thank you

as you wrote:
Check that you have Arduino library installed: Start Arduino and go to Sketch-Include Library and search for BluetoothSerial
- yes I have Bluetoothserial installed (see the attached image please)

Check you have a file called rESP32Bluetooth.xml in your additional libs folder and a subfolder called rESP32Bluetooth with 2 files called rESP32Bluetooth.cpp and rESP32Bluetooth.h
- yes I have this now (I had not files in subfolder, it was my dumb mistake, excuse me)

Check that you have set the correct path to your additional libs folder
- yes I have right path

I can start compilation and I get this error:
In file included from C:\esp32\2P~1\B4RBTE~1\Objects\bin\sketch\B4RDefines.h:25:0,
from C:\esp32\2P~1\B4RBTE~1\Objects\bin\sketch\AsyncStreams.cpp:1:rESP32Bluetooth.h:17: error: 'BluetoothSerial' does not name a type
BluetoothSerial client;
^
exit status 1

Here is something very interesting:
1. If I have NOT file called rESP32Bluetooth.xml in my additional libs folder and
if I have this file only in subfolder called rESP32Bluetooth with 2 files called rESP32Bluetooth.cpp and rESP32Bluetooth.h
then I can run compilation with error: 'BluetoothSerial' does not name a type

2. If I have this files in additional libs folder then I can not run compilation
 

Attachments

  • bt.jpg
    bt.jpg
    12.9 KB · Views: 206
Last edited:
Upvote 0
Top