serial communication with the ESP8266 using the nodeMCU-firmware (script-languageLua)
StefanL38
Posts: 2,292
Hi everybody who is interested in using the ESP8266 WiFi-SoC with the nodeMCU-Firmware
I posted the links in another thread but for completenes I will post it here too:
first of all visit this website to read how to flash the nodeMCU-firmware into a ESP8266-module:
http://benlo.com/esp8266/esp8266QuickStart.html
or use these links for downloading
32bit: https://github.com/nodemcu/nodemcu-flasher/blob/master/Win32/Release/ESP8266Flasher.exe?raw=true
64bit: https://github.com/nodemcu/nodemcu-flasher/blob/master/Win64/Release/ESP8266Flasher.exe?raw=true
then download the LuaLoader http://benlo.com/esp8266/LuaLoader.zip
next post is to show how serial data can be exchanged between ESP8266 and any other serial device
best regards
Stefan
I posted the links in another thread but for completenes I will post it here too:
first of all visit this website to read how to flash the nodeMCU-firmware into a ESP8266-module:
http://benlo.com/esp8266/esp8266QuickStart.html
or use these links for downloading
32bit: https://github.com/nodemcu/nodemcu-flasher/blob/master/Win32/Release/ESP8266Flasher.exe?raw=true
64bit: https://github.com/nodemcu/nodemcu-flasher/blob/master/Win64/Release/ESP8266Flasher.exe?raw=true
then download the LuaLoader http://benlo.com/esp8266/LuaLoader.zip
next post is to show how serial data can be exchanged between ESP8266 and any other serial device
best regards
Stefan
Comments
This is the Lua-script that you save as a plain textfile for uploading into the ESP8266's flash-rom
So it's up to you to expand this code for better usability and more functionality.
As I'm a newbee to Lua and also a newbee to the deeper concepts of object-oriented programming
there may exist better ways to do this serial communication but it is a start.
You are welcome to improve this serial Lua-example-code or demontrate other ways how to realise serial communication.
I'm still very impressed by the power of Lua and how compact code can be written in Lua.
best regards
Stefan
to play with LUA you can download the PC version und experiment in the interactive prompt,
load little scripts and have fun.
Being able to install helper scripts in LUA and then sending commands from the Prop (I from Tachyon ;-) - you from SPIN)
could be a nice boost in functionality.
like the interactive FORTH prompt in Tachyon ;-)
you can even send new function definitions over before you execute them ... like Tachyon ;-)
That's why I like them both :-)
but even eLUA is to big for the Propeller - Forth is just right
hm this makes me think about learning forth.....
So could you provide a very basic introduction about the concepts of forth?
I have asked about how much memory eLua needs. 17kB and a stripped down version 6kB.
Lua is fast. A lot of microcontroller-tasks are not critical about microsecond-latency.
So with a XMM-Version you can extend to Megabytes.
I don't know anything about the c-coding on the propeller. Does there exist a C-variant for the propeller-chip that uses XMM or LMM?
Lua is written in C. So it should be a limited effort to port Lua on a propellerchip with external memory.
best regards
Stefan
Very cool! It looks like you are making progress very quickly.
I've been looking for my ESP8266 boards today so I can try this at some point. It looks like a lot of fun.
There is the eLua Project which provides support for a lot of microcontroller boards. It would be interesting to try and fit this on a propeller. Lua and Espruino (Javascript) both have the capability of being able to send a function definition to a remote board and then execute it which makes a very nice way to create "smart" peripherals that can be reprogrammed from a central location. Forth folks have always been able to do this.
Keep up the great work and keep us posted so we can follow along.
But at that ime Peter started Tachyon so I immediately was in his camp.
Peter's footer contains a lot of links.
The OLD forth books are there as well and I did learn a lot reading them.
Not only about forth.
Leo Brody: Thinking Forth etc.
Forth & Zen ;-)
I am not in C (can read it more or less) so can not help here.
LUA needs a significant STACK and HEAP and is dynamic with Garbage Collection.
Sounds quite some overhead.
But if it would be available I'd give it a try :-)
Another thing I like about Tachyon is, that I can understand it completely (if I spent the time ;-) and can read the PASM source).
And there is no additional layer in between like compilers/linkers etc.
And - runs on the simplest HW - even 32k EEPROM
(or even without) - just loaded the EXPLORER image onto a DIP Prop without EEPROM
to do some experiments.
Nice start. Yesterday had some time and read about the various quick starts.
For those who would rather use Python & Lua there is this link (uses esptool.py and Python 2.7)
www.taylorcoffelt.com/article/1
Hoping to try NodeMCU (your benlo.com reference) this afternoon with my PropPlug. Will post results soon
propgcc - The GCC compiler targeted at the Prop supports LMM, XMM and in COG native code.
Catalina - From RossH http://forums.parallax.com/showthread.php/116370-Catalina-2.6-a-FREE-C-compiler-for-the-Propeller-The-Final-Frontier! Does not support C++.
ImageCraft - A commercial C compiler for the Prop. No longer available I think. RossH already did this with the Catalina compiler. Lua is featured on that page I linked to above. I'm guessing that code compiles under propgcc as well.