Current Lua downloadable firmware will be posted here

User avatar
By gerardwr
#2730
zeroday wrote:1,2, node.key() node.led() is two api for GPIO16. in the development kit GPIO16 connect to one LED, and one BUTTON.
node.key("long", function() end ) register a call back function to LONG press(>4 or 5 seconds) of the BUTTON.
node.key("short", function() end ) register a call back function to SHORT press of the BUTTON.
node.led(400,500) means get the LED switch 400ms low and 500ms high.
some ESP module connect GPIO16 to chip RESET pin, and can't used as KEY or LED output.


GPIO16, OK, clear now. Could not find the GPIO# in the doc.

zeroday wrote:3, there is no method to get user input from serial to a variable now. it go directly to lua interpreter, sorry for that.

That is really sad :-(

zero day wrote:Lua io module was ported once, but it eats more Ram than a simple file module.
and I haven't made the io module work with std input output(serial), so in this version, io module is deleted.


Understood. I find the API extremely complete for a 1st release, congratulations.

I think the community can help you with suggestions to extend the API functionality. How about you opening a topic on this forum to gather these suggestions.
User avatar
By gerardwr
#2731 I have adapted the python upload procedure by cendev to upload a lua script to the ESP via the serial port.

The advantage (for me) is:
- no need for configuring the ESP for a wireless connection to an AP
- no need for initial creation of the "upload TCP server" that cendev created.
So a fresh ESP with fresh Lua firmware on it is sufficient.

The code below runs on my Mac.

Thanks to cendev for the initial script.

Code: Select allMac-mini-van-gerard:Documents gerard$ python uploadserial.py test3.lua test.lua >/dev/cu.usbserial-A4004QZw

Code: Select all#!/usr/bin/env python

import time
import sys

toCreate = str(sys.argv[1])
toUpload = str(sys.argv[2])

BUFFER_SIZE = 1024

time.sleep(1)
print("file.open(\"%s\",\"w+\")" %(toCreate,))
time.sleep(0.1)
with open(toUpload) as f:
    for line in f:
        print("file.writeline([[%s]])" % line.strip('\n'))
        time.sleep(0.1)
print("file.close()")
User avatar
By cendev
#2732
gerardwr wrote:
cendev wrote:it does the job for me =) still kinda buggy in some places but tomorrow after adding the highlight supported editor part and making the gui look better, it'll be something worth to bear with :)


I had a better look at the video, still NICE. I have some minor suggestions:
- Make it easier to find the video on youtube
=

= Use a name for the video with ESP8266 in it, so it is easyer to find
- feedback from the ESP is now "RECIEVED", the English word is "RECEIVED"
- the lua files in the video are excellent script for everybody. How about ZIPping these examples and publish the ZIP file in a Reply here? It will save my time retyping them ;-)


Thx =) in fact, i want the video to be as hidden as possible, it is the reason for the video to be "off the list" :) If i can find some more free time i'll work on it a bit more and maybe then share an another video, thank you for the tips that you gave =)

and yep x) Recieve - > Receive :mrgreen: i always write it wrong.. x)

I've added the scripts as attachment :) hope they'll help =)
Attachments
Lua scripts :)
(2.01 KiB) Downloaded 268 times
User avatar
By gerardwr
#2738
cendev wrote:[ in fact, i want the video to be as hidden as possible, it is the reason for the video to be "off the list" :) If i can find some more free time i'll work on it a bit more and maybe then share an another video,


Oops. sorry,I removed the URL in my original post, but I cannot edit the quote in your reply.

Thanks for the script files, going to upload them all to my ESP, gives me a good foundation.