What's new

Asus-Merlin 384.15: amtm won't run, just hangs

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I just SSHed to my real router and got the file. So somehow double NAT is the problem
Try placing the 2nd router in the DMZ or port forwarding selected ports to the 2nd router to see if that helps (WAN tab).
 
4241 admin 3368 S {amtm} /bin/sh /usr/sbin/amtm
4270 admin 4676 S /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://fwupdate.asuswrt-merlin.net/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new

I took all the steps mentioned above, including sh -x and looking at the output. It does appear to be in a loop. My ASUS router is direct connected to the Internet through my ISP (I don't use an ISP router at all). amtm hung and I did a ctrl-c to terminate it. I then did a "ping diversion.ch" and got back (captured screen prior to ping & included ping output below):

+ c_url https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
+ [ -s /jffs/addons/amtm/a_fw/amtm.mod.new ]
+ [ -f /jffs/addons/amtm/a_fw/amtm.mod ]
+ rm -f /jffs/addons/amtm/a_fw/amtm.mod.new
+ a_m ! Module amtm.mod download failed
+ [ -z Initializing amtm for first run\n\n Getting from fwupdate.asuswrt-merlin.net\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\n\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch]
+ am= Initializing amtm for first run\n\n Getting from fwupdate.asuswrt-merlin.net\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\n\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\nd
+ f_b_url
+ a_m ! using fallback server diversion.ch\n
+ [ -z Initializing amtm for first run\n\n Getting from fwupdate.asuswrt-merlin.net\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\n\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch]
+ am= Initializing amtm for first run\n\n Getting from fwupdate.asuswrt-merlin.net\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\n\n ! Module amtm.mod download failed\n ! using fallback server diversion.ch\nn
+ amtmURL=https://diversion.ch/amtm_fw
+ g_m amtm.mod new /jffs/addons/amtm/a_fw
+ [ amtm.mod = amtm.mod ]
+ set -- amtm.mod new /jffs/addons/amtm/a_fw
+ [ /jffs/addons/amtm/a_fw ]
+ [ new = new ]
+ [ -z 1 ]
+ dlLoc=1
+ c_url https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
^C
admin@RT-AC86U-nnnn:/tmp/home/root# ping diversion.ch
PING diversion.ch (80.74.145.140): 56 data bytes
64 bytes from 80.74.145.140: seq=0 ttl=56 time=127.271 ms
64 bytes from 80.74.145.140: seq=1 ttl=56 time=125.888 ms
64 bytes from 80.74.145.140: seq=2 ttl=56 time=125.914 ms
^C
--- diversion.ch ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 125.888/126.357/127.271 ms

running
curl https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
outside of amtm script worked without problems

I then got a bit further when running the amtm script but it still hung.

It next hung (looped) on:
/usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new

Running it outside the script at a command line worked but it is hung on this command now:

c_url https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new

Is there anyway to get a first time configuration download of all files so amtm "thinks" first time has been run???

Here is what amtm is doing now:
+ dlLoc=1
+ c_url https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ [ -s /jffs/addons/amtm/diversion.mod.new ]
+ [ -f /jffs/addons/amtm/diversion.mod ]
+ rm -f /jffs/addons/amtm/diversion.mod.new
+ a_m ! Module diversion.mod download failed
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod
+ f_b_url
+ a_m ! using fallback server diversion.ch\n
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mon
+ amtmURL=https://diversion.ch/amtm_fw
+ g_m diversion.mod new /jffs/addons/amtm
+ [ diversion.mod = amtm.mod ]
+ [ /jffs/addons/amtm ]
+ [ new = new ]
+ [ -z 1 ]
+ dlLoc=1
+ c_url https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new

So, this doesn't make sense to me (sorry). I have two putty sessions going logged in as adminstrator. In one window, I am running sh -x /usr/sbin/amtm and the other I am using to issue "hung" commands to see if they work outside the script. The last command above:
/usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
works without any problems in the second window I have open running it on a command line.

Ok, so I'm not sure how/why but AMTM is now working on my router. I took the following actions:

1. cd
2. cp /usr/sbin/amtm ./
3. vi ./amtm (did a chmod 755 ./amtm)
4. changed line to
c_url(){ /usr/sbin/curl -fsNL --retry 3 --connect-timeout 10 -m 8 "$@";}
5. sh -x ./amtm
6. noticed it got me to amtm 3.1.3 menu
7. ctrl-c to terminate
8. amtm (and it comes up with menu / no problems)
9. option e to exit
10. /usr/sbin/amtm (it produced full menu)

As I stated, I have no idea why.

So, it is now having more problems and I think it is related to the CURL command. I am running sh -x /usr/sbin/amtm to see where the hangs are. First, I get "upd err" when I pick option "u". I get the "upd err" on Diversion, Skynet and amtm. I then try to do option "dc" to install disk checker. I see the same failures on the curl command I did when trying to get to the amtm menu. For example:

+ update_amtm
+ urlNOK=
+ c_url https://fwupdate.asuswrt-merlin.net/amtm_fw/amtm.mod
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://fwupdate.asuswrt-merlin.net/amtm_fw/amtm.mod
+ grep -q ^version=
+ urlNOK=1
+ f_b_url
+ a_m ! using fallback server diversion.ch\n
+ [ -z ]
+ am= ! using fallback server diversion.ch\n
+ amtmURL=https://diversion.ch/amtm_fw
+ [ 1 ]
+ c_url https://diversion.ch/amtm_fw/amtm.mod
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/amtm.mod
+ grep -q ^version=
+ [ 1 = 1 ]
+ updErr=1
+ thisrem= upd err
+ amtmUpd=0
+ [ -z 1 ]
+ corr1=
+ [ 0 = 0 ]


Picked option "u" and got:
amtm 3.1.3 FW by thelonelycoder
RT-AC86U (aarch64) FW-384.15 @ 192.168.1.1
The Asuswrt-Merlin Terminal Menu

1 open Diversion v4.1.9 upd err
2 open Skynet v7.1.0 upd err

ep manage Entware packages no upd

m menu amtm uu force update upd err
_____________________________________________

! using fallback server diversion.ch

Update aborted, could not retrieve version
_____________________________________________

Enter option

This will be my last update on the problem. Will wait for further direction on how I can help resolve this.
 
Last edited:
curl https://diversion.ch/amtm_fw/amtm.mod -o /jffs/addons/amtm/a_fw/amtm.mod.new
That's not a real file (amtm.mod.new) but how amtm handles new files before they are verified internally.
Is there anyway to get a first time configuration download of all files so amtm "thinks" first time has been run???
No.
Shouldn't the above command be:
usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/a_fw/diversion.mod.new
No.
There are no errors in amtm AFAIK, except that it goes into a loop when download fails.

I have not figured out why ATM, I'd probably have to set the curl timeouts higher.
I'll watch this and take action when needed.
The diversion.ch server is fine, there is NO overload.
 
That's not a real file (amtm.mod.new) but how amtm handles new files before they are verified internally.

No.

No.
There are no errors in amtm AFAIK, except that it goes into a loop when download fails.

I have not figured out why ATM, I'd probably have to set the curl timeouts higher.
I'll watch this and take action when needed.
The diversion.ch server is fine, there is NO overload.

Here is the code prior to looping due to download failure:
+ COR=21
+ clear
+ printf %-27s%s\n amtm 3.1.3 FW by thelonelycoder
amtm 3.1.3 FW by thelonelycoder
+ nvram get odmpid
+ [ -z ]
+ nvram get productid
+ model=RT-AC86U
+ uname -m
+ nvram get buildno
+ nvram get lan_ipaddr
+ echo RT-AC86U (aarch64) FW-384.15 @ 192.168.1.1
RT-AC86U (aarch64) FW-384.15 @ 192.168.1.1
+ printf %-44s \n\n The Asuswrt-Merlin Terminal Menu
The Asuswrt-Merlin Terminal Menu

+ modules=/opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker
/jffs/scripts/firewall skynet 2 Skynet¦-¦the¦Router¦Firewall
/jffs/scripts/FreshJR_QOS FreshJR_QOS 3 FreshJR¦-¦Adaptive¦QOS
spacer
/jffs/scripts/YazFi YazFi 4 YazFi¦-¦enhanced¦guest¦WiFi
/jffs/scripts/scribe scribe 5 scribe¦-¦syslog-ng¦and¦logrotate
/opt/bin/x3mRouting x3mRouting 6 x3mRouting¦-¦Selective¦Routing
spacer
/jffs/addons/unbound/unbound_manager.sh unbound_manager 7 unbound¦Manager¦-¦unbound¦utility
/jffs/scripts/nsrum nsrum 8 nsrum¦-¦NVRAM¦Save/Restore¦Utility
spacer
/jffs/scripts/connmon connmon j1 connmon¦-¦Internet¦uptime¦monitor
/jffs/scripts/ntpmerlin ntpmerlin j2 ntpMerlin¦-¦NTP¦Daemon
/jffs/scripts/scmerlin scmerlin j3 scMerlin¦-¦Quick¦access¦control
spacer
/jffs/scripts/spdmerlin spdmerlin j4 spdMerlin¦-¦Automatic¦speedtest
/jffs/scripts/uiDivStats uiDivStats j5 uiDivStats¦-¦Diversion¦WebUI¦stats
/jffs/scripts/uiScribe uiScribe j6 uiScribe¦-¦WebUI¦for¦scribe¦logs
spacer
stubby
/jffs/dnscrypt/installer dnscrypt di dnscrypt¦installer
/opt/bin/opkg entware ep Entware¦-¦Software¦repository
pixelserv-tls
spacer
+ IFS=

+ set -f
+ [ /opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker = spacer ]
+ [ /opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker = stubby ]
+ [ /opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker = pixelserv-tls ]
+ echo+ awk {print $1}
/opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker
+ scriptloc=/opt/bin/diversion
+ echo+ awk {print $2}
/opt/bin/diversion diversion 1 Diversion¦-¦the¦Router¦Adblocker
+ f2=diversion
+ [ -f /opt/bin/diversion ]
+ g_m diversion.mod include
+ [ diversion.mod = amtm.mod ]
+ [ ]
+ set -- diversion.mod include /jffs/addons/amtm
+ [ include = new ]
+ [ include = include ]
+ [ -f /jffs/addons/amtm/diversion.mod ]
+ g_m diversion.mod new /jffs/addons/amtm
+ [ diversion.mod = amtm.mod ]
+ [ /jffs/addons/amtm ]
+ [ new = new ]
+ [ -z ]
+ + awk -F[/:] {print $4}
echo https://fwupdate.asuswrt-merlin.net/amtm_fw
+ a_m \n Getting from fwupdate.asuswrt-merlin.net
+ [ -z ]
+ am=\n Getting from fwupdate.asuswrt-merlin.net
+ dlLoc=1
+ c_url https://fwupdate.asuswrt-merlin.net/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://fwupdate.asuswrt-merlin.net/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ [ -s /jffs/addons/amtm/diversion.mod.new ]
+ [ -f /jffs/addons/amtm/diversion.mod ]
+ rm -f /jffs/addons/amtm/diversion.mod.new
+ a_m ! Module diversion.mod download failed
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net ]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed
+ f_b_url
+ a_m ! using fallback server diversion.ch\n
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed ]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n
+ amtmURL=https://diversion.ch/amtm_fw
+ g_m diversion.mod new /jffs/addons/amtm
+ [ diversion.mod = amtm.mod ]
+ [ /jffs/addons/amtm ]
+ [ new = new ]
+ [ -z 1 ]
+ dlLoc=1
+ c_url https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ /usr/sbin/curl -fsNL --retry 2 --connect-timeout 3 -m 8 https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
+ [ -s /jffs/addons/amtm/diversion.mod.new ]
+ [ -f /jffs/addons/amtm/diversion.mod ]
+ rm -f /jffs/addons/amtm/diversion.mod.new
+ a_m ! Module diversion.mod download failed
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n ]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed
+ f_b_url
+ a_m ! using fallback server diversion.ch\n
+ [ -z \n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed ]
+ am=\n Getting from fwupdate.asuswrt-merlin.net\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n\n ! Module diversion.mod download failed\n ! using fallback server diversion.ch\n
+ amtmURL=https://diversion.ch/amtm_fw
+ g_m diversion.mod new /jffs/addons/amtm
+ [ diversion.mod = amtm.mod ]
+ [ /jffs/addons/amtm ]
+ [ new = new ]
+ [ -z 1 ]
+ dlLoc=1
+ c_url https://diversion.ch/amtm_fw/diversion.mod -o /jffs/addons/amtm/diversion.mod.new
 
Check the DNS settings on your router. What happens if you try to resolve the server directly on the router?

Code:
nslookup diversion.ch

Double NAT shouldn't matter, unless that primary router is providing an invalid DNS to the second router.
 
Check the DNS settings on your router. What happens if you try to resolve the server directly on the router?

Code:
nslookup diversion.ch

Double NAT shouldn't matter, unless that primary router is providing an invalid DNS to the second router.

That did the trick. I had to change my DNS settings to finally get everything working. Thanks!
 
I resorted to downgrading my ac86u to 384.14 and installing amtm manually which solved the issues. Built-in amtm for 384.15 and 284.15_beta1 on an ac86u just wouldn't work. I tried everything including format jffs, clean format usb, factory reset to use all default settings, dns changes and I confirmed fw and diversion domains were resolving with nslookup. At best I could get amtm to load a theme and fd a disk. When I tried to install an addon like diversion it might eventually say the module was installed but it didn't show in the menu. 384.15 and amtm is working fine on my ac68u so who knows.
 
That did the trick. I had to change my DNS settings to finally get everything working. Thanks!
Hey Ronbo, please provide details. I have the same issue and am doubled-nated behind a router. The first router can resolve diversion.ch with no problem but the ASUS cannot. This happened after upgrade to 348.16 from 384.14_2. I'd appreciate any input, thank you...

UPDATE: I cannot resolve any DNS, but if I manually edit my /jffs/configs/dnsmasq.conf.add, those addresses do resolve. Problem is that there are so many other addresses that try to resolve during the upgrade it's not a great solution, also want to fix DNS if anyone can help...

address=/diversion.ch/80.74.145.140
address=/fwupdate.asuswrt-merlin.net/104.18.40.167
 
Last edited:
The only thing I did was add diversion.ch to the Skynet Firewall whitelist. Once I could access diversion.ch then everything started working.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top