denven / yihack-onedrive-uploader

Upload your Yi-Camera video files to Microsoft OneDrive storage instead of subscribing a vendor's cloud plan.
MIT License
5 stars 0 forks source link

Fail on Yi Home IFUS #11

Open kosauser opened 5 months ago

kosauser commented 5 months ago

Hello,

Is there any chance to implement it also on unsupported Yi 1080p Home IFUS with Owner avatar yi-hack-Allwinner-v2? I did try it and it look good in logs, directory gets created on OneDrive, but it is empty. Already on this camera GDrive hack is working (do not know if this is a root cause. Any ideas what to check?

From the installation log ./init.sh: line 1: ls: Argument list too long occurs periodically.

Using your authorization code to get an access token ...
Get OneDrive access tokens successfully
Enabled OneDrive Uploader auto-run when camera boots up.
Success: get_drive_status
You have used 6.20GB(0.59%) of your storage space, with 1047.80GB(99.41%) space remaining.
Check './data/drive_status.json' to see your drive quota details.
Your OneDrive access is available.
Success: create_folder yihack_videos
Created folder yihack_videos to store your video files successfully.
Configuration is done.
Start to check camera video and image files for uploading...
./init.sh: line 1: ls: Argument list too long
All files were uploaded, wait for a new recorded video or image file.
./init.sh: line 1: ls: Argument list too long
All files were uploaded, wait for a new recorded video or image file.
denven commented 5 months ago

I cannot say absolutely yes since I don't have tested with that device, but I think it is very likely to be compatible with Yi cameras when:

For your current issue, can you type the below command and paste your result here?

cd /tmp/sd/record
find . -type f | awk 'END {print "total files: "NR}'
find . -type f \( -name "*.mp4" -o -name "*.jpg" \) | awk 'END {print "total media files: "NR}'
ls -R | tail -n 122
du -h

cd ../yi-hack/onedrive/logs
cat logs 
# or reboot the camera
tail -f -n 100 logs

and if there are too many files never uploaded, can you download your old directory to backup and keep only a few recent records directories to test in the beginning?

kosauser commented 5 months ago
root@(none):~# cd /tmp/sd/record
root@(none):/tmp/sd/record# find . -type f | awk 'END {print "total files: "NR}'
total files: 5368
root@(none):/tmp/sd/record# find . -type f \( -name "*.mp4" -o -name "*.jpg" \) | awk 'END {print "total media files: "NR}'
total media files: 5368
root@(none):/tmp/sd/record# ls -R | tail -n 122
05M00S60.mp4
06M00S60.mp4
07M00S60.mp4
09M09S51.mp4
10M00S60.mp4
11M07S53.mp4
12M00S60.mp4
13M00S60.mp4
14M00S60.mp4
15M00S60.mp4
16M00S60.mp4
17M00S60.mp4
18M00S60.mp4
19M00S60.mp4
20M00S60.mp4
21M00S60.mp4
22M00S60.mp4
23M00S60.mp4
27M47S13.mp4
28M00S60.mp4
29M00S60.mp4
30M36S24.mp4
31M00S60.mp4
32M01S59.mp4
33M00S60.mp4
34M00S60.mp4
36M15S45.mp4
37M00S60.mp4
38M00S60.mp4
39M00S60.mp4
40M00S60.mp4
41M00S60.mp4
42M00S60.mp4
43M00S60.mp4
44M00S60.mp4
45M00S60.mp4
46M00S60.mp4
47M00S60.mp4
48M00S60.mp4
49M00S60.mp4
50M00S60.mp4
51M00S60.mp4
52M00S60.mp4
53M00S60.mp4
54M00S60.mp4
55M00S60.mp4
56M00S60.mp4
57M00S60.mp4
58M00S60.mp4
59M00S60.mp4

./2024Y01M29D18H:
00M00S60.mp4
01M00S60.mp4
02M00S60.mp4
03M00S60.mp4
04M00S60.mp4
05M00S60.mp4
06M00S60.mp4
07M00S60.mp4
08M00S60.mp4
09M00S60.mp4
10M00S60.mp4
11M00S60.mp4
12M00S60.mp4
13M00S60.mp4
14M00S60.mp4
15M00S60.mp4
16M00S60.mp4
17M00S60.mp4
18M06S54.mp4
19M00S60.mp4
20M00S60.mp4
21M00S60.mp4
22M00S60.mp4
23M00S60.mp4
24M00S60.mp4
34M29S31.mp4
35M00S60.mp4
36M00S60.mp4
37M00S60.mp4
38M00S60.mp4
39M00S60.mp4
40M43S17.mp4
41M00S60.mp4
42M00S60.mp4
43M00S60.mp4
47M06S54.mp4
48M00S60.mp4
49M00S60.mp4
50M00S60.mp4
51M00S60.mp4
52M00S60.mp4
53M00S60.mp4
54M00S60.mp4
55M36S24.mp4
56M00S60.mp4
57M00S60.mp4
58M00S60.mp4
59M00S60.mp4

./2024Y01M29D19H:
00M00S60.mp4
00M59S01.mp4
01M00S60.mp4
02M00S60.mp4
03M00S60.mp4
04M00S60.mp4
05M05S55.mp4
06M00S60.mp4
07M00S60.mp4
08M00S60.mp4
09M05S55.mp4
10M00S60.mp4
11M00S60.mp4
12M14S46.mp4
13M00S60.mp4
14M00S60.mp4
15M00S60.mp4
16M00S60.mp4
17M11S49.mp4
18M00S60.mp4
root@(none):/tmp/sd/record# du -h
du: unrecognized option: h
root@(none):/tmp/sd/record# 

I'll clean those recordings Also in logs I see this entry:

2024-01-25 21:56:50: OneDive Uploader started...
2024-01-29 20:48:56: 
2024-01-29 20:48:57: get_drive_status, Error: IDX14100: JWT is not well formed, there are no dots (.).
The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'., Code: InvalidAuthenticationToken
kosauser commented 5 months ago

After delteing files:

root@(none):~/onedrive/log# cd /tmp/sd/record
root@(none):/tmp/sd/record# find . -type f | awk 'END {print "total files: "NR}'
total files: 4
root@(none):/tmp/sd/record# find . -type f \( -name "*.mp4" -o -name "*.jpg" \) | awk 'END {print "total media files: "NR}'
total media files: 3
root@(none):/tmp/sd/record# ls -R | tail -n 122
.:
2024Y01M29D20H
tmp.mp4.tmp

./2024Y01M29D20H:
46M23S37.mp4
47M00S60.mp4
48M56S04.mp4
root@(none):/tmp/sd/record# du -h
du: unrecognized option: h
root@(none):/tmp/sd/record# cd /tmp/sd//yi-hack/onedrive/log/
root@(none):~/onedrive/log# tail logs 
2024-01-29 20:49:03: Update index from files newer than file /tmp/sd/record/2024Y01M08D20H/02M42S18.mp4...
2024-01-29 20:49:03: Updated index successfully.
2024-01-29 20:59:41: OneDive Uploader started...
2024-01-29 20:59:44: Refresh API tokens successfully, your token is still valid.
2024-01-29 20:59:46: Update index from files newer than file /tmp/sd/record/2024Y01M08D20H/02M42S18.mp4...
2024-01-29 20:59:46: Updated index successfully.
2024-01-29 21:11:18: OneDive Uploader started...
2024-01-29 21:11:21: Refresh API tokens successfully, your token is still valid.
2024-01-29 21:11:23: Update index from files newer than file /tmp/sd/record/2024Y01M08D20H/02M42S18.mp4...
2024-01-29 21:11:23: Updated index successfully.
root@(none):~/onedrive/log# 

obraz All directories inside are empty: obraz terminal file

Start to upload /tmp/sd/record/2024Y01M29D20H/46M23S37.mp4
Target OneDrive path: yihack_videos/202401/20240129/2024Y01M29D20H, file size: 4.19MB
Success: create_upload_session /tmp/sd/record/2024Y01M29D20H/46M23S37.mp4
upload_large_file_by_chunks /tmp/sd/record/2024Y01M29D20H/46M23S37.mp4
2024-01-29 22:15:32 upload chunk: 0, length: 3932160, bytes: 0-3932159
./init.sh: line 1: Illegal number:  -3
root@(none):~/onedrive/log# cat terminal 
denven commented 5 months ago

it seems like you are close to success. it's hard to tell which step has an error.

Here I have some suggestions:

@kosauser after you have set it up again, can you replace the api.sh file with this file(link) and check the terminal output info again

Hope you have new progress.

denven commented 2 weeks ago

@kosauser please check the fix for issue #12 or the latest release, I think your model could be supported.

kosauser commented 1 week ago

@denven It fixed it as for now on 🥇 thanks 👍

denven commented 1 week ago

@denven It fixed it as for now on 🥇 thanks 👍

@kosauser btw, can you provide your camera model and firmware information like the example below:

Model: Yi Home Pro 2K
Model Suffix: y623
Base Firmware: 12.0.51.08_202403081746
Allwinner v2 firmware: 0.3.2

or you can check and refer to the supported models in Readme.

I will add your camera model to the supported list.