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.