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
 
#2 · (Edited)
I "wrote" a batch for Windows. It's using "plink" from Putty to transmit the commands like sshpass, and also "fping" to determine if the CMU is online.

I haven't tried it with an CMU, but with another Linux embedded system. It's also not perfect, works as well.

Unzip the folder from the ZIP file. The folder contains a batch "start.bat". You can start it with the IP of the CMU as argument

Code:
start.bat 192.168.42.1
or just doubleclick it. Then it will ask you for the IP.

It will start a ping loop until the CMU is reachable.
As soon as it is reachable, plink will execute the SSH command to disable the watchdog.

EDIT: The script and commands based on the researches of oz_paulb. So please say "Thank you" to him :)
 

Attachments

#10 ·
this is a very good thread....worthy of standing on it's own.

this dreaded boot loop has happened to many of us.

I followed these wise words and finally got the echo "It seems like we were able to disable the Infotainment watchdog!"

it took me what seemed to be an eternity......an hour + of repeating the steps.....and i finally got it.......
be patient be persistent....some have stated that fiddling with the hmi buttons and dials may help keeping the firmware busy for an extra second........can't say for certain if that helped......I too had my radio functioning and could toggle through my favourites with the info button on the steering wheel, even my phone connected......and then disconnected continually.....
felt very good to get it back to fully functional.....thanks to many very fine folks on this forum!

ganbatte.
 
#11 ·
How to stop boot-loop (CMU, No more reboot loop)

edit start_network.sh

Code:
#!/bin/sh

# Start some developer mode tools
if [ -f /data/integration/developer_mode_on_flag ]; then
    # Start HTTP server for "remote GUI"
    /usr/sbin/httpd -p 80 -h /jci/gui
else
    #start firewall only if NOT developer mode on
    nice -n 20 /jci/scripts/jci-fw.sh start
fi

insmod /lib/modules/3.0.35/kernel/drivers/net/phy/smsc.ko
insmod /lib/modules/3.0.35/kernel/drivers/net/fec.ko

ifplugd -M -I -i eth0

# USB ethernet (eth1)
insmod /lib/modules/3.0.35/kernel/drivers/net/usb/usbnet.ko
insmod /lib/modules/3.0.35/kernel/drivers/net/usb/asix.ko

/jci/scripts/start_eth1_dhcp.sh &

/usr/sbin/sshd

[B]#add_line
echo 1 > /sys/class/gpio/Watchdog\ Disable/value[/B]

touch /var/run/start_network_ready


I have had sometime happened GUI javascript bug,
But CMU doesnt boot loop.

Infotainment System stops after menu indication, So you guys connect USB-either, and please ENJOY fixing code in passage of slow time afterward.

:p

Please try everybody.
 
#12 · (Edited)
I have had sometime happened GUI javascript bug,
But CMU doesnt boot loop.

Infotainment System stops after menu indication, So you guys connect USB-either, and please ENJOY fixing code in passage of slow time afterward.

:p

Please try everybody.
There is a better solution to PREVENT reboot loop from occuring from serezhka

So i went to /jci/sm/sm.conf and changed 'yes' to 'no':
Code:
<!-- ======== HMI ========  -->
<service type="process" name="Opera" path="/jci/opera/opera" autorun="yes" reset_board="[B]no[/B]" retry_count="0" args="-u /jci/gui/index.html" affinity_mask="0x02">
            <dependency type="service" value="jciAppsdk"/>
            <dependency type="service" value="jciDbapi"/>
        </service>
Now, the system will not be restarted after the Opera is closed. I have tested it.

.. but guiManager (Opera plugin: /jci/opera/opera_dir/jsplugins/guimanager.so) continues to close Opera after missing heartbeat
Code:
00:03:48.533 GUI_MANAGER[585] Critical (guiManager.c:391 OnHeartbeatMissed) GUI didn't send any heartbeat for 10 seconds. Closing Opera.
I'll try to fix this :smile2:

How can i do this????
what software is used
this thing can be done in mac?
thanks
viejo, I am afraid it will not help in your case where the system is already in reboot loop. Unless you are able to get at least one ping response, there is not much anyone can do to help you. Can you post the details of your setup and post step by step what you did to try to connect to your car.
 
This post has been deleted
This post has been deleted
#21 · (Edited)
Welp, I tried messing with the boot logo and got stuck in boot loop.
I guess the system isnt able to play the new ivf file i put in, and is rebooting.

All I'm getting the Mazda logo, then backup camera for about 2 seconds, and the system reboots.
Even using the ethernet adapter, the USB doesn't seem like it's turning on before reboot.

Anyone know a fix? The tools listed here aren't working.
 
#24 ·
Hey Mzd3-k and everybody, i really apriciate your comments but seems like im making something wrong,

i try it with the TERA TERM, and your macro, i create a TTL file and openet from 'CONTROL' this, showsme the first message "neverreboot.ttl:1:..... PAUSE and END buttons, and after a while it change to "Link macro first. use 'Connect' macro and the buttons STOP MACRO CONTINUE and HELP... just some times i get another big windows where it ask for an authentification and had a lot of options but sometimes is like frozen or something like that.

I also try it over a MAC with the fixwatchdog script and i get this message back

192.168.1.66 : xmt/rcv/%loss = 1/0/100%
192.168.1.66 : [0], 84 bytes, 1.32 ms (1.32 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 1.32/1.32/1.32
./fix_watchdog.sh: line 80: 6494 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.61 ms (0.61 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.61/0.61/0.61
./fix_watchdog.sh: line 80: 6497 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.79 ms (0.79 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.79/0.79/0.79
./fix_watchdog.sh: line 80: 6499 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.66 ms (0.66 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.66/0.66/0.66
./fix_watchdog.sh: line 80: 6501 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.57 ms (0.57 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.57/0.57/0.57
./fix_watchdog.sh: line 80: 6503 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.77 ms (0.77 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.77/0.77/0.77
./fix_watchdog.sh: line 80: 6505 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"
192.168.1.66 : [0], 84 bytes, 0.65 ms (0.65 avg, 0% loss)

192.168.1.66 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.65/0.65/0.65
./fix_watchdog.sh: line 80: 6507 Segmentation fault: 11 DISPLAY=dummy SSH_ASKPASS_PASSWORD="${SSH_PASSWORD}" _SSHPASS_WANT_ECHO_PASSWORD="1" SSH_ASKPASS="$0" ${CMD_SSHPASS} -p ${SSH_PASSWORD} ssh ${SSH_OPTIONS} ${SSH_USER}@${IPADDR} "${SSH_CMD_TO_RUN}"

i dont know if im doign somethign wrong or maybe i need other device or thing?

I had comunictacion with the CMU, i can see even two or three pins over CDM on windows, but for some reason the "watchdog" command is not executing properly or on time...

im very desperate i had a month with this problem and i dont know what else to do...

PLEASE HELP!!!
 

Attachments

#25 ·
OK, I'm not sure I can help here, but looking at the output from the fixwatchdog script, it appears that it DOES get "ping" replies from your CMU, but something is going wrong (on the Mac side) when it tries to run the "sshpass" command (the "Segmentation Fault" error means that the program 'crashed' on the Mac, so was unable to actually connect to the CMU - not (I think) because of the CMU, but because of something wrong on the Mac side).

What type of Mac do you have? I assume it's an Intel CPU. Do you have a Windows PC? If so, please try the Windows version of the fixwatchdog script that someone else posted after I posted the Mac version.

Do you have a Linux PC on the network?
 
#26 ·
Another thing to try on the Mac: instead of running "./fixwatchdog.sh IPADDR", from the same directory, run:

Code:
./sshpass.macos pwd
(it should echo the current directory name. If it also gives the "Segmentation fault" error, that'll give me a clue)

If the above works, then try running:

Code:
ssh
You should see a "usage:" message ('help' for using the ssh command). Again, if you see "Segmentation Fault", that's a clue.
 
#27 ·
Hi oz_paulb,

The MAC is a desktop all in one from my neighbor intel i5, with Mac OSX 10.7.5.
In this MAC i Download the "fixwatchdog zip" and the "fping" software for this version (10.7.5), then i open the TERMINAL and run the script "Fixwatchdog.sh IPADDR" and the result is the one that i paste on the previous message.

I also try this on WINDOWS and I use the "MZD LoopRepair" and get this message:
looking up host "192.168.1.5"
Connecting to 192.168.1.65 port 22
we claim version:SS-2.0-PuTTY_Release_0.64
Server Version: SHH-2.0-OpenSHH_5.9
We believe remote version has SSH-2 channel request bug
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman jey exchange with hash SHA-256

by mz3d suggestion i use TERA TERM (i dont know if i use it well)
I create a TTL file from notepad with the script from MZ3d and then open TERA TERM, went to control, macro and open the TTL file, this showsme one window (its on the prev. post) then other (prev. post too) and then the program close by himself.

I will try your new advice with the MAC as soon as my neighbor came to his house from work, but i dont know if i need to download something else or maybe an special configuration.

I could try to get borrowed a linux laptop (if some of my friends have it), but i dont know how long it takes me.

So i think that the question is, im i doing something wrong? do i need more software or a special configuration on TERA TERM, maybe make the macro autoexe?

Thanks for your time, i really apriciate
 
#30 ·
I noticed in the messages from the Mac, you are trying to connect to the CMU at "192.168.1.66".

On the MZD_LoopRepair, it's showing (oddly) two different IP addresses: "192.168.1.5" and "192.168.1.65". Both of these are different from the IP shown on the Mac.

Is your CMU getting a different IP address from your router on running of these two tests, or did you make a typo in specifying the IP address?

As I said, I don't know anything about TERA TERM. But, it looks like you need to create a ".ttl" file (as specified in a previous message) and click on that ".ttl" file to run it. The example .ttl earlier in this thread says "192.168.x.x". I assume you've put the correct CMU IP address there instead of "x.x"?
 
#31 ·
Dear oz_paulb the ip address is because was different days and the router give to the CMU different IP's
as soon as i made test with the new comands that you told me i will let you know, i will also try to get a linux PC.

on the other hand, mzd3-k I tried again with the TTL file running automatically from the TERATERMACRO and i get a new window (just the first time) and then nothing, the window was frozen and then quit by himself, what should i do if i get this again?
 

Attachments

#36 ·
Finally got out of my reboot loop as well.
Just modified the auto tweak file to remove as much things as possible, and only disable watchdog...
Left the USB plugged in for about 2 weeks and I finally managed to get it to boot once. Quickly SSH'd in and replaced my corrupted file.
 
  • Like
Reactions: oz_paulb
#37 ·
I am also stuck in the reboot loop. Just updated to V55 and went to tweak a couple things.
After the mazda logo I get a frozen menu for about 15 seconds.
Tried MZD_loop repair with default IP (192.168.42.1) and my PC set to 192.168.42.2.
Just keep getting CMU is still offline. My network adapter connects for a few seconds and then goes back to network cable unplugged.
Anything else I can try?
 
#41 ·
Originally Posted by oz_paulb
NOTE: this post is describing how to (hopefully) 'fix' an Infotainment system that you have broken by making modifications to it.
Thanks for providing both hope, and a solution :). Long time lurker/hacker, but first post (so apologies if I don't have the quoting right). I hadn't had anything original to contribute to this point.

Got more adventurous in hack applications, and managed to hit the boot loop after installing jmgao/mazda-connector software.
Will be going back to see where I went wrong, and once I have more info that will be a post in another thread.

Of course I wasn't forward-thinking enough to have added mzd3-k's or serezhka's preventative measures before creating this problem...

I used oz_paulb's fix_watchdog_sshpass, and with a few edits, and after an anxious amount of waiting, and stopping and restarting the car it finally worked.

Chain was from a v33 system, via USB->ethernet->TP-link Nano router (serving the dhcp) ->wireless->Linux. Was in the process of setting up dhcpd on linux laptop to remove the wireless aspect when the wonderful message appeared:
"It seems like we were able to disable the Infotainment watchdog!"

I was running this with Ubuntu, and so needed to change the starting line of the script to
#! /bin/bash
The original script is written in bash, but with the assumption that /bin/sh was a link to bash.

I also added a line inside the loop, before the fping, and added the -q parameter to fping.
That way I could see just how long things were taking, as the data went scrolling by:
while true
do
# use 'fping' with a quick timeout to try to get a response
date +"%H:%M:%S -- " | tr -d '\n'
${CMD_FPING} -q -c1 -t${TIMEOUT_MS} ${IPADDR}
Thanks again to all. Broken stuff is reverted, and preventative measures now in place.
 
#43 · (Edited)
I messed up with my syssettingsApp.js and keeps on rebooting. I followed the instruction of mzd3-k with teraterm and it works. Already edit my syssettingsApp.js but what happens now is it does no reboot. What should I do? Thanks in advance. Thanks also to Sir oz_paulb to this thread.


Edit:

Already fixed. Just waited for an hour. Tadan.. :smile2:
Thanks to all of you guys. More power to this forum.
 
#45 ·
Disabling watchdog only happens once, it's not a permanent tweak.
You'd have to disable it every time the CMU starts up.
That being said, reboot is NAV + MUTE
Not music+Nav
 
  • Like
Reactions: grcmfs