roleoroleo / yi-hack-Allwinner-v2

Custom firmware for Yi 1080p camera based on Allwinner platform
MIT License
753 stars 90 forks source link

Upgrade not available #779

Closed Giuserver closed 5 months ago

Giuserver commented 6 months ago

On all my cameras, the update button doesn't seem to work.

Screenshot 2023-12-17 alle 11 56 31
mscosta01 commented 6 months ago

+1

SnOOpeRa commented 6 months ago

+1 , current ver 0.2.9 , same thing

Giuserver commented 6 months ago

maybe @roleoroleo can explain 😊

roleoroleo commented 6 months ago

I think it's the same probem described here: https://github.com/roleoroleo/yi-hack-MStar/issues/526#issuecomment-1868063986

A bug in the busybox wget. I need to check it. If you need to upgrade the fw, use the manual procedure described in the wiki.

Giuserver commented 6 months ago

I think it's the same probem described here: roleoroleo/yi-hack-MStar#526 (comment) A bug in the busybox wget. I need to check it. If you need to upgrade the fw, use the manual procedure described in the wiki.

for me it shows /root is only-read system following what the wiki says

root@Yi36:/tmp# mv y21ga_0.3.0.tgz /root/ mv: can't create '/root/y21ga_0.3.0.tgz': Read-only file system

I allowed myself to do an update like this only once and i broke everything 😅 we're waiting for the restore.. which I believe will happen on the server side. Also because i don't have the possibility to take the camera manually

niziak commented 6 months ago

Manual update procedure mentioned here https://github.com/roleoroleo/yi-hack-MStar/wiki/Manual-firmware-upgrade says:

Copy the file in the root folder of the sd card.

ROOT FOLDER OF SD CARD is not /root

Working "remote" procedure:

  1. Download latest firmware. On my PC I'm using simple wget command: wget https://github.com/roleoroleo/yi-hack-Allwinner-v2/releases/download/0.3.0/y21ga_0.3.0.tgz
  2. Upload downloaded firmware to camera's SD card root /tmp/sd but with changed version number to x letters: scp y21ga_0.3.0.tgz scp://root@192.168.177.187//tmp/sd/y21ga_x.x.x.tgz
  3. Press Upgrade Firmware button

@roleoroleo Like you said before - there is no https support in wget nor any other utility available on camera. How upgrade works before ?

EDIT: I've just added openssl package and enabled CONFIG_FEATURE_WGET_OPENSSL=y busybox wget option. Now busybox's wget spawn openssl binary to perform download:

31721 root       972 T    ./busybox1 wget --no-check-certificate https://github.com/roleoroleo/yi-hack-Allwinner-v2/releases/download/0.3.0/y21ga_0.3.0.tgz
31725 root         0 Z    [openssl]
31767 root      3772 T    openssl s_client -quiet -connect objects.githubusercontent.com:443 -servername objects.githubusercontent.com

Now only cosmetic fixes with ca-certificates bundle needed. @roleoroleo should I continue my efforts and create PR ?

roleoroleo commented 6 months ago

ROOT FOLDER OF SD CARD is not /root

Correct. I added a new note to the wiki page.

@roleoroleo Like you said before - there is no https support in wget nor any other utility available on camera. How upgrade works before ?

Simply wget ignores certificates. I think the problem is harder than it appears. It's not true that wget doesn't work anymore with https. It you try another site, maybe it works:

root@yi-hack-h52ga:~/bin# wget https://www.google.com
Connecting to www.google.com (142.250.180.132:443)
wget: note: TLS certificate validation not implemented
saving to 'index.html'
index.html           100% |***************************************************************************************************************************************************************| 18141  0:00:00 ETA
'index.html' saved

I think it's related to https + forward.

Now only cosmetic fixes with ca-certificates bundle needed. @roleoroleo should I continue my efforts and create PR ?

It depends on how big the openssl binary is. Because I would like to find the same solution for all platforms (MStar, Allwinner and Allwinner-v2) and there is a big space constraint in MStar and Allwinner.

niziak commented 6 months ago

Unstripped openssl + shared libs:

576K openssl
2,3M libcrypto.so.1.1
492K libssl.so.1.1

Plus default ca certs bundle ~200K. Bundle can be reduced to Github related certs. I can try to remove some features and link it statically. Many years ago static OpenSSL size was around 900kB. If it will be possible to get binary around 1-1.2 MB will it be big or OK for other platforms? Another approach is to remove online checking and provide simple "upload firmware" button on web page ?

roleoroleo commented 6 months ago

1.2 MB it's big. I have to do some calculations...

roleoroleo commented 5 months ago

It seems that bb 1.36.1 should fix the problem. I will try asap.

EDIT

Confirmed. After update to 1.36.1 it works.

roleoroleo commented 5 months ago

Fixed here: https://github.com/roleoroleo/yi-hack-Allwinner-v2/commit/f282010701f9b4fdce7634a78952748e56a18609

TungstenE2 commented 5 months ago
1. Download latest firmware. On my PC I'm using simple wget command: `wget https://github.com/roleoroleo/yi-hack-Allwinner-v2/releases/download/0.3.0/y21ga_0.3.0.tgz`

2. Upload downloaded firmware to camera's SD card root `/tmp/sd` but with changed version number to `x` letters: `scp y21ga_0.3.0.tgz scp://root@192.168.177.187//tmp/sd/y21ga_x.x.x.tgz`

3. Press `Upgrade Firmware` button

done the steps, but copied to SD with card reader on PC.

after reboot still no update possible.

grafik

pannal commented 5 months ago

after reboot still no update possible.

Yes it is, rename the file's version numbers to x, e.g.: r30gb_0.3.0.tgz -> r30gb_x.x.x.tgz

TungstenE2 commented 5 months ago

after reboot still no update possible.

Yes it is, rename the file's version numbers to x, e.g.: r30gb_0.3.0.tgz -> r30gb_x.x.x.tgz

did this as stated before, but not working

Giuserver commented 5 months ago

Solved with last version

Screenshot 2024-01-19 alle 18 50 47
TungstenE2 commented 5 months ago

Solved with last version Screenshot 2024-01-19 alle 18 50 47

great, but how to update, if OTA and manual does not work?

roleoroleo commented 5 months ago

Manual upgrade must work. Please try again.

In any case, you can format the sd card and create it again with the new version. Backup the configuration.

playersct commented 5 months ago

Manual upgrade must work. Please try again.

Work without problems :)

Giuserver commented 5 months ago

Manual upgrade must work. Please try again.

In any case, you can format the sd card and create it again with the new version. Backup the configuration.

How can I do the update manually? Do you mean, format the sd card and paste it new version?

roleoroleo commented 5 months ago

Check the wiki.

JoseAlcerreca commented 1 month ago

This method worked but note that you can also use the FTP to upload the file if extracting the sd card is cumbersome.