Flow periodically keeps stopping and disabling
Moderator: Martin
-
- Posts: 96
- Joined: 27 Jul 2014 10:40
Flow periodically keeps stopping and disabling
Hi guys,
I created this flow a while ago that puts a simple notification on the statusbar with some battery info.
Occasionally, and noticeably when i turn the screen on, the flow will crash and disable.
I checked the log i couldn't see anything obvious (i can upload it the next time).
Also i was wondering if someone could help me add battery time left to the notification. I can't find it in the battery supplied variables and i checked in init variable system settings.
Thanks Sam
I created this flow a while ago that puts a simple notification on the statusbar with some battery info.
Occasionally, and noticeably when i turn the screen on, the flow will crash and disable.
I checked the log i couldn't see anything obvious (i can upload it the next time).
Also i was wondering if someone could help me add battery time left to the notification. I can't find it in the battery supplied variables and i checked in init variable system settings.
Thanks Sam
- Attachments
-
- flow_Battery_20141105_223046.xml
- (10.36 KiB) Downloaded 808 times
Re: Flow periodically keeps stopping and disabling
Hi,
I'm just viewing your flow, on the off chance that I might glimpse a reason for a crash.
I hope you don't mind that I write some comments which are probably not related to your crash as I come across things I consider worthwhile to comment about. Mostly where I, for various reasons, may have chosen a different implementation or approach:
- those cascaded "if (battery_health == value)" conditional to assign to Health, I'd probably be using a list, with battery_health used as index into. Assigning to Health would then be Health=getElement(yourlist,battery_health);
- maybe the same for Plugged too
- same for battery_status
- where it says "end = right(middle,2), you're apparently using string operations for getting the last 2 digits.
Instead of a string operation, I'd stick to arithmetics there, like end=middle%100
But I think the whole complex of that battery_temperature script can be greatly simplified, I'd have to dig its purpose on its whole first, before I can come if with a probably arithmetic one-liner. You seem to try to do some string conversion of results on integers, in order to get a fixed point number. Which is most likely unnecessary.
Now as I'm through your script, I still can't tell you why it crashes ...
I'm just viewing your flow, on the off chance that I might glimpse a reason for a crash.
I hope you don't mind that I write some comments which are probably not related to your crash as I come across things I consider worthwhile to comment about. Mostly where I, for various reasons, may have chosen a different implementation or approach:
- those cascaded "if (battery_health == value)" conditional to assign to Health, I'd probably be using a list, with battery_health used as index into. Assigning to Health would then be Health=getElement(yourlist,battery_health);
- maybe the same for Plugged too
- same for battery_status
- where it says "end = right(middle,2), you're apparently using string operations for getting the last 2 digits.
Instead of a string operation, I'd stick to arithmetics there, like end=middle%100
But I think the whole complex of that battery_temperature script can be greatly simplified, I'd have to dig its purpose on its whole first, before I can come if with a probably arithmetic one-liner. You seem to try to do some string conversion of results on integers, in order to get a fixed point number. Which is most likely unnecessary.
Now as I'm through your script, I still can't tell you why it crashes ...
-
- Posts: 96
- Joined: 27 Jul 2014 10:40
Re: Flow periodically keeps stopping and disabling
Thanks for replying.
I don't mind you looking, in fact I'm thankful you've taken the time to look at the flow.
I assumed there would be better ways of writing the scripts, but the flew does work and i could be wrong but smaller scripts in this situation i don't think would cause the flow to stop and disable.
As i said in my original post, it only (noticeably) seems to happen when i turn the screen on, or could it be we the screen is off?
I wonder if you could leave the flow running for a while and see if you have the same issue. It would be much appreciated.
Thanks, Sam
I don't mind you looking, in fact I'm thankful you've taken the time to look at the flow.
I assumed there would be better ways of writing the scripts, but the flew does work and i could be wrong but smaller scripts in this situation i don't think would cause the flow to stop and disable.
As i said in my original post, it only (noticeably) seems to happen when i turn the screen on, or could it be we the screen is off?
I wonder if you could leave the flow running for a while and see if you have the same issue. It would be much appreciated.
Thanks, Sam
Re: Flow periodically keeps stopping and disabling
Oh, "stop and disable" ... that sounds like flow items execute too often within a certain time. I had something funny with a power monitoring flow too, that it would detect (and log) 50 or more changes to power in a second. Seems that you're trying to counter that with that 2 seconds pause. Set flow options such that triggers will be ignored while the flow still executes, instead of (default) parallel execution.
-
- Posts: 96
- Joined: 27 Jul 2014 10:40
Re: Flow periodically keeps stopping and disabling
I have skip execution when instance is already executing, already selected.
That's what i thought too, the flow was being triggered too many times, hence the 2 second delay.
That's what i thought too, the flow was being triggered too many times, hence the 2 second delay.
Re: Flow periodically keeps stopping and disabling
Post here the error message you're receiving and log too. It seems weird if the log doesn't contain any insight about the crash, as you said.
-
- Posts: 96
- Joined: 27 Jul 2014 10:40
Re: Flow periodically keeps stopping and disabling
I hope you can read the log file i attached.
Sam
Sam
- Attachments
-
- log_mail.txt
- (3.36 KiB) Downloaded 801 times
Re: Flow periodically keeps stopping and disabling
"Emergency stop reached, stopping flow execution" in your log file is rather telling, I think.
-
- Posts: 96
- Joined: 27 Jul 2014 10:40
Re: Flow periodically keeps stopping and disabling
But why?
I'm not sure why the flow is being reaching the emergency stop.
This must mean that the flow is being triggered too many times, but shouldn't that problem be fixed by having the flow skip executions if flow is already executing?
The flow triggers are;automagic start up, power source Connected and disconnected and battery level changes when level is more than 0%.
These triggers shouldn't be activating that often that the emergency stop is reached.
Sam
I'm not sure why the flow is being reaching the emergency stop.
This must mean that the flow is being triggered too many times, but shouldn't that problem be fixed by having the flow skip executions if flow is already executing?
The flow triggers are;automagic start up, power source Connected and disconnected and battery level changes when level is more than 0%.
These triggers shouldn't be activating that often that the emergency stop is reached.
Sam
Re: Flow periodically keeps stopping and disabling
The trigger "battery level higher..." executes everytime android reports a change in battery level. That's unnecessery.
You should think triggers as WHEN YOU WANT THE FLOW TO EXECUTE. Is it only when turnig screen on and (dis)connecting charger?
At any rate, you should remove the trigger i mentioned. That would fix crashing. Then, if the flow breaks, you should think alternative way for executingthe flow.
You should think triggers as WHEN YOU WANT THE FLOW TO EXECUTE. Is it only when turnig screen on and (dis)connecting charger?
At any rate, you should remove the trigger i mentioned. That would fix crashing. Then, if the flow breaks, you should think alternative way for executingthe flow.