Page 1 of 2

Store GSM cells at Wi-Fi

Posted: 24 Jan 2015 09:51
by Nerey
Here my group of flows
It stores a CID of GSM cell in a list if phone connected to any Wi-Fi network
You can use it in your flows if want enable wi-fi atomatically only where it avalible

Flows:
Cell at Wi-Fi - main flow, stores and removes cell's CID from list according to connected wi-fi or not.
Check enable - disables main flow when Wi-Fi is set to off. Just to reduce battery usage
Clear unused pending - it removes old unfinished records

Global variables:
global_current_cid - current cell's CID
global_wifi_cells - list of cell's CID where Wi-Fi avalible
global_wifi_name_cells - map with wi-fi name associated with cell's CID
global_wifi_cells_delete_pending - store how many time (x10s) Wi-Fi was unavalible, delete when reach 160s
global_wifi_cells_add_pending - store how many time (x10s) Wi-Fi was avalible, delete when reach 70s

Install:
Just import flows

Note:
I have to use trigger "Phone Cell GSM: Disconnected to CIDs { global_current_cid }" because it is the only way to trigger on every cell change.
There is an "WiFi Connected" condition in main flow - it is black list for Wi-Fi names. You can add there your mobile Wi-Fi names, like notebook hotspot, other Android WiFi hotspot or mobile Wi-Fi modem

Last version: http://automagic4android.com/forum/view ... 490#p10490

Re: Store GSM cells at Wi-Fi

Posted: 24 Jan 2015 09:57
by Nerey
And other thoughts
CID of current cell is not very accurate way to determine position
GPS - very energy-intensive
I thought about using of neighboring_cells, but it don't accurate too
Is there other way?
Or Mike, maybe it is possible to get a map with CIDs and its signal strength?

Re: Store GSM cells at Wi-Fi

Posted: 18 Jun 2015 07:03
by mactoolz
Hi,

where can i see the global variables if the flow "check cell" runs.
At globals vars i dont see all needed vars for all flows.

Thanks.


MacToolz

Re: Store GSM cells at Wi-Fi

Posted: 18 Jun 2015 07:18
by Nerey
Hi
All variables must be created automatically when needed
Is there some problems with it?

Re: Store GSM cells at Wi-Fi

Posted: 18 Jun 2015 07:45
by mactoolz
Hi,

yes, the problem is i see not the new operator or an assignment.
The flow check all 10s the expression after wifi cinnected etc.

When will the variable generated?


MacToolz

Re: Store GSM cells at Wi-Fi

Posted: 18 Jun 2015 07:55
by Nerey
global_current_cid should be generated if WiFi is on and there is cid avalible
global_wifi_cells_add_pending should be created if there is no change in 10 seconds and WiFi name is not in "black" list
global_wifi_cells and global_wifi_name_cells should be created if it is enought to add first cell to list
If it is not, please, try to create blank list global_wifi_cells, global_wifi_cells_add_pending and global_wifi_cells_delete_pending, blank map global_wifi_name_cells

Or in the evening I'll send new version, maybe it can help

Re: Store GSM cells at Wi-Fi

Posted: 18 Jun 2015 16:02
by Nerey
Try this flows
Added new variable global_wifi_low_priority
You must create list and add there WiFi names in black list

Re: Store GSM cells at Wi-Fi

Posted: 19 Jun 2015 11:27
by mactoolz
Hi,

the problem is still limited there. It must all variable that are created are better prepared in an initialization flow.
So you can then export it global variable indirectly.

especially if you are accidentally deletes this not this created.

Variable used in methods are not automaticly created as a new object.
The difference is because the if in a script or wherever held an assignment, they will be created implicitly variable globally.

Is that correct ???

thx

MacToolz

Re: Store GSM cells at Wi-Fi

Posted: 19 Jun 2015 11:35
by Nerey
Sorry, I can't understand you
But you can be sure, when I changed my phone I didn't created any variable but flows work correct
Can you show me log?

Re: Store GSM cells at Wi-Fi

Posted: 24 Jun 2015 07:50
by mactoolz
Hello,

i have a completely new version. I've completely changed. Can I upload here. There are new flows.

0000_CheckCell Global VAR Init -> you need to make all the needed global variable to declare
000_CheckWidgetAutoCellWifi -> is its own widget where you are stopped in the Main flows
001_Main -> the main flow of all flows managed
002_Check cell -> monitors the location cell
002_Check enable -> monitors the hardware

Then I have another synchronized flow in the Main. From another topic.
When invoked the then all needed modules such as GPS, WLAN, etc. are turned off. If you place all be switched on again.

I have own widget to start and stop the main flow ..

All my processes working without trigger. I am of the opinion that the trigger behave strangely. Partial be trigger again triggered even though the flow is already working.
The complete constellation of the trigger can not cover you. Therefore, these processes are designed and working safely.


Should I flows upload here or create a new topic?

MacToolz