Cell towers problem

Itsme_jack

New member
Dear reader,

For years i used the cell towers trigger without a flaw. Lately however the cell towers seem not to show and trigger correct. When looking at the recent cell towers it looks like it keeps reporting the cell it was last connected to in a group (cache?). Because of that it dos not trigger the 'leave cell tower group'.
Cell tower trigger was and on a 2 minute interval in the settings. Phone is OnePlus Nord.

Hope someone can help.

Kind regards,
Jack.
 

Itsme_jack

New member
By update you mean adding or removing cell towers to/from the group?

By the way: the problem does not only occur in a specific group but is noticed in several groups.
 

Pseudocyclic

Well-known member
Yes. I would be tempted to delete whichever group is giving the most problems and (very thoroughly) re-create it and see what happens.
 

bd_macrodroid

New member
Hi,
I'm quite new to macrodroid and still experimentating, but I think I can confirm problems with leaving/entering cell tower groups.

The setting:
Phone: Samsung A5 (2017)
Two cell tower groups. Very close to each other but disjoint cell ids.
My Macro is triggered by an entering and a leaving cell tower group trigger per group (in summary four trigger for two zones comined with or). It sets a global variable to a certain string (zone1/zone2/unknown) depending on the trigger.
(When writing it I wondered if this would work espacialy when two trigger accur at the same time. Would macrodroid be so smart to give me the leaving trigger first an the entering trigger reliable as second?)

The Problem:
When the phone changes from a cell-ID in group zone1 to a cell-ID in zone2 I observe the following in the log (all with the same timestamp, content a little bit censored):

[2021-03-08 16:54:40] - Cell towers found = 1
[2021-03-08 16:54:40] - -> <censored-ID>
[2021-03-08 16:54:40] - Checking cell towers against group: Zone zone2
[2021-03-08 16:54:40] - -> Previously in range = false, Currently in range = true
[2021-03-08 16:54:40] - [Zone zone2] Cell tower now in range
[2021-03-08 16:54:40] - Checking cell towers against group: Zone zone1
[2021-03-08 16:54:40] - -> Previously in range = true, Currently in range = false
[2021-03-08 16:54:40] - [Zone zone1] All cell towers now out of range
[2021-03-08 16:54:40] - T: Funkmastenzelle wird verlassen (Zone zone1)
...
<deleted lines of the macro, including the call of a second macro due to the change of the global variable>
...
[2021-03-08 16:54:40] - T: Funkmastenzelle wird verlassen (Zone zone1)

The two lines with the "T:" at the beginning (coloured red in de log in the app) show the problem. The german words "Funkmastenzelle wird verlassen" mean "leaving cell tower (group)".
In the first lines you can see that a zone2 tower is now in range und that no zone1 tower is in range any more. But the two Trigger lines report both "leaving zone1".
The second trigger line is duplicate and wrong. It has to be "entering zone2".

Even worst: the next change of a cell id within zone2 does not trigger anything, because in terms of cell group changing nothing happens:
[2021-03-08 16:57:06] - Checking cell towers against group: Zone zone2
[2021-03-08 16:57:06] - -> Previously in range = true, Currently in range = true
[2021-03-08 16:57:06] - Checking cell towers against group: Zone zone1
[2021-03-08 16:57:06] - -> Previously in range = false, Currently in range = false

I think this is worht a bug report but as a first step I thought of reporting it in this thread.
 

bd_macrodroid

New member
That would be possible but it doesn't explain why there are two events for zone1 and none for zone2.
And I get two "leaving zone1" calls in the macro.

btw: I'm using v5.10.2
 

pg_tips

New member
I have the same problem as @Itsme_jack (or at least a similar one). I'm using LineageOS 17.1 on a OnePlus One. (In case it's relevant, I use MicroG's location provider rather than Google).

When I look at "Recent Towers" (from the three-dot menu in the Cell Towers screen), the history looks a bit like this:

19:32 Cell C
19:32 Cell A
19:27 Cell A
19:23 Cell B
19:23 Cell A
19:20 Cell A

i.e. whenever the cell tower changes, the first cell I connected to (I've called it A) is *always* present. And so, of course, the Leave Cell Area trigger for A's group never fires, and the Cell Towers Out Of Range trigger for A's group is always false.

A is the first entry in its group, if that's relevant

As per @Pseudocyclic 's suggestion, I'll try deleting and recreating the group. Let's see!
 

Pseudocyclic

Well-known member
I deleted and recreated the group, which didn't itself fix the problem. However, I then switched into airplane mode, rebooted the phone and switched airplane mode off again. So far this seems to have cleared the issue!
Ah, that was of course going to be my next suggestion... 🤣
 

pg_tips

New member
I saw the issue happen again, and I think this time I got a better handle on what causes it.

This time, my phone crashed and rebooted itself while connected to cell A. On reboot, it reconnected to cell A.

I can see from the logs that on reboot, the "Enter Cell Area" trigger for cell A's group fired again. In fact, I'd created a diagnostic macro to just log whenever Enter Cell Area or Leave Cell Area for that group was triggered. Obviously what that usually shows is alternating Enter and Leave triggers – but in this case, there are two consecutive Enter triggers - (1) whenever I'd last entered the area before the crash, and (2) just after the crash - without a Leave in between.

Since the crash, the "Recent Towers" once again shows the pattern from my original post. Cell A is always present, even when the phone connects to another cell.

So my hypothesis is that if there's an unexpected reboot of the phone, MacroDroid will never "believe" that it has disconnected from whatever tower it was connected to immediately before the reboot, and therefore the Leave trigger will never fire for that tower's group.
 

pg_tips

New member
I saw the issue happen again, and I think this time I got a better handle on what causes it.

This time, my phone crashed and rebooted itself while connected to cell A. On reboot, it reconnected to cell A.

I can see from the logs that on reboot, the "Enter Cell Area" trigger for cell A's group fired again. In fact, I'd created a diagnostic macro to just log whenever Enter Cell Area or Leave Cell Area for that group was triggered. Obviously what that usually shows is alternating Enter and Leave triggers – but in this case, there are two consecutive Enter triggers - (1) whenever I'd last entered the area before the crash, and (2) just after the crash - without a Leave in between.

Since the crash, the "Recent Towers" once again shows the pattern from my original post. Cell A is always present, even when the phone connects to another cell.

So my hypothesis is that if there's an unexpected reboot of the phone, MacroDroid will never "believe" that it has disconnected from whatever tower it was connected to immediately before the reboot, and therefore the Leave trigger will never fire for that tower's group.
Having watched this for the last few days – I now don't think crashes can be the only reason that Macrodroid gets into this state. I've seen the same behaviour recur several times without an obvious cause – i.e. there is one "stuck" cell, which appears over and over again alongside whatever cell the phone is really connected to, and prevents the Leave trigger ever being fired for the stuck cell's group.
 

pg_tips

New member
Having watched this for the last few days – I now don't think crashes can be the only reason that Macrodroid gets into this state. I've seen the same behaviour recur several times without an obvious cause – i.e. there is one "stuck" cell, which appears over and over again alongside whatever cell the phone is really connected to, and prevents the Leave trigger ever being fired for the stuck cell's group.
Update: I've been working around this for some time by adding "stuck" cells to the global ignore list. The problem though is that it's not just a question of the odd one or two rogue cells. Quite regularly a new cell gets stuck: to the point where I've now had to ignore so many that I often miss real transitions between cells: i.e. I come home, but the phone connects to a cell that's in the ignore list, so no "Enter Cell Area" trigger fires for my home area.

I can probably make something work using wifi SSIDs for location detection, and stop using cell towers, but it would be good to take a look at the bug here.
 
Top