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

exec executes the file char by char #76

Open
crasu opened this issue Sep 28, 2017 · 4 comments
Open

exec executes the file char by char #76

crasu opened this issue Sep 28, 2017 · 4 comments

Comments

@crasu
Copy link

crasu commented Sep 28, 2017

Running this:

#nodemcu-uploader --baud 115200 exec dfplayer-test.lua 

Result in dfplayer-test.lua being executed char by char:

opening port /dev/ttyUSB0 with 115200 baud
Execute dfplayer-test.lua
> p
>> =
>> r
> e
>> q
stdin:2: '=' expected near 'q'
> u
...

Changing utils.py to this seems to fix it:

def from_file(path):
    with open(path, 'rb') as f:
        content = f.readlines()
    return content if PY2 else [ c.decode(ENCODING) for c in content ]

But causes a lot of other problems ;-(

@kmpm
Copy link
Owner

kmpm commented Dec 11, 2018

On which OS are you running this?
There is a chance of this being different End-Of-Line markers between reality and expected.

@crasu
Copy link
Author

crasu commented Dec 11, 2018

Linux - ubuntu

@rvalle
Copy link

rvalle commented Mar 21, 2020

same thing here on linux-fedora
@kmpm char by char should not be EOL related.
anyway, I tested converting it to dos format before submission and fails in the same way.

could it be a serial buffering thing? I am going to test a little, see if I can find out anything...

@rvalle
Copy link

rvalle commented Mar 21, 2020

ok I suspect the serial ...

I tried setup virtual environments to see if that would make it work in any conf

python 2.7 and:
Package          Version
---------------- -------
nodemcu-uploader 0.4.3  
pip              20.0.2 
pyserial         3.4    
setuptools       44.1.0 
wheel            0.34.2 
wrapt            1.12.1 

Fails the same and

Python 3.7 
Package          Version
---------------- -------
nodemcu-uploader 0.4.3  
pip              20.0.2 
pyserial         3.4    
setuptools       46.1.1 
wheel            0.34.2 
wrapt            1.12.1 

also fails.

do you remember any particular versions that would work on linux?

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