Skip to content

A string in lua script makes upload to fail  #56

Description

@fedulovivan

Noticed a weird uploader behaviour..
second line in following lua script (even when commented) breaks the upload process:

DHT_PIN = 7
-- if current_buffer_length > 2 and is_valid_sequence == false then
LED_PIN=4
->file.writeline([==[DHT_PIN = 7]==]) -> ok
->file.writeline([==[-- if current_buffer_length > 2 and is_valid_sequence == false then]==])
->file.writeline([==[LED_PIN=4]==])

ERROR
 send string    : 'file.writeline([==[LED_PIN=4]==])'
 expected echo  : 'file.writeline([==[LED_PIN=4]==])'
 but got answer : 'sequence == false then]==])'

Traceback (most recent call last):
  File "./luatool.py", line 322, in <module>
    transport.writer(line.strip())
  File "./luatool.py", line 63, in writer
    self.writeln("file.writeline([==[" + data + "]==])\r")
  File "./luatool.py", line 122, in writeln
    self.performcheck(data)
  File "./luatool.py", line 89, in performcheck
    raise Exception('Error sending data to MCU\r\n\r\n')
Exception: Error sending data to MCU

run command (first part is for syntax validation):

luac -p ~/mqtt.lua && ./luatool.py --port /dev/cu.wchusbserial1420 --src ~/mqtt.lua --dest  mqtt.lua --baud 1200 --verbose

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions