Upgrade firmware to 1.6.2

Has anyone completed the upgrade to the 1.6.2 firmware? It was apparently released a couple weeks ago, but the whole situation is confusing (eg. the pinned topic at the top of the forums still says 1.5.3 is the latest).

Upgrading from 1.5.3 requires manually flashing U-Boot. The official instructions for doing this state it'll void your warranty, but not doing it will brick your Yun.

The 1.6.2 img is built from a new repo (openwrt-yun-1505) which lacks any explanation. All I could figure out was 1.6.2 is now based on vanilla OpenWRT vs. Linino, and there's better support for https/certs.

I blindly went ahead with the upgrade anyway, without any major incidents. But there are a few small issues with things like Avahi/dbus that I'm still working through. Hopefully there are a few others I can compare notes with.

Update: I've managed to get the Yun showing up in the Arduino IDE again (with firmware 1.6.2). I tried a few things along the road, but what I believe it all boils down to is a permissions issue (chmod +r /etc/avahi/services/arduino.service).

Update 2: Here are the steps I performed after setting up a TFTP server on my NAS, loading the serial sketch onto the Yun, and halting boot at the U-Boot prompt. The packages installed at the end are optional, but include the common stuff most folks might be interested in.

Caution: Following these instructions will irreversibly wipe all data from your device and SD card.

Update U-Boot, kernel, and rootfs

## Serial monitor (57600 baud)
```
# Configure u-boot for network tftp
ar7240> setenv serverip xxx.xxx.xxx.xxx;
ar7240> setenv ipaddr yyy.yyy.yyy.yyy;
ar7240> ping xxx.xxx.xxx.xxx

# Flash firmware from network tftp
ar7240> tftp 0x80060000 openwrt-ar71xx-generic-linino-u-boot.bin;

# Should return to prompt quickly, otherwise config is busted (reboot to retry)
ar7240> erase 0x9f000000 +0x40000;

# Flash U-Boot
ar7240> cp.b $fileaddr 0x9f000000 $filesize;
ar7240> erase 0x9f040000 +0x10000

# Flash kernel
ar7240> tftp 0x80060000 openwrt-ar71xx-generic-yun-kernel.bin;
ar7240> erase 0x9fEa0000 +0x140000;
ar7240> cp.b $fileaddr 0x9fea0000 $filesize;

# Flash OpenWRT-Yun (this took a few attempts. if it times out before completion, repeat the following)
ar7240> tftp 0x80060000 openwrt-ar71xx-generic-yun-rootfs-squashfs.bin;
ar7240> erase 0x9f050000 +0xE50000;
ar7240> cp.b $fileaddr 0x9f050000 $filesize;

# Resume boot
ar7240> bootm 0x9fea0000
```

Expand SD card, configure overlay/swap/opt partitions

This was mostly extracted from the YunDiskSpaceExpander.ino, but with a modified partition table to include 8GiB overlay (ext4: /dev/sda1), 512MiB swap (swap: /dev/sda2), and the remaining (~6GiB) mounted to "/opt" (ext4: /dev/sda3). The following assumes a 16Gb SD card - simply adjust the partition sizes to fit your needs.

```
$ umount /dev/sda?
$ rm -rf /mnt/sda?
$ dd if=/dev/zero of=/dev/sda bs=4096 count=10

# Create overlay partition
$ (echo n; echo p; echo 1; echo; echo +8G; echo w) | fdisk /dev/sda

# Create swap partition
$ (echo n; echo p; echo 2; echo; echo +512M; echo w) | fdisk /dev/sda
$ (echo t; echo 2; echo 82; echo w) | fdisk /dev/sda

# Create opt partition
$ (echo n; echo p; echo 3; echo; echo; echo w) | fdisk /dev/sda

# Format partitions
$ mkfs.ext4 /dev/sda1
$ mkfs.ext4 /dev/sda3
$ mkswap /dev/sda2

# Copy rootfs
$ mkdir -p /mnt/sda1
$ mount /dev/sda1 /mnt/sda1
$ rsync -a --exclude=/mnt/ --exclude=/www/sd /overlay/ /mnt/sda1/
$ umount /dev/sda1

# Arduino dir (optional?)
$ mkdir -p /mnt/sda3
$ mount /dev/sda3 /mnt/sda3
$ mkdir -p /mnt/sda3/arduino/www
$ umount /dev/sda3
$ rm -r /dev/sda{1,3}

# Configure extroot overlay
$ uci add fstab mount
$ uci set fstab.@mount[0].target=/overlay
$ uci set fstab.@mount[0].device=/dev/sda1
$ uci set fstab.@mount[0].fstype=ext4
$ uci set fstab.@mount[0].enabled=1
$ uci set fstab.@mount[0].enabled_fsck=0
$ uci set fstab.@mount[0].options=rw,sync,noatime,nodiratime
$ uci commit

# Configure opt
$ uci add fstab mount
$ uci set fstab.@mount[1].target=/opt
$ uci set fstab.@mount[1].device=/dev/sda3
$ uci set fstab.@mount[1].fstype=ext4
$ uci set fstab.@mount[1].enabled=1
$ uci set fstab.@mount[1].enabled_fsck=1
$ uci set fstab.@mount[1].options=rw,sync,noatime,nodiratime
$ uci commit

# Configure swap
$ uci add fstab swap
$ uci set fstab.@swap[0]=swap
$ uci set fstab.@swap[0].enabled=1
$ uci set fstab.@swap[0].device=/dev/sda2
$ uci commit

# Done
$ reboot
```

Update packages and install the basics.

The following will also reinstall Avahi with dbus so the Yun will again show up in Arduino IDE over the network.

# opkg (setup)
```
$ opkg update
$ opkg remove avahi-nodbus-daemon --force-depends
$ opkg install binutils lsblk e2fsprogs mkdosfs swap-utils fdisk rsync
$ opkg install dbus dbus-utils
$ opkg install avahi-dbus-daemon --force-overwrite
$ opkg install avahi-dnsconfd avahi-utils openssl-util
$ opkg list-upgradable
$ opkg upgrade ...
$ opkg install vim git node python python-pip python-openssl
```

Fix permissions on Arduino service file so Avahi can load it

$ chmod +r /etc/avahi/services/arduino.service
$ /etc/init.d/avahi-daemon restart

Please let me know if you find any errors and I'll update the post! Thanks.

M2Cents
1.6.2 is the firmware of the yunshield. As the yunshield and the yun are practically the same I assume the same firmware can (and probably should be used) Should in the sense that Arduino.cc is not going to maintain 2 tracks.

As to Avahi. I have a avahi problem on my yunshields. I assume it is the same as yours.
http://forum.arduino.cc/index.php?topic=401698.0

Best regards
Jantje

That all sounds about right. 1.6.2 is required to connect to Arduino Cloud, and it's also the official download for Yun.

I ran into the same error installing Avahi, tried force-reinstalling some packages, which resulted in Avahi tools like avahi-browse failing due to missing libdbus.so.3. Installing libdbus gets rid of those errors, but dbus isn't actually running so it hasn't solved anything.

Jantje:
As to Avahi. I have a avahi problem on my yunshields. I assume it is the same as yours.
How to install avahi-browse. - Yún Shield - Arduino Forum

Even though I'm pretty sure my trouble boiled down to the permissions on just that one file, I did manage to get the full suite of Avahi tools working with 1.6.2, maybe this will help you out:

$ opkg remove avahi-nodbus-daemon --force-depends
$ opkg update
$ opkg install dbus dbus-utils
$ opkg install avahi-dbus-daemon --force-overwrite
$ opkg install avahi-dnsconfd avahi-utils
$ /etc/init.d/avahi-daemon restart
$ avahi-browse-domains -a

It works, but installing dbus is a pretty heavyweight "workaround" if you're not really using Avahi for much. You can decide if it's worth it.

Thanks for the input.
I tried those commands and have following feedback

opkg uninstall

Did not work on my system. I used

opkg remove

The avahi-browse-domains -a command did not work directly. after a reboot it does :slight_smile:

So thank you. My problem is fixed. I'm not sure about the impact of installing a "pretty heavyweight" package.

As you seem to know this verywell. Now the whole avahi is installed, is it possible to add avahi devices to the dns?
I mean: 2 arduino yun's called yun1 and yun2 and being able to ping/browse/.. yun2 from yun1 by using yun2.local?
I have a script to enable this but native has my preference :slight_smile:
Thanks a lot
Jantje

Awesome, glad it was helpful. I edited the posts to correct the issues you mentioned (I must have just blundered the notes because uninstall isn't an opkg command).

I haven't yet figured out how to get nss-mdns running (that's the thing that usually handles name resolution of .local devices over broadcast in Linux) without building OpenWRT from scratch.

If you have a network router handling dhcp, it might be able to handle resolution and caching of mdns hosts. But I'm assuming if you were in that situation you wouldn't be having any issues. If you haven't already, check out your router configuration as it'll probably be easier than trying to configure individual network devices to do the job.

That said, I discovered a mdns package in opkg last night, which successfully discovers hosts on the network. But I have not found any guides or boilerplate configuration for doing anything useful with it.

impressiver:
If you have a network router handling dhcp, it might be able to handle resolution and caching of mdns hosts. But I'm assuming if you were in that situation you wouldn't be having any issues. If you haven't already, check out your router configuration as it'll probably be easier than trying to configure individual network devices to do the job.

I used to have this setup but I changed provider and now I no longer have this option.
Even simply assigning ip's to mac addresses would be a big help, but again provider (telenet) forces a dhcp server in my network which has very little support for "customisations". The only option I can still think of is to make a subnet with a dns server (openwrt would be fine because then you do not even need avahi ). But that is a bit of overkill.
I haven't been able to test my script yet but there is no reason why I wouldn't get it back to work as I have the info :slight_smile:
So thanks again.

I'm having trouble getting a good linux installation flashed. Doing u-boot and the kernel go OK, but when I do:

ar7240> tftp 0x80060000 openwrt-ar71xx-generic-yun-rootfs-squashfs.bin;

Everything seems to load OK, all 9830400 bytes, but then my Yún immediately stops being responsive to the serial console, which prevents me from doing:

erase 0x9f050000 +0xE50000;
cp.b $fileaddr 0x9f050000 $filesize;

bootm 0x9fea0000

I've tried to "catch" it by sending the erase command immediately after the "#### done" progress message, but it's no use. Then, the Yun starts rebooting repeatedly probably due to the wifi-live-or-reset script. Unfortunately, I don't think the rootFS is in a "good" state so I can't SSH to it or connect to the web UI.

I've tried holding down the wifi button for 5 seconds and then 35 seconds, but since I believe that I'm missing LuCi GUI I don't think this will help.

Here's the messages as it boots from the serial console: Pastebin link.

I'd love some advice, or maybe a pointer to the 1.5.3 binaries so that I can try the older kernel + root.

I'm sorry that I don't have any help to offer about your download/erase/program issues in uboot, other than to say that if you want to retry it, you have to catch it in that "auto out in four seconds" phase and enter "ard" - but you probably already know that since you say it keeps doing this.

rgm:
Then, the Yun starts rebooting repeatedly probably due to the wifi-live-or-reset script.

That's possible, given that you say it reboots about a minute after the last messages.

Unfortunately, I don't think the rootFS is in a "good" state so I can't SSH to it or connect to the web UI.

If it's booting as far as it is, and the wifi-live-or-reset script is running, then you should be able to get to the command prompt, at least for the minute until it reboots. But you probably won't get there using a WiFi connection - if wifi-live-or-reset is resetting the board, then it's dong so because there is no WiFi connection.

Try making an Ethernet connection, or use the YunSerialTerminal connection (which you are using to get the boot messages.) The first thing I would try to do is disable wifi-live-or-reset by renaming it to something else:

cd /usr/bin
mv wifi-live-or-reset wifi-live-or-reset.disabled

This will rename the file so that it is not found the next time that the system boots. It will already have been launched, so just renaming won't disable it for this boot cycle, so the system will still reboot after a minute. But the next time that it boots up, the file shouldn't be found, and the endless reboot cycle should be over (if this is what is actually causing the reboots.)

I've tried holding down the wifi button for 5 seconds and then 35 seconds, but since I believe that I'm missing LuCi GUI I don't think this will help.

The LuCI GUI has nothing to do with it. This is a script that is started at the end of the boot process that monitors the WLAN RST button: when it is pressed, it saves the time, and when it is released it looks to see how long it's been pressed and calls an appropriate command.

When did you try pressing this button? It's not well documented, but this only works once the Linux system has fully booted. Lots of systems out there do a factory reset by pressing and holding a button immediately after power up, or even holding the button while applying power. The Yun doesn't work that way. You need to wait until it's fully booted before pressing it, but you have the problem that it resets quickly. So you need to press it once it's booted, and release it before the system reboots itself. This isn't going to be easy.

If you can get to the command prompt (using serial or Ethernet) before it resets, you can skip the button presses and just issue the commands that the button press would've triggered:

  • long press: reset-to-factory-anyway && reboot
  • short press: wifi-reset-and-reboot

Note that the last command, which is executed from a short button press, is the same command that is executed by wifi-live-or-reset if there is no WiFi connection. So, if wifi-live-or-reset is causing your reboot loop, it's unlikely that wifi-reset-and-reboot will fix anything.

I also question whether reset-to-factory-anyway is going to get you anywhere. It's possible that the reason you're rebooting has nothing to do with wifi-live-or-reset, but is due to a mismatch between the kernal and system images. I say this because you've successfully updated the uboot and kernel images, but ran into trouble with the system image. The kernel and system images must be a matched set. The reset-to-ractory-anyway is only going to update your system image, and will not restore the uboot and kernel images. I fear it's not going to help you here.

You really need to get that matching system image loaded through uboot, but I'm sorry I don't have any advice there.

Thanks. Once I did manage to get in via SSH (over ethernet) but /etc was read-only so I couldn't comment out the troublesome parts of /etc/rc.local.

Do all of the "Unknown symbol" messages that I see on bootup mean anything to you?

" ext4: Unknown symbol jbd2_journal_restart (err 0)" (about 40 similar messages follow that)

Hi everyone,

on June 29 I upgraded my Yun (I think from 1.0) to 1.6.2 as described in the upgrade tutorial for the bootloader upgrade.

It took me some attempts till it worked fine. Last time (that worked) was like this:

-After all these commands via the YunSerialTerminal and a ethernet connection to the running TFT server

setenv serverip 192.168.0.231;
setenv ipaddr 192.168.0.146;
tftp 0x80060000 openwrt-ar71xx-generic-linino-u-boot.bin;
erase 0x9f000000 +0x40000;
cp.b $fileaddr 0x9f000000 $filesize;
erase 0x9f040000 +0x10000
tftp 0x80060000 openwrt-ar71xx-generic-yun-kernel.bin;
erase 0x9fEa0000 +0x140000;
cp.b $fileaddr 0x9fea0000 $filesize;
tftp 0x80060000 openwrt-ar71xx-generic-yun-rootfs-squashfs.bin;
erase 0x9f050000 +0xE50000;
cp.b $fileaddr 0x9f050000 $filesize;

I then pulled out the ethernet cable and then continue with

bootm 0x9fea0000

If I did not pull out the ethernet cable first for some reason it did not work at all - I read that someone later plugged out the cable and it worked for him, but for me I had to do that right before the reboot command.

Now I was trying to replicate the proccess elsewhere and I wanted to download the 1.6.2 verision. But it seems to have vanished. Luckily I have the software still. Ok maybe the installation procedure is tricky, but why delete it from this website?

Best Frederick

Hi,
i just bought Yun board, i was unable to select manofacturer (sellers dont know the story behind arduino) so it was a surprise, unfortunately it was arguino.org version with linino.

While i was playing with AWS i decided to upgrade (well not sure now, maybe downgrade) to oficial 1.5.3 firmware on arduino.cc main page (https://www.arduino.cc/en/Main/Software) since AWS readme is based on this version and it worked well.

Now i discovered there is arduino cloud - its very nice idea and i hope it will work finally. Unfortunately i figured there is needed 1.6.2 version which is unable to found (binary) so i can flash it and try.

Can any1 tell me what should i do ?

Wait till arduino merge with arduino.org and all will be better (versions of hw/sw) on one site ?
Get somewhere unoficial binary of 1.6.2 and try ?
Stop to play with arduino cloud till its done, switch with developing to AWS ?

Thanx

Just checked download page and there is 1.6.2 Yun images ready to download, they have changed it yesterday or so, well thanx to "them", im going to try :slight_smile:

corwin32:
Just checked download page and there is 1.6.2 Yun images ready to download, they have changed it yesterday or so, well thanx to "them", im going to try :slight_smile:

Hi, well upgraded using USB storage (logged in web admin, it founds image on USB, flashed correctly (wlan stop flashing) but new image dont working.

Used arduino serial console to look what happen while booting Yun, there is result:

autoboot in 4 seconds (type 'ard' to enter u-boot console)...
## Booting image at 9fea0000 ...
   Image Name:   MIPS OpenWrt Linux-3.18.23
   Created:      2016-05-10   8:20:47 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1207736 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9fea0040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 3.18.23 (admin@compile-01-prod) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r48749) ) #34 Tue May 10 08:20:13 UTC 2016
[    0.000000] bootconsole [early0] enabled

....... truncated

then last message:

[    0.200000] bootconsole [early0] disabled

Since i cant see wlan named arduino in air, im guessing Yun didnt booted correctly.

So i figured out there was new kernel and root fs in zip file (big bin image file for sysupgrade process), old version 1.5.3 has kernel dated 2014 if i remember correctly.

Can anyone help me solve this ? Is image downloaded from arduino.cc official download page broken ? Im doing something bad ? I can try flash root file system but zip file contains only 16M bin file (guess all combined together).

Also readed https://www.arduino.cc/en/Tutorial/YunSysRestore because i flashed 1.5.3 before (i had arduino.org version of board) but i think hardware is new version ? (how to figure this ?). Described bootargs dont work also - its ending with kernel panic (unable to mount root fs).

There is my UBoot - is it actual ? Where i can get newer version ?

U-Boot 1.1.4-dirty (Nov 13 2014 - 18:54:12)

Arduino Yun (ar9331) U-boot

DRAM:  64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 142k for U-Boot at: 83fdc000
Reserving 192k for malloc() at: 83fac000
Reserving 44 Bytes for Board Info at: 83fabfd4
Reserving 36 Bytes for Global Data at: 83fabfb0
Reserving 128k for boot params() at: 83f8bfb0
Stack Pointer at: 83f8bf98
Now running in RAM - U-Boot at: 83fdc000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 MB

thanx

Hi again,
sorry for bothering i figured it out, its working with new linino kernel and linino u-boot (maybe old u-boot from arduino.cc will work also).

So combination of linino u-boot (from arduino.org) with arduino.org linino kernel and arduino.cc yun root-fs 1.6.2 finally working = LOL

I will be really happy if they solve this mess (arduino.cc vs arduino.org) !

Hope this helps somebody with same problem.

I have the same problem and my Yun is bricked like yours.
Please help us