microfs icon indicating copy to clipboard operation
microfs copied to clipboard

unable to `ufs get` a 20k file

Open rhubarbdog opened this issue 6 years ago • 8 comments

I've created what i believe to be a 20k file. when i type ufs get 20k.txt test.txt it consistently says not enough values to unpack (expected 2, got 1) when i type ufs ls it lists the file 20k.txt

rhubarbdog avatar Dec 06 '18 05:12 rhubarbdog

I get this same error when I try to ufs put certain 4k file. Works on microbit 1.5, not 2.0.

I also have another 4k file that works on both.

bobpappas avatar Jan 27 '22 01:01 bobpappas

@rhubarbdog @bobpappas would you be able to attach your files into this GitHub issue? I'd be interested to debug this.

carlosperate avatar Feb 25 '22 15:02 carlosperate

@rhubarbdog @bobpappas just a friendly ping in case you'd be able to provide the files that can easily replicate this issue. Thanks!

carlosperate avatar May 12 '22 14:05 carlosperate

I no longer have the laptop which had the microbit program which created the 20k file. I'll try a few things this week to see if I can replicate it

rhubarbdog avatar May 22 '22 07:05 rhubarbdog

i've done this to replicate the issue

  1. uflash the microbit to a empty microbit

with open('bigfile.txt', 'w') as file_ :
    for a in range(2560):
        file_.write('microbit')```

transfer the above program and `main.py` using ufs put bigfile.py main.py`

run the program.
try `ufs ls` and the file `bigfile.txt` exists on the microbit
try to tranfer it to your laptop with `ufs get bigfile.txt` some data appears to come up the wire,
but `ufs` crashes with error message `not enough values to unpack (expected 2, got 1)`

rhubarbdog avatar May 22 '22 11:05 rhubarbdog

Thanks a lot for the instructions @rhubarbdog! I'll away for a few days this week, but I'll try to find some time to do some debugging next week. 👍

carlosperate avatar May 26 '22 10:05 carlosperate

Oldie, but I just had this problem. It seems the 1s timeout is not long enough for large files when it's doing the read_until.

I changed 119 in get_serial() to

 return Serial(port, SERIAL_BAUD_RATE, timeout=60, parity="N")

and it worked OK for my 10K file.

andyclap avatar May 19 '23 12:05 andyclap

I also have had this problem, and I have opened #41 to try and fix this.

BenDev9 avatar May 29 '23 18:05 BenDev9