sg-wireless / pymakr-atom

Adds a REPL console to Atom that connects to your Pycom board. It can run code on the board or synchronize your project files.
Other
35 stars 11 forks source link

Connection to LoPy (through Pysense) stops #26

Closed jellium closed 7 years ago

jellium commented 7 years ago

Hello,

Using a LoPy connected through a Pysense board, once the REPL prompt over serial is reached, the connection stops after a few seconds and Pymakr console outputs the following error:

> Failed to connect (Error: Error: Broken pipe, cannot drain). Click here to try again.

This error is not reproduced when reaching the REPL prompt with minicom.

This error is not reproduced in Pymakr when using an expansion board instead of a Pysense board.

Thank you.

jellium commented 7 years ago

Hi again, I suspect the error to be related to the latest release of the Pymakr package for Atom (version 1.0.2). I am pretty sure this error occurs since I updated the package yesterday.

jellium commented 7 years ago

I confirm that the problem lies in version 1.0.2 of the Pymakr Atom package. Downgrading to version 1.0.1 solves the issue. Yet I am curious to know what is wrong in version 1.0.2 for my LoPy-Pysense.

RalphHogenbirk commented 7 years ago

hi @jellium, thanks for reporting this. I'm investigating what is causing the issue.

On which OS are you? From 1.0.2 on, I added a keep-alive for the serial. An issue in the serialport library could be the cause of this keep-alive not working on windows 10 specifically. Yet, on my virtual windows 10 machine it seems to be working using a pysense and wipy.

tobru commented 7 years ago

I'm facing the same issue on Arch Linux, so it doesn't seem to be a Windows 10 specific issue.

jellium commented 7 years ago

Hi @RalphHogenbirk, thanks for the answer. I am using Ubuntu (16.04).

RalphHogenbirk commented 7 years ago

Before this 'broken pipe' error appears, are you able to use the REPL for a few seconds? Or is it never showing the '>>>'?

jellium commented 7 years ago

I confirm that I can use the REPL for a few seconds (it does show the '>>>' before the error occurs). I tried to explain this in the opening post. Thanks,

RalphHogenbirk commented 7 years ago

After some more testing I got to reproduce it on windows and linux. There is an issue with the driver in the pysense/pytrack that makes the keep-alive message fail. On mac it should also fail, but the drivers on mac are probably ignoring the error that is produced, so there it ends up working like it should, from atoms perspective.

We'll brainstorm about a solution. At the very least I'll have workaround for you guys by the end of the day.

jellium commented 7 years ago

Sweet, thanks for your feedback. Again: downgrading to 1.0.1 can be a workaround (it is for me in the meantime before any fixing update).

RalphHogenbirk commented 7 years ago

@jellium @tobru A small workaround is now on the develop branch, that disables the keep-alive (dtr) for linux and windows. You can either keep using v1.0.1 or the code on develop. The workaround will be included in the next release. We'll have to wait for a future pytrack/pysense usb driver update before we enable the dtr feature again.