New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot flash R6220 #4

Closed
emersion opened this Issue Mar 18, 2017 · 16 comments

Comments

2 participants
@emersion
Copy link

emersion commented Mar 18, 2017

It has been reported to work in the past (#3), but it doesn't with my router.

sudo ./nmrpflash -vvv -i enp0s25 -f ../R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img
Adding 10.164.183.253 to interface enp0s25.
Advertising NMRP server on enp0s25 ... -
Received configuration request from 40:5d:82:dd:61:60.
Sending configuration: 10.164.183.252, netmask 255.255.255.0.
Received upload request with empty filename.
Using remote filename '../R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img'.
Uploading R6220_V1.1.0.34_1.0.1.img ... << WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
Timeout while waiting for ACK(0)/OACK.

Am I doing something wrong?

@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

How did you connect the router to the device running nmrpflash?

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Via ethernet. Tried both:

  • Directly to one of the router's LAN port
  • Using another router between R6220 and my computer

Same result for these two configurations.

@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Please try using the -a option to manually assign an ip address from the same subnet as enp0s25. Did you build nmrpflash youself, from the current master branch?

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Tried with -a:

sudo ./nmrpflash -vvv -i enp0s25 -a 192.168.1.201 -f ../R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img 
Advertising NMRP server on enp0s25 ... /
Received configuration request from 40:5d:82:dd:61:60.
Sending configuration: 192.168.1.201, netmask 255.255.255.0.
Received upload request with empty filename.
Using remote filename '../R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img'.
Uploading R6220_V1.1.0.34_1.0.1.img ... << WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
<< WRQ(R6220_V1.1.0.34_1.0.1.img, octet)
Timeout while waiting for ACK(0)/OACK.
@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Tried to build from source, same result.

@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Strange... please try -F firmware.

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Nothing changed :(

sudo ./nmrpflash -vvv -i enp0s25 -a 192.168.1.201 -F firmware -f ~/Downloads/R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img  
Advertising NMRP server on enp0s25 ... \
Received configuration request from 40:5d:82:dd:61:60.
Sending configuration: 192.168.1.201, netmask 255.255.255.0.
Using remote filename 'firmware'.
Uploading R6220_V1.1.0.34_1.0.1.img ... << WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
Timeout while waiting for ACK(0)/OACK.
@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

What's the output of ifconfig enp0s25?

@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Judging from the logs that @hqqv posted, he used -a 192.168.1.1. Try that, in case this ip is hardcoded into the bootloader.

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Argh, still failing...

Output of ip {addr,link,route} is below too.

simon@kurisu ~/p/nmrpflash (master)> sudo ./nmrpflash -vvv -i enp0s25 -a 192.168.1.1 -F firmware -f ~/Downloads/R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img  
Advertising NMRP server on enp0s25 ... |
Received configuration request from 40:5d:82:dd:61:60.
Sending configuration: 192.168.1.1, netmask 255.255.255.0.
Using remote filename 'firmware'.
Uploading R6220_V1.1.0.34_1.0.1.img ... << WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
Timeout while waiting for ACK(0)/OACK.
simon@kurisu ~/p/nmrpflash (master) [255]> ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:21:cc:c5:16:5a brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 2e:92:f8:99:51:8c brd ff:ff:ff:ff:ff:ff
simon@kurisu ~/p/nmrpflash (master)> ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:21:cc:c5:16:5a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global enp0s25
       valid_lft forever preferred_lft forever
    inet6 fe80::bb99:9a4:126a:5c72/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 2e:92:f8:99:51:8c brd ff:ff:ff:ff:ff:ff
simon@kurisu ~/p/nmrpflash (master)> ip route
default via 192.168.1.1 dev enp0s25 proto static metric 100 
192.168.1.0/24 dev enp0s25 proto kernel scope link src 192.168.1.2 metric 100
@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Please generate a packet dump of the whole transaction using tcpdump -i enp0s25 -w nmrp.pcap, and send me the resulting nmrp.pcap file.

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Here is another one captured with -m:

https://fs.emersion.fr/protected/misc/nmrp-mac.pcap

sudo ./nmrpflash -vvv -i enp0s25 -a 192.168.1.1 -m 40:5d:82:dd:61:60 -F firmware -f ~/Downloads/R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img  
Advertising NMRP server on enp0s25 ... /
Received configuration request from 40:5d:82:dd:61:60.
Sending configuration: 192.168.1.1, netmask 255.255.255.0.
Using remote filename 'firmware'.
Uploading R6220_V1.1.0.34_1.0.1.img ... << WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
<< WRQ(firmware, octet)
Timeout while waiting for ACK(0)/OACK.
@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Does anything change if you run arp -s 192.168.1.1 40:5d:82:dd:61:60 before running nmrpflash?

@emersion

This comment has been minimized.

Copy link

emersion commented Mar 18, 2017

Okay, that fixed it! Commands I used:

systemctl stop NetworkManager
ip addr add 192.168.1.2/24 dev enp0s25
ip route add 192.168.1.1 dev enp0s25
ip link set enp0s25 up
arp -s 192.168.1.1 40:5d:82:dd:61:60
./nmrpflash -vvv -i enp0s25 -a 192.168.1.1 -m 40:5d:82:dd:61:60 -F firmware -f ~/Downloads/R6220_FW_V1.1.0.34_1.0.1/R6220_V1.1.0.34_1.0.1.img

Thanks a lot, you saved my day! :D

@emersion emersion closed this Mar 18, 2017

@jclehner

This comment has been minimized.

Copy link
Owner

jclehner commented Mar 18, 2017

Thanks for reporting this, will fix this issue in the next release.

jclehner added a commit that referenced this issue Apr 2, 2017

jclehner added a commit that referenced this issue Apr 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment