Problems pasting 190 lines of code into PuttY

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
Gilbert
Posts: 16
Joined: Sun Sep 09, 2018 11:10 am

Problems pasting 190 lines of code into PuttY

Post by Gilbert » Tue Dec 25, 2018 10:17 am

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!

User avatar
Roberthh
Posts: 1571
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Problems pasting 190 lines of code into PuttY

Post by Roberthh » Tue Dec 25, 2018 10:24 am

Why do you paste and do not use tools like rshell? or transfer as files into your target device?

Gilbert
Posts: 16
Joined: Sun Sep 09, 2018 11:10 am

Re: Problems pasting 190 lines of code into PuttY

Post by Gilbert » Tue Dec 25, 2018 11:46 am

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.

User avatar
Roberthh
Posts: 1571
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Problems pasting 190 lines of code into PuttY

Post by Roberthh » Tue Dec 25, 2018 12:19 pm

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?

shaoziyang
Posts: 272
Joined: Sun Apr 17, 2016 1:55 pm

Re: Problems pasting 190 lines of code into PuttY

Post by shaoziyang » Wed Dec 26, 2018 1:38 am

When using paste mode, you need enough memory, or you may paste code multiple times.

Gilbert
Posts: 16
Joined: Sun Sep 09, 2018 11:10 am

Re: Problems pasting 190 lines of code into PuttY

Post by Gilbert » Wed Dec 26, 2018 10:52 am

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.

User avatar
Roberthh
Posts: 1571
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Problems pasting 190 lines of code into PuttY

Post by Roberthh » Wed Dec 26, 2018 11:00 am

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.

Post Reply