Cell tower change detection randomly working

120 views
Skip to first unread message

mysterio...@online.fr

unread,
Feb 20, 2020, 5:20:33 PM2/20/20
to Automate
Hello,

I used Llama for years on Android 4.4, mostly for setting volumes basing on phone cells : it was simple and worked like a charm.

Now I'm having a lot of difficulties doing the same thing on Huawei P20 and Android 9.1, and in particular with Automate.

I made this flow chart ("domicile" means "home" and "travail" = "work") :
https://drive.google.com/file/d/11zjenCtqEn2MkxN34_MGDef2FVuIt3WG/view?usp=drivesdk

The problem I have is that frequently, cell change detection stops working, and flow log is stuck with the message "Cell tower near?". Nothing happens until I restart the flow.

I allowed Automate to run on background and at startup as said in FAQ. I didn't try to put a "Device keep awake" block around the "cell tower near" one, as this would prevent my phone going to power saving state. Anyway I don't think my issue is dued to a battery saving job as it happens when driving with Waze or Google Maps that keep everything on.

Henrik "The Developer" Lindqvist

unread,
Feb 21, 2020, 12:00:32 AM2/21/20
to Automate
Ensure the system Location setting is enabled.
Some device only report nearby cells while the screen is on, try using the Device keep awake block to test if that's the case.

mysterio...@online.fr

unread,
Feb 21, 2020, 7:59:57 AM2/21/20
to Automate
Thank you Henrik, but I thought my message was detailed enough to avoid a standard answer...
Access to approximative location is enabled in the flow options, otherwise cell detection wouldn't work randomly, would it ?
Cell detection is not working when I'm using GPS applications : screen is on, GPS fine localization is on, and CPU is working hard for 3D rendering. It can't be a battery saving issue.
On the contrary, cell changes may be well detected when my phone is in sleeping mode !

Could it be that when fine localization is working, Automate can't get cell changes ? I don't have that problem nor with MacroDroid, nor with Llama (which has other incompatibility issues on that OS).

Also, when I edit a "near cell" block and select cells among those currently found, some of their numbers are incomplete, for example :
lte:::1ec
lte:::c
Is it normal ? If I select one of them, cell check can match in another place where a cell has a similar incomplete number, which I obviously don't want.

Henrik "The Developer" Lindqvist

unread,
Feb 21, 2020, 9:11:11 PM2/21/20
to Automate
The flow need to be granted all "privileges" it requests, e.g. "access proximate location" otherwise it certainly will not work, but, as said, the system Location setting also has to enabled.
If it's not working when the GPS is enabled, it could be because there's no sub-system requesting cell scans, apps cannot initiate scans, but this isn't standard behaviors.
When the device is sleeping apps do not run, so it's impossible for them to get/process any cell updates. To prevent sleep use the Device keep awake block, maybe MacroDroid and Llama does this explicitly.

Any part of a cell can be "unavailable", e.g. TAC, CI, PCI, see:

I don't know why some parts "unavailable", maybe some "privacy" reason, but Google has been crippling cell reporting system for years.
Even "incomplete" cells are report, only cells where every part is "unavailable" is ignored. As you concluded, matching against "incomplete"cells is not advised.

mysterio...@online.fr

unread,
Feb 22, 2020, 6:14:42 AM2/22/20
to Automate
System location is always enabled on my phone, as I'm using many apps that need it.

After a few supplemental checks, it appears that cell check sometimes works when fine location is found, while using GPS apps. Conversely, sometimes it doesn't work with flow log in foreground, that is, neither while getting a fine location, nor while phone is asleep. There is finally no link between fine location and cell scan, nor with phone sleeping.

Do you have examples of cell scan working on Huawei P20 or similar phones with Android 9.1 ? I think we should debug this further. Otherwise my only choice will be to use another automation app.

Henrik "The Developer" Lindqvist

unread,
Feb 22, 2020, 4:39:05 PM2/22/20
to Automate
A simple flow like this should suffice...
1. Flow beginning
2 Cell tower near
Y. Log append; message: enter
N. Log append; message: exit

Enable the "debug logging" option in settings for additional details.

Also, especially for Huawei/Xiaomi devices, please read:

David Spadano

unread,
Mar 24, 2020, 6:23:23 PM3/24/20
to automa...@googlegroups.com
Hello,

I have a Huawei P20 and I also used Llama for years but it becomes to be old regarding Android evolutions.
For exemple, Llama on my P20 stops to report cell changes when the screen is off.

So I decided to do the same thing than you: create a flow that mimic the Llama behavior.
And I can tell you that Automate is running fine to do the Job.

I can't tell you why is running fine on mine but the difference I see with your flow is that I don't use Input Argument to the "When near cell ".
When the changes occurs and I retrieve the cells list, I removed the incomplete cells and I calculate a unique number by cell (the same as Llama) to identify the area.
Because you used Llama you know that to identify an area you need sometimes more than one cell.
So I try to identify the best cell in the list and I looked in which area the cell belongs base on the Exported files from Llama.

For the screen off, I use a fork to do some polling every minute instead of using the "Device keep awake" (maybe it's good too, I don't know I didn't try)

I use this flow for more than 6 months and I never had problems with it.
And I use, like you, Waze, Coyote and Maps in the same time.

I hope this can help you a little...


In the same time, I have some questions about cell for you Henrik :-)

- How can I know which is the best cell, the connected one, the one which is reported in the phone Status/Network page? It the first one of the list ?
- For dual SIM phone, how can I know which SIM the cell belongs to ? And it is possible to include this info in the cell info list ?
- Is it also possible to add the unique number representing the cell like in Llama and many other cell tools and like on the Status/Network page (cd. joined Image the number surrounded in Red)

Screenshot_20200324_231256_com.android.settings_01.jpg

Thanks in advance Henrik !

Henrik "The Developer" Lindqvist

unread,
Mar 24, 2020, 10:07:51 PM3/24/20
to Automate
  1. When you pick a cell or cells, i.e. using the Cell tower pick block, it's sorted by signal strength, so the top listed should be the "best" one.
  2. The Android API doesn't support Dual SIM for cell information.
  3. The cells are already "unique", where the separate parts are concatenated by colon, instead of summed into a single integer.
Reply all
Reply to author
Forward
0 new messages