How to reboot FX30 from with code?

Hi All,

Can anyone point me in the right direction…

I’m trying to setup a reboot of my FX30 from within my app on certain conditions, but I haven’t been able to locate the right commands. Any help is greatly appreciated!

Thanks

Eddie

Does this help?

Thanks! That’s exactly what I needed.

Eddie

Question,

I implemented “faultAction: reboot” in my apps .adef file and added exit(1); to my code. It works fine if I’m connected to the modem via USB, but if the USB is disconnected and only connected using serial (which is how it needs to function) when it reboots the modem just hangs.

As soon as I connect the USB cable to see what going on, the modem completes the reboot and starts working again.

Does the “faultAction: reboot” require the modem to be connected on USB? Any thoughts why it’s functioning like that?

Thanks.

Eddie

Does this app help?

Thanks jyijyi, but that didn’t help.

Let me try and describe my problem a little better.

In March I was having problem with my app where it would stop communicating over the cellular network and I couldn’t recover. So I decided to have the code reboot in this scenario. I added faultAction: reboot to the myApp.adef file and exit(1); to a function in my code.

When the scenario reoccurred, and the exit(1) command executed, the modem just stopped all functions and didn’t reboot. I then connected the USB/SSH cable, the modem immediately rebooted itself. It seems to me that when the reboot command was executed in my code, the modem just stopped or paused for some reason I don’t know, and resumed when I connected the USB.

I also noticed that if I leave the USB/SSH connected, when the reboot command is executed in the code, the modem reboots with no problem. Unfortunately, there is no USB available where I deploy the modem, so that is not a solution to my problem. I only use the serial port in my app.

I was going to try and capture what the problems was when I connected the USB/SSH, but since the modem immediately reboots, that doesn’t help me either.

Thanks.

Eddie

I don’t see problem on my WP7607.
Once I run the the wakeup_app, even I remove the USB cable, the module still wake up.
After that I run the application which will run exit(1), the module can reboot successfully.

Is there a way to capture or save the log to the modem file system? Since the modem reboots when I connect the USB/SSH cable, I loose all previous logs.

How about
logread -f > /home/root/log.txt

Hi @eddie435

It might be failing to reboot because the modem enters USB Suspend Mode when the USB cable is disconnected. USB autosleep is enabled by default.

Try disabling it with this command:

echo off > /sys/power/autosleep

Note that is only temporary and it will re-enabled automatically at the next boot.

To disable it permanently, you must modify /etc/init.d/enable_autosleep.sh

See this forum post for a handy script written to automate this: Script to disable USB autosleep

Cheers,
Raf

jyijyi and raf, Thanks, both your posts help me figure out the problem. It was the USB going to low power mode. Once I applied the wakeup.app, the reboot work fine.

Thank!!!