B4R Question ESP32 first try: works with Arduino, but not in B4R

peacemaker

Expert
Licensed User
Longtime User
HI, All

Strange, my ESP8266 project works OK in B4R, but now i'm trying to start with ESP32 ... with no success.

Arduino IDE connects, starts the board OK, logging is OK, the reset button makes the reset OK.
In B4R the flashing of the min template app is OK, but no log output.


B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private wifi As ESP8266WiFi
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Delay(3000)
    Log("AppStart")
    'example of connecting to a local network
    If wifi.Connect2("ssid", "password") Then
        Log("Connected to network")
    Else
        Log("Failed to connect to network")
    End If
End Sub

p.s. Arduino can log the output of B4R sketch !
B4X:
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6360
entry 0x400806b4
AppStart
Connected to network

Where to dig ?
 
Last edited:

Daestrum

Expert
Licensed User
Longtime User
yes - the log is from B4R

The only difference I can see in the code is I do not have the delay(3000) after Serial1.Initialize(115200)
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
1) Where the "board type" should be setup ?
I guess that any board based on the same chipset should be working (inited) OK. But i see that parameter list is different for various boards.

2) I have found that my second ESP32 module (among 2) - did not work, not flashed (from Aliexpress as is). Now re-soldered better - and it started t work (again only in Arduino IDE), but
B4X:
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6360
entry 0x400806b4
AppStart
Connected to network


>flash read err
but WiFI sketch is working, but again - no log in B4R, only in Arduino.
Very strange situation - if works in Arduino - it must work in B4R also...
 
Upvote 0

thetahsk

Active Member
Licensed User
Longtime User

Don't choose as ESP Wrover as the board type. The Wrover kit has an USB FT2232 chip on board which features a USB-to-JTAG interface.
Choose the "ESP32 Dev Module" in the Board Selektor to get it working. Have installed the latest Arduino Core for ESP32 V.1.05
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
"ESP32 Dev Module"

Yes, it's max full parameter list. My hardware is ESP32-CAM board that is connected to ESP32-CAM-MB motherboard with USB and CH340 serial converter.
But the same situation - all is OK excepting log output to B4R.

latest Arduino Core for ESP32 V.1.05

What is this Arduino lib ? How to check ?

BTW, i have done testing this ESP32 video streeming code, without logging to B4R, one ESP32 board example is working OK (second with flash err flashed OK, camera inited OK, but no working web-server) - it looks like this one board is OK, but debugging in B4R is impossible.
B4X:
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)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6360
entry 0x400806b4
AppStarted
Camera Image Chunk Size:
1024
ESP32CAM AppStarted
Connected. IP Addr: 192.168.1.181
Starting Web Server...
Starting Web Server STARTED. /live to get the live stream or /pic for a picture capture

Some special driver in B4R for COM-port connection ? But if B4R compiled and flashed the ESP32 OK via port - why no back log output over the same port ?
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Also found: when board is streeming video from camera and if to try to make "Connect" to COM-port from B4R - streeming hangs, all stopped. And works again after reset only if to make "Disconnect" - while connected no any work.
 
Last edited:
Upvote 0

thetahsk

Active Member
Licensed User
Longtime User
Start your Arduino IDE. Call Tools->Board->Boardmanager. Search for esp32 and check if you have V1.05 installed.
This has nothing to do with your problem but you should always have the latest core installed.
What happens when you start a programm without WiFi?
B4X:
Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    On(0)
End Sub

Private Sub On (t As Byte)
    Log("on")
    CallSubPlus("Off",2000,0)
End Sub

Private Sub Off(t As Byte)
    Log("off")
    CallSubPlus("On",2000,0)
End Sub

Search for your Error from your log in the esp32.com forum. Perhaps a problem with your power supply.
flash read err, 1000
ets_main.c 371
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
V1.05 installed

Yes, checked, 1.05 is installed.
No any logging to B4R, but it looks like COM-port is connected. Reset button - no reaction.
In Arduino all works - flashed from B4R sketch is running OK.



flash read err, 1000
ets_main.c 371

This error is of second board, it may be not fully good soldered, let's ignore it - but it is the same, without logging.
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Just a thought, you are not leaving the serial monitor of Arduino IDE connected while you use B4R IDE.
Pretty sure it cant talk to both at the same time.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
two instances are running

No, no. If to open ESP8266 project at the same time (instead of ESP32) - it works as usual OK - logging to B4R is OK.
I guess, my ESP32 boards are some...incompatible, but i cannot "dig deeper".
Thanks to all who replied here.
 
Upvote 0

machvd

New Member
Licensed User
I'm have several "ESP32 Thing" working. I don't use B4R to program them, so far only Arduino IDE.

But could your issue be related tot the ESP8266WiFi that you are using? On my projects I include the WiFi.h library.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
ESP32 Things working. I don't use B4R to program them, so far only Arduino IDE

If you'd like just for curiousity - try one free board with default B4R ESP sketch, just use B4R menu: File\New\ESP and just enter your WiFi ssid and password. Will your board to log to B4R after flashing and "*************PROGRAM STARTING *******************" red log output ?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Yes, confirmed the situation: i received ESP-WROOM-32U boards, and it works in B4R OK - logging is OK, but the same B4R sketch (just another COM-port) - ESP32-CAM module does not work (but works in Arduino IDE).
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Select the correct board:
AI Thinker ESP32-CAM
picture attached


 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…