m5stack / M5Cloud

Micropython Web IDE beta version
http://io.m5stack.com/
146 stars 33 forks source link

ampy support #12

Open pastukhov opened 6 years ago

pastukhov commented 6 years ago

Any plans to ampy support? I'm getig white screen, then reboot.

0x1abin commented 6 years ago

ampy is support if you enter the serial repl.

pastukhov commented 6 years ago

I'm getting reboot m5stack crashing with ampy

ampy -p /dev/ttyUSB0 ls
Traceback (most recent call last):
  File "/home/pastukhov/.local/bin/ampy", line 11, in <module>
    sys.exit(cli())
  File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/cli.py", line 147, in ls
    for f in board_files.ls(directory):
  File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/files.py", line 106, in ls
    return ast.literal_eval(out.decode('utf-8'))
  File "/usr/lib/python3.6/ast.py", line 48, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    E (36216) [Mqtt client]: Socket error (128), exit Receive schedule
    ^
SyntaxError: invalid syntax
pastukhov commented 6 years ago

And i have repl prompt in ESPlorer and monitor

0x1abin commented 6 years ago

Hi, I try this, and it succeed upload the file. ampy -p /dev/tty.SLAB_USBtoUART -b 115200 put tftdemo.py

ampy just need MicroPython REPL file operations, if your repl work well, it should be succeed.

pastukhov commented 6 years ago

Rebbot, white screen and trace: Traceback (most recent call last): File "/home/pastukhov/.local/bin/ampy", line 11, in <module> sys.exit(cli()) File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/pastukhov/.local/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/cli.py", line 213, in put board_files.put(remote, infile.read()) File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/files.py", line 146, in put self._pyboard.exec_("f.write({0})".format(chunk)) File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/pyboard.py", line 263, in exec_ ret, ret_err = self.exec_raw(command) File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/pyboard.py", line 254, in exec_raw self.exec_raw_no_follow(command); File "/home/pastukhov/.local/lib/python3.6/site-packages/ampy/pyboard.py", line 251, in exec_raw_no_follow raise PyboardError('could not exec command') ampy.pyboard.PyboardError: could not exec command