2004 to 2020 Mazda 3 Forum and Mazdaspeed 3 Forums banner

How to (hopefully) get your Infotainment system out of "reboot loop"

99K views 136 replies 63 participants last post by  ctve  
#1 ·
NOTE: this post is describing how to (hopefully) 'fix' an Infotainment system that you have broken by making modifications to it. If you haven't already been making modifications to the software, then this post doesn't apply to you. PLEASE don't follow any of these instructions unless you have been modifying the software as described below.


The Infotainment Project is a very long thread with discussion on how to make modifications to the software on your Infotainment system.

There are risks with making such mods - several people (including myself) have made changes that caused the main user-interface to 'crash'. The result is an Infotainment system that gets stuck in a "reboot loop" (it starts up, the user interface crashes (because of a bug you introduced), and then it eventually 'reboots' and does this over and over again).

It can be quite difficult to 'fix' the problem once it gets into this situation. You probably created the problem by using a USB->ethernet adapter, and copying modified user-interface ".js" files (with bugs) onto the system. But, when it's in the "reboot loop", it reboots so quickly that it's nearly impossible to connect with ssh, remount the filesystem as read-write, and restore the original version of the file that you corrupted.

When the problem happened to me, it took me several hours to fix the problem. I felt lucky to have timed things just right in order to restore the original file that I had corrupted.

Since then, I've come up with a script to help with the recovery process. The script just connects (over ssh) as quickly as possible, and issues a single command to prevent the Infotainment system from auto-rebooting (it disables the hardware "watchdog timer"). With the watchdog disabled, it's then possible to ssh-into the system as you normally would, and "un-do" whatever changes you made that caused the reboot loop in the first place.


The script isn't perfect, and I can't guarantee that it can connect to any system in a 'reboot loop'. But, it may be helpful to others, so I thought I should post it.

Currently, the script only works on Linux and MacOS. I hope to re-write the code in Java at some point, so there will be a 'platform-independent' solution (which would also work on Windows, for example).


In order to run the script, it's best if you have a DHCP server (could be your router) and that your Infotainment system is connected to that router to get a DHCP IP address. Using DHCP is faster than waiting for the 10-second timeout to 'fall back' to the default 192.168.42.1 IP address. Every second counts while stuck in a 'reboot loop', so using DHCP is a help. You'll need a way to find out which IP address is assigned to your Infotainment system - usually, your router's configuration/status web page can tell you which IP address it has assigned to which device. Even better, most routers can be configured to use "DHCP reservations", where you can tell the router what IP address it should give to your Infotainment system (based on the MAC address of your USB->ethernet adapter). All of this DHCP configuration is beyond the scope of this post - I assume you know how to do this/can get help from someone who knows.

The script relies on two external utilities: "fping" (a special version of "ping" that allows for really short timeouts), and "sshpass".

If you are running Linux, you can install these utilities with the following command:

Code:
sudo yum install fping sshpass
If you are running on MacOS, you can download an "fping" package from here: Rudix ? Packages ? Fping. Choose the appropriate version (Yosemite vs Lion/etc), download the package, run the package and follow the installation instructions.

I don't know of a pre-built MacOS package for "sshpass" - I've included a binary that I built on my system. I built it on OS X 10.10.3 (Yosemite) X86. I don't know if it's compatible with earlier versions of MacOS. If not, you'll have to find it online somewhere.


MacOS instructions:

The attached .zip file includes my script (called "fix_watchdog.sh") and the MacOS binary for "sshpass". When you download the ".zip" (using Safari, for example), it may automatically UN-zip the file (so, instead of a "~/Downloads/fix_watchdog_sshpass.zip", you may find a directory called "~/Downloads/fix_watchdog_sshpass"). If Safari doesn't automatically UN-zip it for you, then you should.


To run the script, you should open a "Terminal" command-line window. Assuming the attached .zip downloaded/unzipped to "~/Downloads/fix_watchdog_sshpass", then you should "cd" to it as follows:

Code:
cd ~/Downloads/fix_watchdog_sshpass
Then, run the command as follows:

Code:
./fix_watchdog.sh IPADDR
(where IPADDR is the IP address of your Infotainment system)

This script will run 'forever', until it believes that it has successfully connected to the Infotainment system and disabled the watchdog.

NOTE: this script can be difficult to STOP - "control-C" may be ignored. If you want to STOP the script, then close the "Terminal" window.



Linux instructions:

I'm assuming you are familiar with the Linux command line. UN-zip the attached .zip file, "cd" to where you unzipped it, then run:

Code:
./fix_watchdog.sh IPADDR
(where IPADDR is the IP address of your Infotainment system)

This script will run 'forever', until it believes that it has successfully connected to the Infotainment system and disabled the watchdog.

NOTE: this script can be difficult to STOP - "control-C" may be ignored. If you want to STOP the script, then "kill" the "fix_watchdog.sh" process (use "ps" to find it) or close the the console window where you started the script.



The following applies to both MacOS and Linux versions:


The script will initially try to 'ping' ('fping') the Infotainment system, until it gets a response. It will do this over-and-over until it hears back from the Infotainment system. While it's doing this, your screen will fill up with something like the following:

Code:
192.168.42.1 : xmt/rcv/%loss = 1/0/100%

192.168.42.1 : xmt/rcv/%loss = 1/0/100%

192.168.42.1 : xmt/rcv/%loss = 1/0/100%

192.168.42.1 : xmt/rcv/%loss = 1/0/100%

192.168.42.1 : xmt/rcv/%loss = 1/0/100%

This is normal - just let it fill the screen.

Once it hears a response from the Infotainment system, it will immediately try to "login" to the Infotainment system using ssh. If this succeeds, it will send the command to disable the hardware watchdog. At that point, you can ssh-in to your Infotainment system as you have done before - but this time you can 'fix' the files that you modified (which caused the 'reboot loop' that you are now tring to fix)

If it fails to connect with ssh, it will go back to the 'ping loop', waiting for the Infotainment system to respond (at which point it tries to connect with ssh again - all of this will be done over-and-over until (hopefully) a successful connection)

Once the script successfully connects, it will echo "It seems like we were able to disable the Infotainment watchdog!" to the console and exit. At this point, you can ssh-in to the Infotainment system and fix whatever files were broken - without worrying about an automatic watchdog reboot preventing you from doing this.



This script is by no means perfect, but it will hopefully be useful to others. Enjoy! (and good luck recovering your system!)

ATTACHED file (forum wouldn't let me attach a .zip, so here's a link):

http://hackspot.net/files/mazda/fix_watchdog_sshpass.zip

- Paulb
 
#49 ·
So I've been lurking on these forums for a few months, and I initially tried to install "tweaks" onto my CX-5 using a flash drive. I tried multiple times, but unfortunately nothing took effect and I just updated the system and figured I could live without the tweaks.

Since that time I haven't touched the system, and it has worked fine over the last month or two. Last night however upon starting the car it went into a boot loop. It had worked perfectly all day long until that point. As soon as the icons animate in and settle the system restarts.

I haven't been able to fix the issue by restarting the device, unplugging the battery, etc. I have never attempted to hook up the infotainment via my router, and I don't feel comfortable doing so with all the complicated code you guys are discussing. Just looking for basic advice I suppose. Should I try to run the USB with the uninstall tweaks? The car is scheduled to go in on Wednesday. At this point I think the unit just shit the bed. Any advice is appreciated.
 
#50 ·
Help Me

Hi !

I made a mistake, misspelled thesystemApp.js.
I enter the boot loop.

I can try MZD_LoopRepair on windows, and some proposal solution but I but it fails to solve the loop probleam.

I think MZD dont get IP address from home router, but before so I used this. It has a 192.168.0.100 address.

Please help me, how can I disable wathcdog?

Can I use USB->ethernet converter? It may be faster?
 
#51 ·
Hi !

I made a mistake, misspelled thesystemApp.js.
I enter the boot loop.

I can try MZD_LoopRepair on windows, and some proposal solution but I but it fails to solve the loop probleam.

I think MZD dont get IP address from home router, but before so I used this. It has a 192.168.0.100 address.

Please help me, how can I disable wathcdog?

Can I use USB->ethernet converter? It may be faster?

YEs, I recommend using USB Ethernet to connect to router then running the script. That's what worked for me when I forgot a }
 
#53 ·
HI!

I bought a USB Ethernet adapter.
I connected in my car and router.
I tried a lot of ip address run my script on windows and linux and Tera Term script, but my mzd reeboot about every 15 second.


How to set up the router?
Previously, the address 192.168.0.100 as the MZD connected to my router.

It is possible that I can not turn off the continuous restart?
There are other methods?
I am very angry and sad,I do not know what I'm doing wrong.

I can try use USB tweak, but it was not good.

#! /bin/sh

# don't remove lines 4 and 5
echo 1 > /sys/class/gpio/Watchdog\ Disable/value
mount -o rw,remount /

# turn off wi-fi
cp /mnt/sd*/config/systemApp.js /jci/gui/apps/system/js/

# the "Tweaks Applied" window will appear for 10 seconds and then close automatically"
/jci/tools/jci-dialog --title="Tweaks Applied" --text="Tweaks have finished running" --ok-label='OK' --no-cancel &
sleep 10
killall jci-dialog


Please tell me what steps to take for repairs.

Thanks

STeve
 
#54 · (Edited)
You can't just put a random ip address. Use something like angry ip scanner after you've connected the car to the router via ethernet to find it. Then after finding the address run the script using the found address and let it run for a while. If you want to directly connect it to your pc I think you'll need to mess with the static ip settings. Router is usually easier. Using wifi probobly won't work and USB might not either.

To make sure the ip address is correct you can also see if ssh is open. Or you can ping it, disconnect the car, and ping it again to see if it can't connect anymore.
 
#55 ·
Thanks nimonster!

I am understand, but the big problem is my mzd is rebbot every 15 second.
This time is too short that I found IP address.
WHen I use USB-> ethernet dapater I saw the blink led on the adapter, so I think mzd was communicated with router
, but I dont know which IP address.

The raido is working continously, so mzd is working, I thinks.

I havent got more idea, but my car is brand new, so I do not want to lose car warranty, so I can't go to the repair shop.

I thought about using a USB script could do something, if I put to the MZD. But unfortunately, it seems to me it is not fast enough.

I'm clueless.

:(
 
#58 ·
If you're stuck in a reboot loop, most likely you won't have time to fiddle with the router or an IP scanner to find the IP of the car. You'd have to be constantly refreshing the page that shows the connected devices/IP address until you see a new one pop in to the list. A way to get around that is to try to connect to 192.168.42.1 This also means your router and laptop will need to have IPs in this range. This is the "fall back" or "default" IP address of the car. Most systems will default to a 169.254.x.x address when DHCP fails, but the devs set the car to use a route-able IP address when there is no DHCP.
 
#59 ·
Thanks JerryO81!

Yes the time is very short.
Can I Use the auto wifi to connect to the router? Or I try use usb->ethernet adapter?
Not a few of the 15 seconds to have an IP address?
In this case, DHCP must be turned off in the router?
Can I set a fixed IP address for my notebook, such as 192.168.42.2, and turn off the router and DHCP?


Sorry for the many question and my poor Englis, but I am very nervous.
It can not be done in some days.

Thanks!

THansk!
 
#60 ·
I fixed mine using a portable router limited to only two ips for the dhcp, so i now which ip it will assigned for the mazda or you can open the page where it lists the dhcp clients released ip's and you should find a new one when its recognized with the mazda. Just make sure you have a compatible usb to ethernet adapter or it wont work.
 
#61 · (Edited)
Thanks Tarekkkkk!


I mean, you router with DHCP, but only such as 192.168.0.100 to 192.168.0.101 from.
One of them will receive the laptop and the other a Mazda.
How do I know which ethernet adapter in good for mazda car?

For me these are:
Delock USB 2.0 Ethernet adapter - 61147 - I/O kártya - Számítástechnika - Bluechip webáruház

It is appropriate?

I am afraid for under the reboot time, mazda can not get the ip address.

Is it not possible with tweak.sh in USB drive?

Previously, i use a videoplayer on USB drive , but I can not turn off this watchdog function now with usb tweak. What could be the reason?


Thanks!
 
#62 · (Edited)
Either this Amazon.com: TRENDnet USB 2.0 to 10/100 Fast Ethernet LAN Wired Network Adapter for Macbook, Chromebook, Windows 8.1 and Earlier, Wii, Wii U, Linux, and Specific Android Tablets, ASIX AX88772A Chipset, TU2-ET100: Electronics
or this
or this [ame]http://www.amazon.com/Apple-MB442-USB-Ethernet-Adapter/dp/B0012P26ZO[/ame]
These are the only adapters known to work with our infotainment.

Edit: Also make sure to plug the usb to the second usb port (bottom while sitting) and when the light comes on the adapter that means the ip is assigned and when that happens you have like 2-3 sec until it reboots, what i did was press on several buttons to make the infotainment stay alive before it autoreboots so the script finishes its work.
 
#63 ·
Thanks, I will buy this adapter, but my adapter support ASIX AX88772.

I show the led blink on the adapter, but I think I set the router incorrectly.

If I use the adapter, then mazad's IP is 192.168.42.1, it is correct?

Do I have to use router with DHCP in range?
Or mazda's IP is 192.168.42.1 direct and the adapter connet the router and I have to set my laptop's ip is 192.168.42.2?

Sorry, I dont understand what is happening.....

And can I use a tweak usb drive solution?
Why it does not work?
Create a Vehdatapull folder when I use.


THanks everybody!
 
#64 ·
The sytem will revert to its default ip after 10 sec after booting up (if it doesnt get a dhcp ip) which in your case it wont happen as it needs at least 20 sec to boot and after 10 sec it will go back to its default ip, in the those 10 sec it will boot loop so your only solution is using a router.
 
#65 ·
Unfortunately I could not fix it
My USB -> Ethernet converter is not good, or can not be repair my MZD.
I ordered a usb->ethernet adapter what you suggested. I am waiting for it.

I set the router and the I do as you suggested. Only one address could get accross the DHCP Mazda, 192.168.42.1

I've never seen a router to have joined such IP adrress for a client page.
It looks like the 15 seconds is not enough to connect, or are not good for my the converter.

I do not know what can i do.

Please help me if you have an idea.

Thanks
 
#67 ·
Dear tarekkkkk and Everybody!

DONE.
Thanks for everybody!

This is the key for solution:
Amazon.com: TRENDnet USB 2.0 to 10/100 Fast Ethernet LAN Wired Network Adapter for Macbook, Chromebook, Windows 8.1 and Earlier, Wii, Wii U, Linux, and Specific Android Tablets, ASIX AX88772A Chipset, TU2-ET100: Electronics

Image


I am very happy!

THANKS!
 

Attachments

#70 ·
another Bootloop...

Hi,

I already wrote in the Infotainment Project Thread, but maybe here some other People read that, too ;)

I´m on V56.00.23 EU, i overwrote the sm.conf in the sm Folder aswell as the opera.ini with files from the V33. This caused my bootloop.
(I tried to uninstall the Speedometer app from Anderml1955)

So far my configuration is as following:
--->CMU
--->USB to Ethernet Connector (Trendnet with the ALX chipset(NOT working, no lights) OR Hama, working with lights)
--->Router, DHCP set to 192.168.42.1&2
--->Laptop(Win 10), which has the 192.168.42.2 as IP.

Teraterm wont connect, the MZD_Loop_Repair script gets sometimes a connection, but is too slow.

What can i change so that maybe i´m able to log in to the System?

Other way: How can i see if USB scripts are still working on my system ? Maybe i can write a simple script which copies the correct version of the sm.conf?
 
#73 ·
Since the boot loop is caused by a system watchdog timer, would it be possible to modify or disable this watchdog altogether on a system so that you don't have to worry about getting into a boot loop in the first place? If the watchdog were modified to 30 or 60 seconds, for instance, that'd be plenty of time to be able to fix any problems causing a boot loop, while retaining the functionality the watchdog was put there for. Or it could just be disabled, and let people manually reboot the system when necessary.
 
#79 ·
Hi @oz_paulb and all,

I'm using Mac (10.10.5), Apple USB-Ether, A Router and cables
All connection to my Mac and the car are fine - I think

But during run the script fix_watchdog I got those error logs

1/
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 3.29/3.29/3.29
Warning: Permanently added '192.168.1.3' (RSA) to the list of known hosts.
28440250558951304ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied (publickey,password,keyboard-interactive).
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 2.14/2.14/2.14

----

2/
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 11.7/11.7/11.7
Warning: Permanently added '192.168.1.3' (RSA) to the list of known hosts.
28440250558951304ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(fix_watchdog.sh): No such file or directory
Permission denied (publickey,password,keyboard-interactive).
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.97/0.97/0.97
Connection timed out during banner exchange
192.168.1.3 : xmt/rcv/%loss = 1/0/100%
3/
192.168.1.3 : xmt/rcv/%loss = 1/0/100%
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 2.48/2.48/2.48
Which this #3 issue, after output the number, the script seem to be delayed and/or stop working

What should I do now. I got the #bootloop 3 weeks ago lol

Thanks,
Nguyen
 
#80 ·
Done. It was ah sshpass install issue on Mac.
Finally got this most waited message
192.168.1.3 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 2.45/2.45/2.45
Warning: Permanently added '192.168.1.3' (RSA) to the list of known hosts.
28440250558951304It seems like we were able to disable the Infotainment watchdog!
Thanks all of your guys for great support and sharing!
Now keep continue of hacking haha

What I have done:
- A Mac (MBP Mid2009)
- An Apple USB-Ether (can find it in Apple local store)
- A Router (Comtrend - is using at my home)
- 2 lines of internet cable: one for laptop, one for car+usb-ether, plugged to the router
- Using fix_watchdog.sh which was written by @oz_paulb
 
#125 ·
NEED HELP

Done. It was ah sshpass install issue on Mac.
Finally got this most waited message


Thanks all of your guys for great support and sharing!
Now keep continue of hacking haha

What I have done:
- A Mac (MBP Mid2009)
- An Apple USB-Ether (can find it in Apple local store)
- A Router (Comtrend - is using at my home)
- 2 lines of internet cable: one for laptop, one for car+usb-ether, plugged to the router
- Using fix_watchdog.sh which was written by @oz_paulb
hello,im vietnamese too and i need help