15

I'm planning to buy an ESP8266. Do I really need to learn Lua to play with it? I have seen some people using it with the standard Arduino IDE.

Do you need a custom firmware to use the Arduino IDE instead of Lua?

The Arduino IDE seems better for me because I already know the syntax. Is there any downside to using the Arduino IDE instead of NodeMCU with Lua?

dda
  • 1,595
  • 1
  • 12
  • 17
n0tis
  • 375
  • 2
  • 3
  • 9

4 Answers4

15

Lua, like many scripting languages, tends to make you a lot more productive as a programmer: things become far easier as you work at a higher abstraction level and do not worry about trivial things like memory management. You achieve the same goals with far less lines of code. On the other hand, whereas it makes development faster, it also makes program execution slower. Whether this is a good trade-off or not is very dependent on the particular application you want to write.

In your particular case, you also have to consider the fact that you do not know Lua, and you already know both the C++ language and the Arduino API. Then you may not rip the benefits of Lua on a single project, because of the time needed to learn the language. You may consider learning the language as an investment, probably worth it if you are going to program a lot on this platform, probably not worth it if it's only for a single, simple enough project. If unsure, I suggest you take a look at the API provided with Lua on this platform: how well does it fit your project? Is it a significantly better fit than the Arduino API?

Edgar Bonet
  • 45,094
  • 4
  • 42
  • 81
13

Using the Arduino IDE is custom firmware. That's what you're writing. You don't need any new firmware because the new firmware is what you are writing.

I can't think of any downsides to using C++ to program the ESP8266 instead of Lua - in fact it can only be a benefit since you are not using an interpreted language which is going to be slower than natively compiled code.

dda
  • 1,595
  • 1
  • 12
  • 17
Majenko
  • 105,851
  • 5
  • 82
  • 139
5

I STRONGLY RECOMMEND TO STAY WITH THE ARDUINO IDE!

Despite programming in C++ not being as friendly and versatile as Lua (working with Esplorer is really a dream come true!), Lua is VERY UNSTABLE AND UNPREDICTABLE!!!

You can run a simple program of ten lines and it works ok for a day... two... and suddenly, on the 3rd day the chip hangs unexpectedly, and with no reason! If you are lucky, the chip will reboot and program will start running again... that WAS NOT the case with me. I had to reload the program again! After 3 cycles like this, I decided to abandon Lua... FOREVER.

per1234
  • 4,278
  • 2
  • 24
  • 43
user3152171
  • 51
  • 1
  • 1
0

Sorry for bumping, but this thread helped me to decide for Arduino IDE.

I started with Arduino IDE but couldn't get it to work with ESP-07. Moved on to NodeMCU and Lua with Esplorer. Took me a while to get it working there also due to the odd bootloader baud rate. First it seemed so easy to set up a WEB-server, but problem was that all the examples found were based on an ancient FW 0.96, and trying with the latest 2.1 didn't work at all. So realising that people hadn't done much with newer FW gave me second thoughts.

Now with Arduino IDE things start to work the way they should! :)

PeteR
  • 1