Go Down

Topic: upgrade firmware openwrt arduino yun rev2 (Read 944 times) previous topic - next topic

cardeto1963

is there the possibility of being able to change the firmware of the arduino yun rev 2?

JustVince

#1
Apr 28, 2019, 07:31 pm Last Edit: Apr 28, 2019, 07:41 pm by JustVince
Hello,
I have a lot of things to say about the Yun rev 2.
And this is part of it. I will take advantage of this post.
First of all, for any readers and to answer your question afterwards,
I imagine that you have already searched the forum before opening this post and I therefore assume that your post is the most recent on this topic.
I also consider that, like me, you followed very carefully the instructions given on this page:
Quote
https://www.arduino.cc/en/Tutorial/YunSysupgrade
A link will take you to the download page of "Arduino Yun Linux openWrt 1.5.3 UpGrade image".

In theory, and for the "Yun rev 1", you download the binary:
Quote
openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin
that you put directly to the root of the SD card.

The following is clearly explained in the page cited above.

By cons, I read correctly, the subject is the "Yun rev 2" and there arduino site does not offer a different binary ?! nor does it mention otherwise to its use on a rev 2 which is already ambiguous.
A clarification between Linino and OpenWrt would be welcome for users.

But since Rev 2 comes with OpenWrt / LEDE 17.x.x, it seems more consistent to use the Table of Hardware on the OpenWrt website:
Quote
https://openwrt.org/toh/views/toh_fwdownload
Thus, the filter proposes us for the Yun
Quote
without specifying the revision ???
to download version
Quote
18.06.2
.

Incidentally, I recommend "strongly" to download the YunSerialTerminal in the arduino, before any operation! And display it in the foreground to monitor boot messages!

The firmware programming went well.
Unfortunately, this version does not work with the sketch "Yun Serial Terminal" and the boot is therefore silent.
Quote
https://www.arduino.cc/en/Tutorial/YunSerialTerminal
So back to square one.
Good player, I still tried to install the
Quote
image 1.5.3
proposed on the arduino site.
The installation went well, but the card refuses to update!

Code: [Select]
opkg update
Downloading http://downloads.arduino.cc/openwrtyun/1/packages/Packages.gz.
Downloading http://downloads.arduino.cc/openwrtyun/1/packages/Packages.sig.
Signature check failed.
Remove wrong Signature file.
Collected errors:
 * opkg_download: Failed to download http://downloads.arduino.cc/openwrtyun/1/packages/Packages.gz: Error.
 * opkg_download: Failed to download http://downloads.arduino.cc/openwrtyun/1/packages/Packages.sig: Error.


Not wishing to debug an old version, so I undertook to reinstall a version close to that delivered on the map (17 then 18 without success!)

Result via the web interface:

Code: [Select]
Failed to execute call dispatcher target for entry '/webpanel/reset_board'.
The called action terminated with an exception:
bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
 [C]: in function 'assert'
 ?: in function 'dispatch'
 ?: in function <?:194>


Result via the terminal (putty):

Code: [Select]

run-sysupgrade /mnt/sda1/lede-17.01.6-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin
The first try did not work, but the second yes ???
Sending TERM to remaining processes ... sleep uhttpd dbus-daemon dnsmasq avahi-daemon thd ntpd uSDaemon rcS logger syslogd klogd hotplug2 ubusd netifd
Sending KILL to remaining processes ... uhttpd
Switching to ramdisk...
Performing system upgrade...
Unlocking firmware ...
Writing from <stdin> to firmware ...
Upgrade completed
Rebooting system...


And here I am with version LEDE 17.01.6 and the Yun Serial Terminal which works again!
but on the other hand: "opkg update" fails

Code: [Select]
opkg update
Downloading http://downloads.lede-project.org/releases/17.01.6/targets/ar71xx/generic/packages/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01.6/targets/ar71xx/generic/packages/Packages.gz
Blablabla….
Collected errors:
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01.6/targets/ar71xx/generic/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01.6/packages/mips_24kc/base/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.


Moreover, the command
Quote
run-sysupgrade
is not recognized and the assembly of SDA1 is not automatic
=> I go through the WEB interface, make a prayer, and especially touch nothing!

desperately white page ###!? $ #
no LED flashing... nothing!

Fortunately on the second try:
It's gone and a message appears on the web interface warning not to cut off the power,
the LED flashing for a moment until the Luci home page is refreshed: phew!

but ping always fails  :'(
so no opkg update/install is possible!

So finally I advise against doing a firmware update!
And for me the first question would be:
Quote
where can we find the firmware that came with the Yun rev2
See also this post:
Quote
http://forum.arduino.cc/index.php?topic=568502.0
Arduino Yun Rev. 2 - Firmware file and package list
Thanks for your feedbacks!

JustVince

I also tried YunUpdater
Quote
https://www.arduino.cc/en/Guide/YunUpdater
But the project seems to be dead
Quote
https://forum.arduino.cc/index.php?topic=515869.15
I got through the hardware of the rev2 update (power supply pin changed) but the software is a nightmare
for me while version 1 worked very well!

thanks for the replies.

ShapeShifter

Let me start that while I have experience with the original Yun, I have no personal experience with the Yun Rev 2.

I also consider that, like me, you followed very carefully the instructions given on this page:
A link will take you to the download page of "Arduino Yun Linux openWrt 1.5.3 UpGrade image".
This is an older page, and I think it is only intended for the original Yun. The page was created before the introduction of the Yun Rev 2, and I would guess that is why there is no mention of Rev 2 on that page.

I do not believe that this revision 1.5.3 is intended for the Rev 2, and you may have issues if you try to install it on a Rev 2. At least, I recall seeing posts from people who did run into problems doing so.

Quote
By cons, I read correctly, the subject is the "Yun rev 2" and there arduino site does not offer a different binary ?! nor does it mention otherwise to its use on a rev 2 which is already ambiguous.
I agree, there appears to be a decided lack of documentation that is specific to the Yun Rev 2. While it is clear to me that there are some potentially significant differences, I don't see any documentation that outlines those differences.

Quote
But since Rev 2 comes with OpenWrt / LEDE 17.x.x, it seems more consistent to use the Table of Hardware on the OpenWrt website:
I wouldn't necessarily recommend that. There is much more to the Yun's Linux side than a generic OpenWRT image. There are some significant additions to OpenWRT to allow it to integrate with the Arduino side of the Yun. Using a generic OpenWRT build, you are going to lose:
  • The initial configuration page when you use a web browser to access your Yun (includes the network setup and load sketch functions)
  • The ability to load sketches over the network (this requires the software to communicate with the IDE, plus a copy of the bootloader stored on the Linux side, and the scripts to combine the downloaded sketch with the bootloader, and program it onto the '32U4 processor.)
  • All of the Linux side software to manage Bridge communications (Bridge get/put, Process class, FileIO class, etc.)
  • All of the custom configuration to manage web access (REST API, remote Bridge get/put, simple web page serving from the SD card, etc.)
  • Management of the "WLAN RST" button (short press for network reset, long press for return to defaults)
  • And probably much more that, which I'm not thinking of at the moment

In other words, while a Yun can act as a wireless router, and a generic OpenWRT build will still allow it to run as a wireless router, using a generic build will prevent use of the Yun as a Yun - a Linux processor combined with an Arduino processor with the software to make them interact as a unified system.

Quote
Incidentally, I recommend "strongly" to download the YunSerialTerminal in the arduino, before any operation! And display it in the foreground to monitor boot messages!
I complete agree!

Quote
Unfortunately, this version does not work with the sketch "Yun Serial Terminal" and the boot is therefore silent.
It could be some difference in the configuration of the UART, my guess is that the baud rate is different. Whatever the difference, it's clearly one of the differences between the original Yun build of OpenWRT and the generic build.

Code: [Select]
Signature check failed.
Remove wrong Signature file.

Do you have the date/time on the Yun set correctly? Strange as it may seem (especially given the error message) having the date/time wrong can cause this error.

JustVince

#4
Apr 30, 2019, 01:08 am Last Edit: Apr 30, 2019, 11:14 am by JustVince
Thank you for your reply ShapeShifter.

yes the date seems correct:
Code: [Select]
root@LEDE:Date
Mon Apr 29 23:50:21 CEST 2019

and I access the internet.
Code: [Select]
root@LEDE:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=121 time=26.069 ms
64 bytes from 8.8.8.8: seq=1 ttl=121 time=25.629 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 25.629/25.849/26.069 ms

However, I no longer have access to the web page!
Code: [Select]

No page is registered at '/webpanel/homepage'.
If this url belongs to an extension, make sure it is properly installed.
If the extension was recently installed, try removing the /tmp/luci-indexcache file.

I copied and deleted the file, but without success!

Yet I had installed from the OpenWrt site a version "Yun" but rev : unknow
Quote
lede-17.01.6-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin
So I do not have:
  • nor web interface
  • no possibility to update
  • nor even access to the SD card.(see attachment)


I add that I tried to reinitialize the distribution OpenWrt-Yun to its out of the box state by pressing more than 30 seconds on the button "Yun-RST": without success since apparently this action does nothing on LEDE-17.01.6 or brings the state to the last flashed image ie 17.01.6.
And... effectively this is the last flashed image that reappears ...

so if we see the good side of things, I still have the terminal (on br-lan not eth1???) ( and the YunSerialTerminal (from Arduino Side)
Code: [Select]

root@LEDE:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr A8:40:41:19:D0:F0
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::aa40:41ff:fe19:d0f0/64 Scope:Link
          inet6 addr: fdec:32fb:5e99::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2681 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:560622 (547.4 KiB)  TX bytes:564747 (551.5 KiB)

eth1      Link encap:Ethernet  HWaddr A8:40:41:19:D0:F0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2676 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:621798 (607.2 KiB)  TX bytes:564181 (550.9 KiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1124 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:73508 (71.7 KiB)  TX bytes:73508 (71.7 KiB)


I think the game is over!

cardeto1963

I would like to thank
For the very welcome interventions.
Just that with the old firmware I had no problems I have with this one among many if I want to see the port 8081 live stream Motion I can not see it, I think maybe
That the motion version is perhaps different from the one always used.

cardeto1963


If I open port 8080 or any other port with arduino yun rev 2, I get this message from the system log "daemon.err uhttpd [1281]: ls: /mnt/sda1/*squashfs-sysupgrade.bin: No such file or directory".
While if I open from a dragun yun card with the old firmaware I see "
  • [NTC] [STR] httpd_run: motion-httpd - Read from client".

 I propose that I am at the first experiences with linux openWRT.





cardeto1963

sorry I was referring to the Motion application.

JustVince

To return to my previous experiences, the tutorial found on the web page of arduino is not wrong but the files are not found on their site:

https://www.arduino.cc/en/Tutorial/YunSysupgrade

We retain in passing only the useful command:
Code: [Select]

run-sysupgrade openwrt-ar71xx-generic-yun-squashfs-sysupgrade.bin


However this page directs us to another much more interesting:

https://www.arduino.cc/en/Guide/YunUpdater

This page promises us a simplified update of our Yun card thanks to the utility "Yun-Go-Updater" supposed to update us both the bootloader and the operating system "LEDE".
Unfortunately, the target Yun Revision 1 or 2 is still not specified, the window closes under my Windows 10 and therefore the operation fails!
Finally, as we will see later it is also not the latest version! it's a lot!
We must therefore do a new search on the internet to find the source of the Yun-Go-Updater:

https://github.com/arduino/yun-go-updater/tree/e08991f90d46951f87d93cbd69ff93f7032a888b

An analysis of the files at the root (written in Go ...) allows us to discover the operations supposed to be carried out by this utility:

Code: [Select]

 // flash new bootloader
 res, err = exp.ExpectBatch([]expect.Batcher{
 &expect.BSnd{S: "printenv ipaddr\n"},
 &expect.BExp{R: fwShell + ">"},
 &expect.BSnd{S: "tftp 0x80060000 " + ctx.bootloaderFirmware.name + "\n"},
 &expect.BExp{R: "Bytes transferred = " + strconv.FormatInt(ctx.bootloaderFirmware.size, 10)},
 &expect.BSnd{S: "erase 0x9f000000 +0x40000\n"},
 &expect.BExp{R: "Erased 4 sectors"},
 &expect.BSnd{S: "cp.b $fileaddr 0x9f000000 $filesize\n"},
 &expect.BExp{R: "done"},
 &expect.BSnd{S: "erase 0x9f040000 +0x10000\n"},
 &expect.BExp{R: "Erased 1 sectors"},
 &expect.BSnd{S: "reset\n"},
 }, time.Duration(30)*time.Second)


Some researches later, we notice that the instructions are in fact a concrete application of this tutorial reserved for the so-called experienced users:
https://www.arduino.cc/en/Tutorial/YunUBootReflash

Unfortunately, again, variables "$fileaddr" and "$filesize" seem to have to be set manually !!!!
And no trace of the kernel.
What inspires me a new question:
What should we update and why?

Bootlader ?
kernel ?
linux OpenWrt ?

And finally, we have a manual procedure but with some holes:

  • Yun Settup
      Ethernet cable
      YunSerialTerminal.ico downloaded int the ATMega
      https://www.arduino.cc/en/Tutorial/YunSerialTerminal

  • A TFTP server listening on the PC and pointing on the Yun-Go-Update/tftp directory with up to date files:
      http://sourceforge.net/projects/tftputil/

  • The up to date bootloader from the yun-go-updater : "u-boot-arduino-lede.bin"

  • The key to enter the U-Boot prompt when asked which is 'ard'

  • The instructions to flash the bootlader from the YunSerialTerminal console on Serial1
    (Bootlader using ttyATH0 at boot step)
       setenv serverip 192.168.0.231 // Your TFTP server IP
       setenv ipaddr 192.168.0.146 // Yun IP
       tftp 0x80060000 u-boot-arduino-lede.bin
       erase 0x9f000000 +0x40000
       cp.b $fileaddr 0x9f000000 $filesize
       erase 0x9f040000 +0x10000
       reset

    But $filesize is still unknown

  • "openwrt-ar71xx-generic-yun-kernel.bin" Kernel is not present:
      tftp 0x80060000 openwrt-ar71xx-generic-yun-kernel.bin
      erase 0x9fEa0000 +0x140000
      cp.b $fileaddr 0x9fea0000 $filesize

  • OS OpenWrt-Yun is also available in the  « Yun-Go-Updater » directory:
    « ledeyun-17.11-r6773+1-8dd3a6e-ar71xx-generic-arduino-yun-squashfs-sysupgrade.bin »
      tftp 0x80060000 ledeyun-17.11-r6773+1-8dd3a6e-ar71xx-generic-arduino-yun-squashfs-sysupgrade.bin
      erase 0x9f050000 +0xE50000
      cp.b $fileaddr 0x9f050000 $filesize

    but maybe it is better to use this command, we do not know:
      run-sysupgrade ledeyun-17.11-r6773+1-8dd3a6e-ar71xx-generic-arduino-yun-squashfs-sysupgrade.bin

  • and finally
      bootm 0x9fea0000



I admit, all these operations seem very risky and I have to find a way to calculate the size of the file before I start ...

@facchinm help !!! :smiley-sad-blue:

ShapeShifter

What inspires me a new question:
What should we update and why?
My personal opinion is don't upgrade anything unless you know it works for your revision of the board, and unless you really need the new version and aren't afraid to brick your board.

For me, with my original aurduino.cc boards,they work, and I see no reason to mess with it. I've seen too many stories of boards that don't boot after an upgrade.

On the other hand, if you ware willing to risk your board experiment for the sake of the community and to improve the documentation (like you did with the hardware differences report) then go for it (at your own risk, of course!)

cardeto1963

I agree with what you say.
 I only know for example that with the first Yun I used Motion to see the webcam port 8081 and server uhttpd. While now and I scan the doors with which UHTTPD is working I see the usual ports but the 8081 8080 etc non-existent.
 What can it depend on? Is the Motion package that's not good?
Sorry but they are at the earliest experiences.

Go Up