sketch: simple LED blink
2014-07-25 08:11 : wifi OK, uptime=6:59:04.868013, ok/nok: 2310/3
no particular pattern
root@Arduino:/tmp# wifi down && sleep 5 && wifi
Successfully initialized wpa_supplicant
ifconfig wlan0 down; ifconfig wlan0 up
git add . git commit . git push origin master git reset . git rm vi .gitignoreto remove local changes from (uncommitted) file:
git checkout filenamewhen creating a new project on gitHub, get it on PC:
mkdir wifiMonitor cd wifiMonitor/ git init git remote add origin https://github.com/NicoLugil/wifiMonitor git remote -v git fetch origin git merge origin/masterAfter creating gh-pages (project page) using website, get it on local copy:
cd repository git fetch origin # remote: Counting objects: 92, done. # remote: Compressing objects: 100% (63/63), done. # remote: Total 68 (delta 41), reused 0 (delta 0) # Unpacking objects: 100% (68/68), done. # From https://github.com/user/repo.git # * [new branch] gh-pages -> origin/gh-pages git checkout gh-pages # Branch gh-pages set up to track remote branch gh-pages from origin. # Switched to a new branch 'gh-pages'
opkg update opkg install block-mount
cd / mkdir -p /tmp/cproot mount --bind / /tmp/cproot tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf - umount /tmp/cprootedit the file /etc/config/fstab and add:
config mount
option target /
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
That's it. Reboot and the OS should now reside on the SD.
If you still want to access the old filesystem on the flash (this is still used at boot for example) you can do
cd / mkdir original-bootand add
config mount
option target /original-boot
option device /dev/mtdblock3
option fstype jffs2
option options rw,sync
option enabled 1
option enabled_fsck 0
to the /etc/config/fstab file (see also http://forum.arduino.cc/index.php?topic=289215.0) (the one on the SD card)
fdisk /dev/sdadelete my existing partition:
Command (m for help): d Selected partition 1 Partition 1 is deletedcreate the 2 new ones:
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-15523839, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839): +4G
Partition 1 of type Linux and of size 4 GiB is set
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 2):
Using default value 2
First sector (8390656-15523839, default 8390656):
Using default value 8390656
Last sector, +sectors or +size{K,M,G} (8390656-15523839, default 15523839): +3G
Partition 2 of type Linux and of size 3 GiB is set
save:
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.reboot:
rebootformat the new paritions:
opkg update opkg install mtd-utils opkg install e2fsprogs mkfs.ext4 -L YunSD1 /dev/sda1 mkfs.ext4 -L YunSD2 /dev/sda2
update: when I tried this again in 2015, I had to do:
umount /dev/sda1
umount /dev/sda2
prior to the mkfs commands
opkg list-installedNext I formatted my SD card(not needed, but I want a clean start). First I did this on my Ubuntu PC but this gave issues with user groups and permissions. So I did the formatting on my Yun directly:
df umount /mnt/sda1 mkfs.ext4 -L YunSD /dev/sda1note the /dev/sda1 iso /mnt/sda1 for the mkfs command.
mkdir /mnt/sda1/arduino
run-sysupgrade /mnt/sda1/openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.binresult is (nothing needs to be done when it looks like there is a prompt with the Writing from ...:
Sending TERM to remaining processes ... uhttpd dbus-daemon dnsmasq thd ntpd uSDaemon sftp-server sleep syslogd klogd hotplug2 procd ubusd netifd Sending KILL to remaining processes ... Switching to ramdisk... Performing system upgrade... Unlocking firmware ... Writing fromRebooting didnt seem to happen automatically. Power cycled and after a while I saw the USB led on, a sign of the new image. The Yun is completely fresh, so you need to start all over, connecting to the Yun wireless network, enter default password arduino, etc...to firmware ... Upgrade completed Rebooting system...