Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By CheapB
#13553
gerardwr wrote:I have had some troubles before uploading a sketch to an ESP, especially when I regularly switched between LUA and Arduino code on the ESP.

They were caused by the Arduino upload not clearing all flash memory on the ESP.

I could always solve the problems by flashing the file blank512k.bin to the ESP. After this uploading an Arduino sketch was OK again.

Maybe this helps.


Thanks for the advice. Where is a good place to get the blnak512k.bin file and should it be flashed to 0x00000?
Thanks!
User avatar
By gerardwr
#13554
CheapB wrote:Thanks for the advice. Where is a good place to get the blnak512k.bin file and should it be flashed to 0x00000?
Thanks!


Here's a source:
https://github.com/nodemcu/nodemcu-firmware/tree/master/pre_build/0.9.4/512k-flash

Yes, burn at address 0. On my Mac I use:
Code: Select allsudo ./esptool.py --port /dev/cu.usbserial-A4004QZw write_flash 0x00000 blank512K.bin
User avatar
By gerardwr
#13557
Creamers wrote:What are the pro's using lua over normal arduino code? Faster?
(I would like to send data to website very fast , maybe you can refer me to a sample?)


When I started in Nov 2014 with the ESP I had years of Arduino experience, and ZERO minutes LUA experience.

I started with LUA because that's the only thing that was available besides the bare C coding environment. After a few weeks I had the opportunity to join the IGRR ArduinoESP environment, and liked it! So I ditched the LUA environment in a few days.

Why? These things spring to mind:
- Arduino is a "known" language, with good documentation, many examples, many libraries, big community. LUA is impressive.
- ArduinoESP is a turnkey environment that "just works". There was no IDE, it was "work in progress" with many bugs, and rather small community.
- LUA consumes a lot of RAM limiting code. Arduino has enough RAM left for bigger sketches.
- LUA is interpreted, Arduino is compiled. therefore faster
- My older Arduino code migrated to the ESP in a simple way. Also Interrupt handlers and 433Mhz code migrated without problems.
- During the beta test I had a direct communication link to the creator IGRR, and this guy really know his coding, and is willing to help.

Note : I'm really impressed what the LUA guys have done, and it's MUCH better now since I started. For experienced LUA coders it's a fine environment right now. If Arduino for the ESP had not been published I probably would have stayed with LUA.

But in my opinion the Arduino environment is much more stable and mature, and I think the active Arduino community will give it a big push forward.

Re. your question for sending data to a website fast: the provided WifiClient example sends data to io.Sparkfun every 5 secs without any problem.
User avatar
By CheapB
#13657
gerardwr wrote:Yes, burn at address 0. On my Mac I use:
Code: Select allsudo ./esptool.py --port /dev/cu.usbserial-A4004QZw write_flash 0x00000 blank512K.bin


Thanks. I am using the esp8266_flasher.exe and I am getting this error on BOTH the good and the bad module when trying to flash :

Writing at 0x0007f800... (32 %)

Writing at 0x0007fc00... (32 %)

Writing at 0x00080000... (32 %)
Failed to write to target Flash


and now none of them will execute the bins from the Audrino IDE lol