Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| toh:arduino.cc:yun [2018/09/09 17:51] – OpenWrt spelling tmomas | toh:arduino.cc:yun [2023/02/23 01:01] – [Flashing the Bootloader and OpenWRT Firmware] derrypratama | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| Via [[http:// | Via [[http:// | ||
| + | |||
| + | ===== Flashing The Latest OpenWRT ===== | ||
| + | |||
| + | By the time I am writing this, this might be the first article that tells you how to install OpenWRT on Arduino Yun because no one talks about it. Also, Arduino Yun is already reached its end of life, and the version history is not well documented in each article so I will write it as clearly as I can. Here I am using the old Arduino Yun. It comes with the 1.1.4 version of the bootloader. | ||
| + | |||
| + | Now to update it to the latest OpenWRT what we will need to do is: | ||
| + | - Update the bootloader to 1.1.5 because 1.1.4 does not support bigger kernel upload by default | ||
| + | - Flash the firmware from the latest build of OpenWRT | ||
| + | |||
| + | ==== Prerequisites ==== | ||
| + | |||
| + | - Arduino Yun v1 (rev 2 is also compatible but haven' | ||
| + | - Linux PC (Windows or Mac is also compatible but not covered here) | ||
| + | - LAN and MicroUSB cable | ||
| + | - Access Point with Internet Connection | ||
| + | ==== Board Development History ==== | ||
| + | |||
| + | The old version of Yun is able to use the latest OpenWRT. The 1.1.5 bootloader is also available for rev. 2 so I think the Yun rev. 2 is also able to boot the latest OpenWRT. No need to be afraid of bricking, if you still have the bootloader, everything can be reflashed. [[https:// | ||
| + | |||
| + | ==== Bootloader Mode ==== | ||
| + | |||
| + | Connect Yun LAN and Micro USB to your PC. Open Arduino IDE, and download the bridge library. Select menu Sketch > Include Library > Manage Libraries ... Search bridge on library manager and install | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Open YunSerialTerminal sketch by selecting File > Example > Bridge > YunSerialTerminal. Upload YunSerialTerminal; | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Reset Yun by pressing a white button near the LEDs. Go to boot mode quickly, and send lin (or depending on the message, some bootloaders need ard, some only need to press any character) command into the serial monitor until the bootloader command prompt is shown below | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Setting TFTP Server ==== | ||
| + | Now let's set up the host. Make sure your PC IP connected to Yun is 192.168.1.2 with gateway 192.168.1.1. You can use any IP here, but if you want to follow me just use the same IP as my configuration. Below is my PC IP, 192.168.1.2 | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Install tftp server | ||
| + | |||
| + | '' | ||
| + | |||
| + | In my Linux OS, after installing, check the tftp folder | ||
| + | |||
| + | < | ||
| + | # / | ||
| + | |||
| + | TFTP_USERNAME=" | ||
| + | TFTP_DIRECTORY="/ | ||
| + | TFTP_ADDRESS=": | ||
| + | TFTP_OPTIONS=" | ||
| + | |||
| + | in my case it is ''/ | ||
| + | |||
| + | Now download this [[https:// | ||
| + | |||
| + | '' | ||
| + | |||
| + | And move it to the ''/ | ||
| + | |||
| + | '' | ||
| + | |||
| + | Then get the latest OpenWRT firmware [[https:// | ||
| + | |||
| + | By the time I am writing this, it is 22.03.3 | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Put the firmware also in tftp folder | ||
| + | |||
| + | '' | ||
| + | |||
| + | So now the ''/ | ||
| + | |||
| + | ==== Flashing the Bootloader and OpenWRT Firmware ==== | ||
| + | |||
| + | After everything is set up then send these commands in Yun serial monitor: | ||
| + | < | ||
| + | linino> setenv serverip 192.168.1.2; | ||
| + | |||
| + | linino> setenv ipaddr 192.168.1.1; | ||
| + | </ | ||
| + | The Yun is set to 192.168.1.1 and our PC is 192.168.1.2 | ||
| + | |||
| + | Send the bootloader to Yun | ||
| + | |||
| + | '' | ||
| + | |||
| + | Then erase the old bootloader and replace using these commands. | ||
| + | < | ||
| + | erase 0x9f000000 +0x40000; | ||
| + | cp.b $fileaddr 0x9f000000 $filesize; | ||
| + | erase 0x9f040000 +0x10000 | ||
| + | </ | ||
| + | Below is the output | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Then we can send the OpenWRT firmware to Yun, erase the previous firmware, and write the OpenWRT | ||
| + | < | ||
| + | tftp 0x80060000 openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin; | ||
| + | erase 0x9f050000 +0xE50000; | ||
| + | cp.b $fileaddr 0x9f050000 $filesize; | ||
| + | </ | ||
| + | Below is the output | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Now reset by pressing the white Yun reset button near the LEDs. Now we can see the new bootloader and running the latest and the most bleeding edge OpenWRT | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Press Enter again in the serial monitor to activate the console | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Now we have the latest OpenWRT installed on Arduino Yun! By default, the wifi is turned off. To access the Yun, run this command to set the Yun IP. | ||
| + | |||
| + | '' | ||
| + | |||
| + | Once the IP is set, you can access the OpenWRT web interface on the browser by visiting 192.168.1.1 | ||
| + | |||
| + | Connect to your Wifi access point and run opkg update to update the package list. | ||
| + | |||
| + | ==== Expand the Yun Storage ==== | ||
| + | |||
| + | There are so many packages that you can install but the Yun memory is too small. However, we can expand the storage using [[: | ||
| + | |||
| + | The [[https:// | ||
| ===== Linino Build Instructions ===== | ===== Linino Build Instructions ===== | ||