Other Initial support for ESP32

Erel

B4X founder
Staff member
Licensed User
Longtime User
ESP32 is the next generation of ESP8266 chips.
It is a relatively new chip and the SDK is not very mature. There are many things that are not working yet, however it does look promising.

SS-2017-01-08_15.17.14.jpg


You need to follow these instructions: https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md
Make sure that you are able to run a program (empty program is good enough) with the Arduino IDE before you try it with B4R.

I've encountered the following issues:

- Wire / I2C didn't work. Maybe a problem with the specific board that I've used.
- Network doesn't always connect.
- ServerSocket cannot accept a connection (client->available errno 9).
- EEPROM is not available.
- Pin.AnalogWrite not available.
- Client.Connected returns True although the connection has broken (this breaks rHttpUtils2).
 
Last edited:

positrom2

Active Member
Licensed User
Longtime User
The Arduino example sketch for testing the Adafruit 1306 oled compiles and can be uploaded to the ESP32, rather than the B4r Projekt which gives that error. But I might misunderstand your question. The B4r Projekt can't be compiled in the arduino ide.
Update:
I remember about the scr.ino. However, I can't find it. From a B4R compiling project, I find scr.ino.bin and ...elf in the B4R/Objects/bin folder, but not scr.ino, also not in the B4R folder and its subfolders.
From a non-compiling project like that for the ESP32 there is nothing like those (bin, elf, of course).
 
Last edited:
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
As a follow-up to my post #22 I have some questions about the src.ino file.
Is that file only created when there is no error in the B4R compilation process?
Is that file deleted when the compilation was successful?
What is the file location?
After a successful compilation I did find a src.bin and a scr.elf file but no src.ino.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
Thank you.
It was a little bit confusing that the scr.ino file is keeping the same (old) date for any new compilation.
Coming back to the question in post #21:
The project displaying BMP280 data on an OLED 1306 display (listed in post #4) does not compile for the ESP32, both in B4R and in the Arduino IDE, whereas it runs on the ESP8266.
 
Last edited:
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
FYI
The site Steps to install Arduino ESP32 support on Windows has been reworked.
Beside additional get tools being installed, there is also info on how to update to the latest code.

Have reinstalled completely to ensure latest tools etc.

Compiled successfully a simple LED Blink program on a ESP32 Dev Module.

(on my old test machine Toshiba Satellite, Windows Vista, Arduino IDE 1.8.0)
 
Last edited:
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
I will leave it open for now.
THE OLED SSD1306 did not work with the ESP32 though it worked in combination with the ESP8266
and, from the Arduino IDE, with the ESP32.
Has there been some progress to get the OLED SSD1306 work with B4R with the ESP32?
 
Upvote 0

rbghongade

Active Member
Licensed User
Longtime User
Dear Friends,
Received the great Wemos Lolin32 board yesterday! The build is excellent , retaining the reputation of Wemos.
I updated Arduino IDE as per the instructions at: https://github.com/espressif/arduino-esp32/blob/master/doc/windows.md
1) Was able to blink the built-in LED (pin 5)
2) Scan for wi-fi networks
3) Connect to wi-fi as client
All using examples from Arduino IDE
Now the problem part:
Tried using B4R 1.80 ( it recognises the Lolin board)
But if I try to compile any code the error message I get is always the same:
B4X:
B4R version: 1.80
Parsing code.    (0.00s)
Compiling code.    (0.00s)
Building project    (0.04s)
Compiling & deploying Ino project (WEMOS LOLIN32 - COM32)    Error

sketch\B4RCore.cpp: In static member function 'static void B4R::BR::varArgsToObject(B4R::Object*, int, va_list)':
B4RCore.cpp:233: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
      o[index].wrapPointer((const __FlashStringHelper*)va_arg(arguments, void*));
                                                                               ^
sketch\B4RCore.cpp:5:10: note:   initializing argument 1 of 'B4R::Object* B4R::Object::wrapPointer(void*)'
  Object* Object::wrapPointer(void* p) {
          ^
exit status 1
invalid conversion from 'const void*' to 'void*' [-fpermissive]

Even tried using some inline C code but the error is always the same.
The board is really impressive and if we could get B4R to work with it , we would get the most powerful work-horse of IOT devices at our disposal!
PS: Was able to implement MQTT (again with Arduino IDE , sadly though!)
IMG_20170602_113636.jpg
 
Last edited:
Upvote 0

swChef

Active Member
Licensed User
Longtime User
After (finally) receiving a ESP32, sharing first experience using B4R 1.8 BETA #2
#Kit used
The ESP32-DevKitC is a small-sized ESP32-based development board produced by Espressif.
Model: ESP32-DEVKITC Core Board V2 Espressif including genuine ESP-WROOM-32
Development PC (old) Toshiba Notebook Satellite with Windows Vista.

#Get Started
Followed strict the instructions as described: https://github.com/espressif/arduino-esp32/blob/master/doc/windows.md
If there are issues with step 5, then
* copy xtensa-esp32-elf-win32-VERSION.zip to folder <users>\documents\Arduino\hardware\espressif\esp32\tools\dist. The version used 1.22.0-59.
* cd ~/Documents/Arduino/hardware/espressif/esp32/tools/
* python get.py

To test the setup OK, start the Arduino IDE 1.8.0 (or higher), select File > examples > Examples for the ESP32 Dev Module > WiFiScan and compile & run.
If running OK (which did), close the Arduino IDE and start B4R IDE.

#B4R 1.8 IDE
After connecting the ESP32, determine the COM Port.
Tools > Board Selector
Board: ESP32 Dev Module
Serial Port: COM12 Silicon Labs CP210x USB to UART Bridge - Note: COM port depends on system setup

#Flashing
For the ESP32-DevKitC, to flash programs from development environments, like Arduino IDE or B4R 1.8.0 (or higher).
Example B4R IDE:
* Pin IO0 (= GPIO0) to Ground
* Compile and upload. Wait till message "waiting for download" in the B4R IDE Log Tab appears.
* Pin IO0 (= GPIO0) NOT to Ground
* Press BOOT button and hold down
* Press EN button (enable) and hold down
* Release BOOT button
* Release EN button

If all goes well, the B4R IDE Log shows, like (using simple LED Blink program):
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3
(DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) flash read err, 1000 Falling back to built-in command interpreter.
OK
>ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3ffc0008,len:4
load:0x3ffc000c,len:1708
load:0x40078000,len:3124
load:0x40080000,len:256
entry 0x40080034
AppStart - LED Pin 2 blink every 2 seconds
CurrentState: 0
NewState: 1
CurrentState: 1
...

#Issues
After the simple LED blink example, did not came any further as errors occurred as described in Post #1.
  • Tests not working, e.g. BMP180 = error network connection, after unplugging the BMP180, network got connected),
  • LED control via B4RSerialconnection = error WiFiClient.cpp:196 available(): 9
Will stop further testing for now, till any updates available.
Question:

Beside B4R Beta updates, not clear how the ESP32 files (as installed following the instructions) will be updated.

github link changed to
https://github.com/espressif/arduino-esp32/blob/master/docs/EXAMPLE_README_TEMPLATE.md
 
Upvote 0
Top