[HTC Sensation] misiek_to_ja:
Hi,

I played a little with radio debugging just to understand the whole situation. Unfortunately (or fortunately) the radio is working now like a charm (maybe because of OTA 2.3.4 upgrade?). Anyway as most of you know normally when we are in good coverage area the radio module is in 'service' mode and when we loose our radio signal it switches to 'noservice' mode and the signal strength has the value of 0 or -1. Nothing new so far. But the most interesting part begins now - it turned out that after around 1 minute phone module gets out of this 'noservice' module and for some time it is in no particular mode. And then after over a dozen of seconds it switches to 'emergency' mode. What is also interesting sometimes signal strength is set to maximum value - it is 8. Of course after we loose our signal we can't read current CellID value or mobile operator name. Anyway this procedure allowed me to write short script in Tasker program (by the way very genious tool to automate almost everything).

I assumed that getting into 'emergency' mode is enough to get our procedure activated. Of course we can use other conditions as well (like %TNET and %CELLID is unset), but it is not needed here. So anyway after detecting 'emergency' mode the script will wait 6 minutes (72 repeats lasting 5 seconds each) and during that time will check if we reacquired our signal ('service' mode) or if we got into airplane mode ('nopower' mode - mainly for those who switch their phone in the night). If the radio module won't get signal in those 6 minutes it will vibrate, play chosen mp3 file and then turn on the airplane mode, so including bluetooth & wifi as well (for those using rooted devices they can use instruction turning off the radio module only). Then it will wait 15 seconds (you can shorten it a little) and then will turn the airplane mode off, thus turning on the radio. It will wait 1 more minute and if it won't reacquire the signal it will repeat the whole procedure until positive effects (but you can also use some conditions aborting the script after several tries - it's up to you). In the meantime the script will write some meaningful information to SD/Tasker/log/reacquire_radio_signal.txt file.

Below you can find the script contents. You can save it as XML file and then import it directly to Tasker. It is not very tested so watch your back (and phone) :)

Profile: ReacquireRadioSignal (49)

Priority: 6 CoolDown: 60

State: Variable Value %CELLSRV, Matches, *emergency*

Enter: ReacquireRadioSignal (47)

Stay Awake

A1: Variable Set [ Name:%COUNTER1_MS To:1 Do Maths:Off Append:Off]

A2: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0]

A3: Stop [ With Error:Off] If [ %CELLSRV ~ *nopower* ]

A4: Stop [ With Error:Off] If [ %CELLSRV !~ *unknown*/*noservice*/*emergency*/*nopower* ]

A5: Variable Add [ Name:%COUNTER1_MS Value:1 Wrap Around:0]

A6: Goto Action [ Number:2] If [ %COUNTER1_MS < 72 ]

A7: Variable Set [ Name:%COUNTER2_MS To:0 Do Maths:Off Append:Off]

A8: Goto Action [ Number:16]

A9: Variable Set [ Name:%RADIOSTATUS_MS To:0 Do Maths:Off Append:Off]

A10: Stop [ With Error:Off] If [ %CELLSRV ~ *nopower* ]

A11: Variable Set [ Name:%RADIOSTATUS_MS To:1 Do Maths:Off Append:Off] If [ %CELLSRV !~ *unknown*/*noservice*/*emergency*/*nopower* ]

A12: If If [ %RADIOSTATUS_MS = 1 ]

A13: Write File [ File:Tasker/log/reacquire_radio_signal.txt Text:%DATE %TIME - Signal recovered successfully after #%COUNTER2_MS attempts (strength = %CELLSIG, network = %TNET, cell state = %CELLSRV) Append:On]

A14: Stop [ With Error:Off]

A15: End If

A16: Vibrate [ Time:400]

A17: Music Play [ File:notifications/Alert-Sonar.mp3 Start:0 Loop:Off]

A18: Airplane Mode [ Set:On]

A19: Wait [ MS:0 Seconds:15 Minutes:0 Hours:0 Days:0]

A20: Airplane Mode [ Set:Off]

A21: Variable Add [ Name:%COUNTER2_MS Value:1 Wrap Around:0]

A22: Write File [ File:Tasker/log/reacquire_radio_signal.txt Text:%DATE %TIME - Signal recovery attempt #%COUNTER2_MS Append:On]

A23: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0]

A24: Goto Action [ Number:9]