B4R Question Trying to get this esp8266 board to work

quique

Member
Licensed User
Longtime User
Hi there!

I purchased this (small) board on amazon:

http://www.elecrow.com/esp8266-iot-board-p-1591.html

It looked particularly nice because it includes the necessary hardware to have a lipo battery plugged in. This will keep the board powered up with no usb or power adaptor. It will also recharge the battery when connected to those power sources.

I managed to configure B4R with the parameters shown in the screen capture. B4R manages to compile my example code (a smallish thing I already got running on a WEMOS D1 D2 board) and upload it into this board.

But the LOG, instead of showing me the "Appstart" and other log commands my code issues ... shows:
(some garbage)

NodeMCU 0.9.6 build 20150704 powered by Lua 5.1.4
lua: cannot open init.lua

It seems that it got the "newer" and "easier" (and slower, and not so appealing to me) lua interpreter preinstalled.

I am at a loss on how to get it off the board and leave the board available for an arduino project.

Any ideas or help is appreciated.

Regards,

Enrique
 

Attachments

  • Captura de pantalla 2016-08-11 a las 4.10.15 p.m..png
    Captura de pantalla 2016-08-11 a las 4.10.15 p.m..png
    30 KB · Views: 282

Cableguy

Expert
Licensed User
Longtime User
the rubbish logs you mentioned have happened to me when I chose the wrong baud rate...
Have a play with it... otherwise, look into how to re-flash the Arduino stack into it
 
Upvote 0

quique

Member
Licensed User
Longtime User
Cableguy, I understand what you say, but yet after the rubbish I get the LUA message. Anyway, I had a bit of success, and more baffling questions:

I tried to compile something on the arduino IDE, a ver basic program:

B4X:
void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait for a second
  digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
}

Which compiled OK, and provided that I plugged the ESP8266 board while pressing the FLASH button it includes to put it in flash mode, the Arduino ide flashed my code and the led started blinking as asked.

I repeat THE SAME power up and press flash button procedure for the B4R ide, using the same board parameters as arduino IDE, and B4R compiles and gives me the green on uploading it into the esp8266 board, but visually I can see there is no upload done, and the board starts blinking furiously, running my earlier, arduino IDE, compiled program, instead of the B4R code.

I am investigating it right now, any idea is welcome, and if I have success, of course I will document it here in case anyone else got stuck in this way.

At least now I do not get the LUA message (I suspect that by writing my blinking led code on the esp8266, I got rid of the LUA interpreter !!)

I SUSPECT the problem is at code uploading time: I can hear that B4R "resets" the COM port where the ESP8266 board is plugged in. That is: Windows makes the same sound as when I plug in the board.

This in turn seems to reset the ESP8266 board from flash mode, into run mode again. So the older code I compiled on the arduino IDE starts blinking the led, and the flash state is voided.


Regards, Enrique
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Are you using Arduino 1.6.9?

Note that you can use Arduino IDE to upload the B4R program. B4R creates an Arduino project under Objects\Src. You can open the generated projects with Arduino IDE, set the Arduino IDE to work with an external editor:

SS-2016-08-12_08.15.24.png


Now set B4R to use an invalid com port. Run the program in B4R. It will compile and fail and then upload it with Arduino IDE.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Since b4r creates a ino file, try to upload it using the arduino ide directly...
You can also change the timeout value. Mine is at 120s

[Edit] EREL said it better!
 
Upvote 0

quique

Member
Licensed User
Longtime User
Thanks, Cableguy and Erel, I was able to load the b4r ino file inside arduino and burn it on my ESP8266 board from there :) problem solved.
 
Upvote 0
Top