B4R Question ESP8266

Michael1968

Active Member
Licensed User
Hi Erel,

i want to upload a blink example to my ESP8266

I get this error:
B4R version: 1.00 BETA 4
Parsing code. (0.00s)
Compiling code. (0.33s)
Building project (0.24s)
Compiling & deploying Ino project (Adafruit HUZZAH ESP8266 (UploadSpeed=115200) - COM10) Error
Loading configuration...
Pakete werden initialisiert...
Boards werden vorbereitet...
Überprüfungs- und Hochladevorgang...
sketch\B4RArduino.cpp: In member function 'void B4R::Serial::Initialize2(ULong, Byte)':
B4RArduino.cpp:54: error: invalid conversion from 'Byte {aka unsigned char}' to 'SerialConfig' [-fpermissive]
hs->begin(BaudRate, Config);
^
In file included from C:\Users\Michael\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Arduino.h:246:0,
from sketch\B4RDefines.h:8,
from sketch\B4RArduino.cpp:1:
C:\Users\Michael\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/HardwareSerial.h:77:10: error: initializing argument 2 of 'void HardwareSerial::begin(long unsigned int, SerialConfig)' [-fpermissive]
void begin(unsigned long baud, SerialConfig config)
^
exit status 1
invalid conversion from 'Byte {aka unsigned char}' to 'SerialConfig' [-fpermissive]
I use a Adafruit Huzzah and a Nodemcu V1.0

Best regards
Michael
 

Toley

Active Member
Licensed User
I have also tried with a NodeMCU and it do not work.

B4R version: 1.00 BETA 4
Parsing code. (0.00s)
Compiling code. (0.01s)
Building project (0.02s)
Compiling & deploying Ino project (NodeMCU 1.0 (ESP-12E Module) (UploadSpeed=115200) - COM6) Error

sketch\B4RArduino.cpp: In member function 'void B4R::Serial::Initialize2(ULong, Byte)':
B4RArduino.cpp:54: error: invalid conversion from 'Byte {aka unsigned char}' to 'SerialConfig' [-fpermissive]
hs->begin(BaudRate, Config);
^
In file included from C:\Users\toley\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Arduino.h:246:0,
from sketch\B4RDefines.h:8,
from sketch\B4RArduino.cpp:1:
C:\Users\toley\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/HardwareSerial.h:77:10: error: initializing argument 2 of 'void HardwareSerial::begin(long unsigned int, SerialConfig)' [-fpermissive]
void begin(unsigned long baud, SerialConfig config)
^
exit status 1
invalid conversion from 'Byte {aka unsigned char}' to 'SerialConfig' [-fpermissive]
 

Toley

Active Member
Licensed User
I've haven't yet tested B4R with ESP board. I'm waiting for my board to arrive.

This specific error can be solved by commenting line 54 in libraries\rCore\B4RArduino.cpp
Thanks Erel, after commenting line 54, the program can be compiled and load into the board. but the I constantly receive a message on the Log (every seconds I guess)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
Anyway I will wait for you to receive your board and make your own test. Thanks a lot.
 

canalrun

Well-Known Member
Licensed User
I would also be interested in seeing ESP8266 support in B4R. I have a WeMos D1 R2 (WeMos D1 R2 WiFi ESP8266 Development Board Compatible Arduino UNO).

The board offers much more memory and runs at 80 MHz, I think, and it's cheap. Although, it may lack some features of the Arduino.

I've actually hardly looked at the board, but I think it may make a great updated platform for things similar to what the Arduino can do.

Barry.
 

tirpitz

New Member
Licensed User
Success with Blink
had to add one line at 79 in rCore/Scheduler.cpp before pollers.runAll();

yield(); //avoid watchdog reset
pollers.runAll();
 

tirpitz

New Member
Licensed User
success also with Serial output.
Here is my changes in rCore/B4RArduino.cpp line 48 -> 58

#ifdef B4R_SERIAL
stream.wrappedStream = &::Serial;
// #ifdef _VARIANT_ARDUINO_DUE_X_
::Serial.begin(BaudRate);
/* #else
::Serial.begin(BaudRate, Config);
#endif
while (!::Serial) {
;
}

*/
 

rwblinn

Well-Known Member
Licensed User
Curious: How is this board integrated in the Arduino IDE and is the board also listed in B4R Board Selector?

Reason for asking:
Added ESP8266 Boards into the Arduino IDE 1.6.8 using "http://arduino.esp8266.com/stable/package_esp8266com_index.json" (Additional Board Manager URLs field).
But when opening the B4R Board selector, these additional boards are not listed.

Probably should start a new thread for this.
 

Erel

Administrator
Staff member
Licensed User
I'll explain. B4R tries to extract the list of boards from Arduino IDE.

During the beta there were cases where this step failed for (currently) unknown reason. The workaround is to provide a static list of boards when it fails. The list is stored in boards.txt in the installation folder.

You can replace the file with the one attached. It includes the ESP boards.
 

Attachments

rwblinn

Well-Known Member
Licensed User
Thanks = Done.
Steps taken:
  • Attached & selected board NodeMCU v1.0 with upload speed 115200.
  • Changed core library scheduler.cpp as stated in post #14.
  • Changed core library B4RArduino.cpp by commenting out lines 50 and 52-54.
  • Got the Blink Example working on a LED connected to pin D2 which is GPIO4 of the NodeMCU. In B4R defined as Private LEDPinNumber As Byte = 0x04

Followup question:
Is it possible to add as permanent fix in B4R, an additional conditional define for the ESP8266 for core lib B4RArduino.cpp? or any hint if this can be done via B4R code.
I am not sure, not tested yet, as the changes will also work for the Arduino boards.

Appreciated
 
Top