c4ev3 / ev3duder

The LEGO® EV3 Downloader/UploaDER.
http://c4ev3.github.io/ev3duder/doc/html/globals_func.html
GNU General Public License v3.0
34 stars 12 forks source link

Spurious incomplete upload #6

Closed a3f closed 6 years ago

a3f commented 7 years ago

Reported here: https://github.com/c4ev3/EV3-API/issues/10#issuecomment-336695475

OK I have to say I don't understand at all what is happening. Your test went succesfully (I add bs=1 in the dd command line). Back to my real program and my script to download it into the brick: Most of the it works work with thel ELF, and sometimes not, and I can't fund a rule... Altough, the rbf file is usually not properly downloaded: On my computer : #ll

[fabien@HPDEB ~/devel/eworkspace/test ]$ ll
total 748
-rwxrwxr-x+ 1 fabien domain users 0 Oct 13 22:23 make.c
-rwxrwxr-x+ 1 fabien domain users 311 Oct 15 10:29 make_test_sdcard.sh
-rwxrwxr-x+ 1 fabien domain users 320 Oct 14 19:02 make_test.sh
-rwxrwxr-x+ 1 fabien domain users 650691 Oct 15 10:30 test
-rwxrwxr-x+ 1 fabien domain users 65872 Oct 7 22:08 test.bin.bak
-rwxrwxr-x+ 1 fabien domain users 454 Oct 14 20:05 test.c
-rwxrwxr-x+ 1 fabien domain users 72 Oct 15 10:30 test.rbf

 $ ev3duder up test.rbf ../prjs/SD_Card/BrkPrg_SAVE/test.rbf
    USB connection established.
    `upload` was successful.
 $ ev3duder ls ../prjs/SD_Card/BrkPrg_SAVE
    USB connection established.
    00 22 00 00 00 01 99 00 04 2e 2e 2f 70 72 6a 73 2f 53 44 5f 43 61 72 64 2f 42 72 6b 50 72 67 5f 53 41 56 45 00 
    Checking reply: 
    D41D8CD98F00B204E9800998ECF8427E 00000000 test.rbf
    0A228D449871F44FDD1AC889F4FA794E 0009EDC3 test

The size of the rbf file is zero!

I add the 'sync' command in my script file between each ev3duder download command, but it change nothing.

abke commented 7 years ago

As soon as I have understood correctly from your output, you are trying to upload from a linux development computer onto the brick via USB, right?

The following applies only on USB transfers using a linux computer: We already figured out, that there seems to be an open issue in libusb, which is used for the transfer on linux systems by ev3duder. However, this issue is even known by the maintainers of libusb but at the moment at low priority. Reason is simply, the usb transfer mode on the brick is an old fashioned usb 1.1 slow transfer, which is rarely used on current usb 2.0 systems. If you know a bit on USB and debugging/programming we would be happy to lend some hand to libusb for fixing this issues.

Fabcha44 commented 7 years ago

Yes it's right, I use a laptop under Debian Stretch. And yes, the issue arose only on USB transfers. So far, no issue at all on wifi. I would also have been happy to help but I have no experience at all on USB or system programming (I used to be a programmer on banking end-user application).

a3f commented 6 years ago

This should've been fixed in d65d6c9c340a5917a1f6c64983414619c142471a. Please tell if the fix doesn't work for you.