alonewolfx2 wrote:its working fine but what is the error message?Code: Select all~~END~~
stdin:1: unexpected symbol near '~'
Just ignore it.
It seems the Lua interpreter receives some bytes of the serial input buffer when redirecting input back to him. If you take a closer look at the output of LuaLoader when uploading a file, it shows something similar:
> > > > > > > > > > > > > > > > > > >
>
= node.heap()
stdin:2: unexpected symbol near '='
If this message really bothers you, change
ser.write('~~END~~\r')
print read_till_prompt()
to
ser.write('~~END~~\r')
read_till_prompt()
alonewolfx2 wrote:file cant close if i change with thisCode: Select all~~END~
If you take a look at the embedded Lua code at the beginning of uploader, you will see that ~~END~~ is used to terminate file writing, and return to normal interactive mode. So it has to be sent verbatim of course.