{"componentChunkName":"component---src-templates-page-js","path":"/notes/upgrading-openwrt-on-an-arduino-yun-without-a-microsd-card/","result":{"data":{"markdownRemark":{"html":"<p>An entire fantasy football season has passed since finishing the <a href=\"/notes/making-the-worlds-first-internet-enabled-fantasy-football-trophy-part-2-programming/\">Trophy of the Future</a>, my “world’s first internet-connected fantasy football trophy,” and my league has a new champion. That means it’s time to revisit the project to tie up some loose ends! More on that will come in time, but first I want to share the solution to the initial problem I encountered.</p>\n<p>I wanted to upgrade the Yun to the latest version of <a href=\"https://openwrt.org/\">OpenWrt</a> because opkg was throwing weird “failed to download” errors. From scanning the Arduino forums, it seemed like updating OpenWrt was the recommended first step (and as it turns out, the update also <a href=\"http://blog.arduino.cc/2014/04/23/upgrading-the-openwrt-yun-image-on-the-yun/\">fixes Heartbleed</a>, so it’s worth doing anyway). The instructions assume you have a MicroSD mounted in your Yun, which I don’t, but it is still possible to do the upgrade without one.</p>\n<p>The OpenWrt image clocks in at 16 MB, and by running <code>df -h</code> I saw that the Yun’s onboard memory had around 20 MB free in the <code>/tmp</code> directory. I downloaded the <a href=\"http://arduino.cc/en/Main/Software#toc8\">latest Yun image from the Arduino website</a> and unzipped it on my Mac, then used <code>scp</code> to move the file to the Yun:</p>\n<pre><code class=\"hljs language-sh\">scp openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin root@arduino.local:/tmp/</code></pre>\n<p>According to <a href=\"http://arduino.cc/en/Tutorial/YunSysupgrade\">Arduino’s upgrade guide</a>, the next step would be to run <code>run-sysupgrade</code> on the OpenWrt image, but a second problem surfaces here. It turns out that the first thing <code>run-sysupgrade</code> does is copy the image to <code>/tmp</code>, which errors because the file already exists. I could move the file to a subdirectory so <code>run-sysupgrade</code> could copy it back, but the Yun’s onboard memory doesn’t have enough space for that.</p>\n<p>The solution here, noted on <a href=\"http://wiki.openwrt.org/doc/howto/generic.sysupgrade\">OpenWrt’s system upgrade page</a>, is to use <code>sysupgrade</code> – note the lack of <code>run-</code> in that command’s name. Like this:</p>\n<pre><code class=\"hljs language-sh\">sysupgrade /tmp/openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin</code></pre>\n<p>Three minutes later, you have upgraded OpenWrt on your Arduino Yun! All the configurations should be the same, but you will have to reinstall any opkg packages.</p>","frontmatter":{"path":"/notes/upgrading-openwrt-on-an-arduino-yun-without-a-microsd-card/","title":"Upgrading OpenWrt on an Arduino Yun without a MicroSD card","date":"2014-12-27T01:25:19.000Z","categories":["Arduino","OpenWrt","Trophy of the Future"],"churl":null,"uses":null}}},"pageContext":{"post":true,"prev":{"url":"/notes/sharing-our-videos-forever/","title":"Sharing our videos, forever"},"next":{"url":"/notes/smog-usa/","title":"SMOG USA"}}}}