rsync timeout

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
smhodge
Posts: 68
Joined: Tue Jan 22, 2019 2:16 am

Re: rsync timeout

Post by smhodge » Thu Apr 16, 2020 4:39 pm

Well, so far, knock on wood, the update to rshell appears to be working. I'll update this update if it starts failing again. If it does I'll try littleFs. Thanks for all your help (and the update to rshell!).

smhodge
Posts: 68
Joined: Tue Jan 22, 2019 2:16 am

Re: rsync timeout

Post by smhodge » Fri Apr 17, 2020 3:21 pm

Well that was short-lived. I have 3 pyboards I am programming and it turns out I mistook the one that was having the problems with a good one, so that's the reason for the last "all is fixed" post. With the bad board the issue is still there, both with the updated rshell and/or switching to LittleFS. There is one slight difference in that the error message from rshell is now <timed out or error in transfer to remote: b''>. The last part, a null bytes string, is new.

The bad board works just fine if I load the code onto an SD card. Since I have also done several mass erases & firmware reloads, I have to conclude that /flash is corrupt or whatever. Is there a way to verify/test this?

User avatar
dhylands
Posts: 3356
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rsync timeout

Post by dhylands » Fri Apr 17, 2020 4:30 pm

You could always try to do a mass erase, or a filesystem reset: http://docs.micropython.org/en/latest/p ... boot-modes

Your filesystem might be corrupt, but not corrupt enough that micropython automatically reinitializes it at startup.

smhodge
Posts: 68
Joined: Tue Jan 22, 2019 2:16 am

Re: rsync timeout

Post by smhodge » Fri Apr 17, 2020 4:41 pm

I've tried the mass erase & firmware reload many times. So many times, in fact, that I made a batch file to do it.

User avatar
dhylands
Posts: 3356
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rsync timeout

Post by dhylands » Fri Apr 17, 2020 4:48 pm

The fact that you have good boards and bad boards which are presumably running the same firmware does seem to suggest a HW issue of some kind.

smhodge
Posts: 68
Joined: Tue Jan 22, 2019 2:16 am

Re: rsync timeout

Post by smhodge » Fri Apr 17, 2020 4:54 pm

So is there any way to test the hardware to verify that?

User avatar
dhylands
Posts: 3356
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rsync timeout

Post by dhylands » Fri Apr 17, 2020 5:15 pm

I'm not aware of anything readily available.

It's probably something marginal. Handling boards can cause damage due to static. Connecting things up wrong can also damage/weaken internal components on the microprocessor.

Even things like cold solder joints can cause weird problems, especially if its on a ground connection.

smhodge
Posts: 68
Joined: Tue Jan 22, 2019 2:16 am

Re: rsync timeout

Post by smhodge » Sat May 02, 2020 4:56 pm

Saga conclusion. As my code has continued to grow in size I have had to deal with this issue more and more. It has finally reached the point where it *always* happens and I simply cannot use rshell/rsync to update files on /flash. It always fails with the message <timed out or error in transfer to remote: b''> (a null bytes string at the end).

This now happens on 4 pyboards, including one "virgin" board out of the box with only a firmware upgrade (to 1.12) done to it.

However, and this is the key point, if I switch to using the sdcard, i.e., using rshell/rsync to /sd instead of /flash, everything works flawlessly on all 4 boards, all the time (so far anyway, 2 weeks now). So I have concluded that the issue is something to do with total file size that is causing /flash to fail. As the size grows, the issue occurs first sporadically but then ever more so until it is all the time. Switch to /sd and all is ok, and with the added benefit of being blindingly fast compared to /flash. I'm using 16 GB class 10 sd cards and for all intents and purposes it's as fast as a hard drive.

I now have 16 code files, total size about 62 KB, which is only about half of what I understand is the limit of /flash. However, that size is stripped of all comments, so it is a "code-only" size. I have a pre-processor that, among other things, does that stripping before the files are copied by rsync to the pyboard. The total number of lines of code is now about 2100 and uses about 75 % of ram when running.

I never made a note of the corresponding figures when I first noticed this issue, but I'm guessing in retrospect it was somewhere between 30 and 50 KB total file size (code only).

User avatar
pythoncoder
Posts: 4161
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: rsync timeout

Post by pythoncoder » Sat May 02, 2020 5:16 pm

You might like to look at https://liftoff.github.io/pyminifier/ which does rather more than stripping comments.
Peter Hinch

Post Reply