Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some filename can not put. #53

Open
RainGather opened this issue Apr 13, 2018 · 2 comments
Open

Some filename can not put. #53

RainGather opened this issue Apr 13, 2018 · 2 comments

Comments

@RainGather
Copy link

RainGather commented Apr 13, 2018

Env:

Windows 10
Anaconda 3
Both NodeMCU ESP8266 And ESP32
MicroPython latest version

I have a python file named Ultrasonic.py.
And when I do next command:

python -m mp.mpfshell -o COM5
md ezmpy
cd ezmpy
put Ultrasonic.py

There have an Error:

Traceback (most recent call last):
File "C:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Anaconda3\lib\site-packages\mp\mpfshell.py", line 711, in
main()
File "C:\Anaconda3\lib\site-packages\mp\mpfshell.py", line 704, in main
mpfs.cmdloop()
File "C:\Anaconda3\lib\cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "C:\Anaconda3\lib\cmd.py", line 217, in onecmd
return func(arg)
File "C:\Anaconda3\lib\site-packages\mp\mpfshell.py", line 369, in do_put
self.fe.put(lfile_name, rfile_name)
File "C:\Anaconda3\lib\site-packages\mp\mpfexp.py", line 537, in put
MpFileExplorer.put(self, src, dst)
File "C:\Anaconda3\lib\site-packages\mp\retry.py", line 43, in f_retry
return f(*args, **kwargs)
File "C:\Anaconda3\lib\site-packages\mp\mpfexp.py", line 302, in put
raise e
File "C:\Anaconda3\lib\site-packages\mp\mpfexp.py", line 284, in put
self.exec
("f = open('%s', 'wb')" % self.fqn(dst))
File "C:\Anaconda3\lib\site-packages\mp\pyboard.py", line 157, in exec

raise PyboardError('exception', ret, ret_err)
mp.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n File "", line 1\r\nSyntaxError: invalid syntax\r\n')

And if I rename Ultrasonic.py to u.py, and retry, it is all good, no error.
I met many times this problem, sometimes is Ultrasonic.py, sometimes is finger.py

@junhuanchen
Copy link
Contributor

well.
From the picture can know this error is come from the board returns information on the error.

Do not use the python -m mp. Mpfshell directly because the lpwd path of mpfshell is not consistent with the path of your file.

execute mpfshell directly, or check the directory returned by the lpwd of the board. If you're windwos, you also need to be aware that it's under the same drive and filename uppercase.

You can also try out my mpfshell. XD.

@skorokithakis
Copy link
Collaborator

@junhuanchen Would you like to submit a PR on this (and other functionality you find useful)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants