Flash ATV via command line from the creators GrogBuild FreeRange - Leading the way to simplicity

grog68

VIP Member
TK Supporter
Ever done a software update and found the box won't boot?

Ever turn your box on and found it only boots up so far?

Every tried to flash online to flash online and found that your build is so old you don't have the option to flash the latest version of ATV via the Flash Online system?

Ever wanted to flash your box but have not got another spare USB stick?

Well I've now got a simple solution for you. It will find the latest nightly build of the current stable ATV and then flash your box. All you need is :

your existing USB/HDD mounted on /media/hdd, this should be the case for recordings etc, you do not need any additional usb stick formatted fat32

you need to be able to connect to your box via putty (or any other shell terminal program) or the openwebif terminal.

This tool does NOT backup your settings so make sure you do (if you can) before using.

SSH to your box using a terminal program such as putty, or using the terminal option of openWebIf in your browser and log in using the username root

Now paste all the code below into the terminal window. (right click on the terminal window to paste)

Code:
 wget --no-check-certificate -O installatv.sh https://www.dropbox.com/s/nqbo698rxconave/installatv.sh?dl=1 && bash installatv.sh

after a few seconds you will be asked to enter the box hostname, if you've never changed the hostname of your box then just accept the default by pressing enter key, if you are paranoid and have changed the hostname in the past then you need to enter the original hostname for your box, ie zgemmah52tc and then press the enter key.

Now you are prompted which partition you want flashed, this is for boxes with multiboot, if you don't use multiboot or your box doesn't have multiboot facilities just hit the enter key, if you are using multiboot enter the partition number and then press enter key. (Thanks to @Willo3092 for suggesting and testing Multiboot flashing)

The latest stable nightly build will then be downloaded to /media/hdd and your box flashed.

I am sure this will be copied, made into a plugin of some kind or added to another build but remember you saw it here first :)
 
has the box got to be in standby or something as I get an error message. Error remounting root and it switches off the box and reloads original.
 
no if the box is on you should see the flashing bars on the screen.

There is one caveat, if your box has ofgwrite version 4.2.1 installed this caused some issues with flashing a box online, ATV developers did then revert back to ofgwrite 4.1.7 which didn't have an issue. 4.2.1 was only included in ATV for a short while from what I understand so it should only effect a few people

If you login to your box via putty or terminal link in openwebif and then type:

Code:
ofgwrite

You should see something like :

Code:
ofgwrite Utility v4.1.7
Author: Betacentauri
Based upon: mtd-utils-native-1.5.1 and busybox 1.24.1
Use at your own risk! Make always a backup before use!
Don't use it if you use multiple ubi volumes in ubi layer!

Usage: ofgwrite <parameter> <image_directory>
Options:
   -k --kernel           flash kernel with automatic device recognition(default)
   -kmtdx --kernel=mtdx  use mtdx device for kernel flashing
   -kmmcblkxpx --kernel=mmcblkxpx  use mmcblkxpx device for kernel flashing
   -r --rootfs           flash rootfs with automatic device recognition(default)
   -rmtdy --rootfs=mtdy  use mtdy device for rootfs flashing
   -rmmcblkxpx --rootfs=mmcblkxpx  use mmcblkxpx device for rootfs flashing
   -mx --multi=x         flash multiboot partition x (x= 1, 2, 3,...). Only supported by some boxes.
   -n --nowrite          show only found image and mtd partitions (no write)
   -f --force            force kill e2
   -q --quiet            show less output
   -h --help             show help

If the version number (in bold above) is 4.2.1 then enter the following code:

Code:
opkg  install --force-reinstall ofgwrite

This should replace version 4.2.1 with a working version, now retry flashing and it should work.
 
Yeah you are correct that code returned as you said but the version is 2.2.8. should I still try to flash it with v4.2.1
 
here is my box info
Brand:
Zgemma
Model:
H.2S
Chipset:
bcm7362
Frontprocessor Version:
None
Total Memory:
313224 kB
Free Memory:
206188 kB
Box Uptime:
1:05
Software
System OE:
OE-Alliance 3.2
Distro:
openatv
Firmware version:
5.1.0
Driver date:
20151031
Kernel version:
4.0.1
Gui version:
2016-02-22
 
it looks like you have a really old version on your box, using the opkg command I mentioned above should hopefully sort it out, I did add the opkg to the grogbuild install script but didn't to this one as I didn't think it would affect many people but I might do that now.
 
it looks like you have a really old version on your box, using the opkg command I mentioned above should hopefully sort it out, I did add the opkg to the grogbuild install script but didn't to this one as I didn't think it would affect many people but I might do that now.

With Vix it will only update plugins on that current feed so its unlikely it will update to latest ofgwrite
 
bit more info on my box think it is a vix build or maybe a vix skin on a different build. Should I try to do the new ofgwrite or do you thnk it will do more harm than good.

model zgemma h.2s
chipset bcm7362
cpu bcm7362ao
cpu speed 751.5mhz
cores 2
version 5.1
build 0
image type release
skin name vix-night-hd
drivers 2015-10-31
kernel 4.0.1
gstreamer 1.7.1 (git)
python 2.7.9
installed 2015-12-02
last update 2016-02-22
 
With Vix it will only update plugins on that current feed so its unlikely it will update to latest ofgwrite
on ATV the feeds went back from 4.2.1 to 4.1.7, not sure what vix is using atm.
bit more info on my box think it is a vix build or maybe a vix skin on a different build. Should I try to do the new ofgwrite or do you thnk it will do more harm than good.
it won't do any harm, and the version you have 2.2.8 is old so it needs updating.
 
The script is just invoking ofgwrite. It currently uses ofgwrite that is on the receiver. Not sure if you want to host the latest working version of ofgwrite and fetch it then run it. Not sure if there is a difference between Arm and Mipsel versions.

If an image has been doctored to make the receiver appear as another, this may cause issues owing to partition sizes etc.

If people have a working receiver, they can also try Dimirij's plugin.
Code:
https://github.com/Dima73/automatic-full-backup
 
I am unable to access any plugins other than the ones that are already on there. it wont allow me to download any other plugins. So do you think running this would work.
opkg install --force-reinstall ofgwrite
 
The script is just invoking ofgwrite. It currently uses ofgwrite that is on the receiver. Not sure if you want to host the latest working version of ofgwrite and fetch it then run it. Not sure if there is a difference between Arm and Mipsel versions.

If an image has been doctored to make the receiver appear as another, this may cause issues owing to partition sizes etc.

If people have a working receiver, they can also try Dimirij's plugin.
Code:
https://github.com/Dima73/automatic-full-backup
the script uses the ofgwrite in the same same way as 'flash online' in the software manager, I didn't want to add any extra scripts etc. in most cases it will work, the only time I've seen an issue was when atv used ofgwrite 4.2.1 but they have now reverted to 4.1.7 so used the opkg force install just to force it back to 4.1.7 if the box has 4.2.1 installed.

TBH this method is only really meant to help those with a box that's not booting up properly so can't use 'Flash Online'
 
Last edited:
I am unable to access any plugins other than the ones that are already on there. it wont allow me to download any other plugins. So do you think running this would work.
opkg install --force-reinstall ofgwrite
I wonder if the issue you are having is that you are using VIX on an zgemma which is not officially supported so is a patched image.

BTW you have asked 4 or 5 times if you should run the command, rather than keep asking the same question and getting the same answer why not try it. It wont do any harm
 
read post 1 installation option 1, press exit to get out of menu system, hold blue button until menu appears and then select Autobouquetsmaker scan and once completed press epg button and select channel.
 
Back
Top