Page 1 of 1

Problems pasting 190 lines of code into PuttY

Posted: Tue Dec 25, 2018 10:17 am
by Gilbert
Hi,

Pasting code (using Crtl E and the right mouse button) worked fine until my code got bigger.
Now I have difficulties pasting 190 lines of code: Parts are missing.
The only way to overcome that problem now is to paste it in two parts which is not very handy.

Help!

Re: Problems pasting 190 lines of code into PuttY

Posted: Tue Dec 25, 2018 10:24 am
by Roberthh
Why do you paste and do not use tools like rshell? or transfer as files into your target device?

Re: Problems pasting 190 lines of code into PuttY

Posted: Tue Dec 25, 2018 11:46 am
by Gilbert
Thanks for your reply.
I do not know rshell : Can I use that in a similar way as PuttY?
Transfer as files: Do you mean: dump the code in main.py?
I have tried to edit main.py each time I wanted to make a change to the code but I ended up with a corrupted main.py.
And I need to change the code quite often as I need to tune the PID values of a balancing robot.

Re: Problems pasting 190 lines of code into PuttY

Posted: Tue Dec 25, 2018 12:19 pm
by Roberthh
Since you mention Putty, I assume you are using Windows, which mac not work with rshell. If you search in this forum for IDE, you'll find some ide's that have both a terminal window and file transfer capabilities, like https://dfrobot.gitbooks.io/upycraft/content/ or https://github.com/jungervin/EsPy and others. And you can for instance use Adafruit Ampy for file transfer.
b.t.w.: Which board are you using?

Re: Problems pasting 190 lines of code into PuttY

Posted: Wed Dec 26, 2018 1:38 am
by shaoziyang
When using paste mode, you need enough memory, or you may paste code multiple times.

Re: Problems pasting 190 lines of code into PuttY

Posted: Wed Dec 26, 2018 10:52 am
by Gilbert
Hi, Roberthh,

I am indeed using Windows, and Pyboard 1.1
I will try uPyCraft, which is one of your suggestions. (Seems to be a better tool than Ampy according to the comments on this forum.)


Hi shaoziyang,
I have freed up memory to test the "paste mode" and the problem remains. Sometimes it works but most of the times it fails.

Re: Problems pasting 190 lines of code into PuttY

Posted: Wed Dec 26, 2018 11:00 am
by Roberthh
Uisng Pyboard you can copy files directly to the device, because it is mounted as external drive. But as you experienced, this requires care. After writing to pyboard, you have to eject the in Windows. Otherwise the files system may get corrupted. And you always have to wait until writing is finished. The red LED on pyboard lites up during writing.
Because of this files system damage risk, some people (like me) disable the mass storage mode in boot.py. You loose a little bit of comfort, but you gain robustness. After I have done that, I did not have a corrupted file system error any more.

I never worked with uPyCraft. If I need to copy files to & from the Pyboard, I either do it directly to the SD card or use rshell or ampy. But I'm using Linux.