Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:arduino.cc:yun [2023/02/22 14:35] – [Bootloader Mode] derrypratamatoh:arduino.cc:yun [2023/02/23 01:01] – [Flashing the Bootloader and OpenWRT Firmware] derrypratama
Line 36: Line 36:
  
 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 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
 +
 {{:media:arduino-bridge-library.png|}} {{:media:arduino-bridge-library.png|}}
  
 Open YunSerialTerminal sketch by selecting File > Example > Bridge > YunSerialTerminal. Upload YunSerialTerminal; open the serial monitor and set the baud rate to 115200. Press enter and a terminal will show up: Open YunSerialTerminal sketch by selecting File > Example > Bridge > YunSerialTerminal. Upload YunSerialTerminal; open the serial monitor and set the baud rate to 115200. Press enter and a terminal will show up:
 +
 {{:media:arduino-serial-openwrt-terminal.png|}} {{:media:arduino-serial-openwrt-terminal.png|}}
  
Line 48: Line 50:
 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 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
  
-{{:media:yun-host-ip.png?400|}}+{{:media:yun-host-ip.png|}}
  
 Install tftp server Install tftp server
  
-sudo apt-get install tftpd-hpa+''sudo apt-get install tftpd-hpa''
  
 In my Linux OS, after installing, check the tftp folder In my Linux OS, after installing, check the tftp folder
  
-$ cat /etc/default/tftpd-hpa+<code>$ cat /etc/default/tftpd-hpa
 # /etc/default/tftpd-hpa # /etc/default/tftpd-hpa
  
Line 62: Line 64:
 TFTP_DIRECTORY="/srv/tftp" TFTP_DIRECTORY="/srv/tftp"
 TFTP_ADDRESS=":69" TFTP_ADDRESS=":69"
-TFTP_OPTIONS="--secure"+TFTP_OPTIONS="--secure"</code>
  
-in my case it is /srv/tftp+in my case it is ''/srv/tftp''
  
-Now download this Yun-Go-Updater, and extract the bootloader file only:+Now download this [[https://github.com/arduino/yun-go-updater/releases/download/1.2/yun-go-updater-linux64.tar.gz|Yun-Go-Updater]], and extract the bootloader file only:
  
-u-boot-arduino-lede.bin+''u-boot-arduino-lede.bin''
  
-And move it to the /srv/tftp directory+And move it to the ''/srv/tftp'' directory
  
-$ mv u-boot-arduino-lede.bin /srv/tftp+''$ mv u-boot-arduino-lede.bin /srv/tftp''
  
 Then get the latest OpenWRT firmware [[https://firmware-selector.openwrt.org/?version=22.03.3&target=ath79%2Fgeneric&id=arduino_yun|here]] Then get the latest OpenWRT firmware [[https://firmware-selector.openwrt.org/?version=22.03.3&target=ath79%2Fgeneric&id=arduino_yun|here]]
Line 78: Line 80:
 By the time I am writing this, it is 22.03.3 By the time I am writing this, it is 22.03.3
  
-{{:media:download-latest-openwrt.png?400|}}+{{:media:download-latest-openwrt.png?800|}}
  
 Put the firmware also in tftp folder Put the firmware also in tftp folder
  
-openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin+''openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin''
  
-So now the /srv/tftp contains our bootloader and OpenWRT firmware.+So now the ''/srv/tftp'' contains our bootloader and OpenWRT firmware.
  
 ==== Flashing the Bootloader and OpenWRT Firmware ==== ==== Flashing the Bootloader and OpenWRT Firmware ====
  
 After everything is set up then send these commands in Yun serial monitor: After everything is set up then send these commands in Yun serial monitor:
 +<code>
 linino> setenv serverip 192.168.1.2; linino> setenv serverip 192.168.1.2;
  
 linino> setenv ipaddr 192.168.1.1; linino> setenv ipaddr 192.168.1.1;
 +</code>
 The Yun is set to 192.168.1.1 and our PC is 192.168.1.2 The Yun is set to 192.168.1.1 and our PC is 192.168.1.2
  
 Send the bootloader to Yun Send the bootloader to Yun
  
-tftp 0x80060000 u-boot-arduino-lede.bin+''tftp 0x80060000 u-boot-arduino-lede.bin''
  
 Then erase the old bootloader and replace using these commands. Then erase the old bootloader and replace using these commands.
 +<code>
 erase 0x9f000000 +0x40000; erase 0x9f000000 +0x40000;
 cp.b $fileaddr 0x9f000000 $filesize; cp.b $fileaddr 0x9f000000 $filesize;
 erase 0x9f040000 +0x10000 erase 0x9f040000 +0x10000
 +</code>
 Below is the output Below is the output
  
-{{:media:flashing-bootloader-yun.png?400|}}+{{:media:flashing-bootloader-yun.png|}}
  
 Then we can send the OpenWRT firmware to Yun, erase the previous firmware, and write the OpenWRT Then we can send the OpenWRT firmware to Yun, erase the previous firmware, and write the OpenWRT
 +<code>
 tftp 0x80060000 openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin; tftp 0x80060000 openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin;
- 
 erase 0x9f050000 +0xE50000; erase 0x9f050000 +0xE50000;
 cp.b $fileaddr 0x9f050000 $filesize; cp.b $fileaddr 0x9f050000 $filesize;
 +</code>
 Below is the output Below is the output
  
-{{:media:flashing-openwrt-yun.png?400|}}+{{:media:flashing-openwrt-yun.png|}}
  
 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 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
  
-{{:media:latest-openwrt-installed-yun.png?400|}}+{{:media:latest-openwrt-installed-yun.png|}}
  
 Press Enter again in the serial monitor to activate the console Press Enter again in the serial monitor to activate the console
  
-{{:media:yun-openwrt-new-console.png?400|}}+{{:media:yun-openwrt-new-console.png|}}
  
 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. 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.
  
-ifconfig eth0 192.168.1.1+''ifconfig eth0 192.168.1.1''
  
 Once the IP is set, you can access the OpenWRT web interface on the browser by visiting 192.168.1.1 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. Connect to your Wifi access point and run opkg update to update the package list.
- 
-{{:media:yun-expanded-storage.png?400|}} 
  
 ==== Expand the Yun Storage ==== ==== Expand the Yun Storage ====
  • Last modified: 2023/02/23 01:02
  • by derrypratama