![]() |
Re: Situations app - bugs, questions, answers, help etc..
Quote:
Quote:
Quote:
Quote:
Br, Heikki |
Re: Situations app - bugs, questions, answers, help etc..
Thanks for your blind work :)
The application seems to handle neatly cell towers. I can confirm that there are settings to handle the possibility to use 2 sims. You can activate one or two sims, and then you can choose one or the other for mobile data. So activating mobile data for 'situations' needs likely to add which one... |
Re: Situations app - bugs, questions, answers, help etc..
I have been using Situations for a while.
It works well with switching wifi on and off depending on whether I'm home or not. Now I am trying to activate BatteryBuddy when the charger is connected, and deactivate it when the charger is disconnected. I figured out that I need the Command module for both actions, because I just want to launch the daemon. So I have: Name: Charging When: Device = Charger What: Command: harbour-batterybuddy-daemon What: log to situations-buddy-on.txt This works as expected. (*) Name: Not Charging When: Device != Charger What: Command: /home/nemo/situations/kill-batterybuddy-daemon <=== Problem here What: log to situations-buddy-off.txt This works so far that the situation changes correctly when I disconnect the charger, but the command does not: first I just used "killall harbour-batterybuddy-daemon". This works when executed on the command line (ssh), but not through Situations. Then, I wrapped it in a shell script. Again, this works when executed on the command line but not through situations. (*) Nothing helpful in the logs (just START/STOP messages). I told the kill script to log its activity, too, but it logs only when executed manually. Which leads me to believe that Situations does not execute the kill script at all. Why? (*) I am confirming with 'ps aux | grep buddy'. |
Re: Situations app - bugs, questions, answers, help etc..
Progress.
The command script now executes. I had to use the full path when calling it. I had to change the script so that it takes a START and STOP option, and added full paths to all commands just to be sure, as well as some narrative for the logs: Code:
#!/bin/bashWhen executed manually, "$HOME/situations/situations-batterybuddy.txt" contains: Code:
nemoCode:
nemoPS: this is academic; at this point itwould be much more practical to just leave BatteryBuddy running and do its thing without help from Situations, but I want to know why the Command plugin isn't doing what I think it should. |
Re: Situations app - bugs, questions, answers, help etc..
Quote:
Hard to say what the problem is, since I had no problems running your script with the command action. I'm running Situations 3.2.258 on Sailfish 3.3.0.16 (Jolla 1). Which Situations & Sailfish version are you on? Br, Heikki |
Re: Situations app - bugs, questions, answers, help etc..
By the way, you don't need two situations to execute the scripts. You can add one command action with the "START" argument and another command action with "STOP" argument to the same situation. You just need to select "At situation end" for the latter one.
Br, Heikki |
Re: Situations app - bugs, questions, answers, help etc..
^ thanks for the tip, already implemented!
SailfishOS 3.3.0.16 Situations v3.2.258 Sonar 0.0.5 I solved it! Something weird happened to the input field for the command for When = Charger. I moved around in it with arrow keys (special keyboard layout) and suddenly there was more text than there was before. I erased it. Still didn't work. Then I looked at ~/.local/share/harbour-situations2application/harbour-situations2application/situations2/situations.json and found that the command entry had a superfluous '\n' at the end, like so: ... START\n Apparently this was passed to the shell script _literally_ so that the case/esac did not match. I removed it manually (edit the .json in nano). Solution: - no newlines at the end of the command and/or - add a * to the case/esac options: START*) STOP*) It is working now, batterybuddy-daemon is active when I plug the charger in, and stops when I unplug it. It just takes a couple of minutes to switch states; I guess that's by design (taking less resources). |
Re: Situations app - bugs, questions, answers, help etc..
I am trying to implement the following _without GPS_:
- switch on the Wifi when I'm home - switch it off when I'm away I have been using the Network cells condition; it scans and finds 2 cells - does that mean cell towers? It's been working so-so, sometimes it recognizes when I'm home, sometimes not. Is there a better way? I guess I cannot scan for my home wifi ssid when wifi is off? Additionally I cannot concatenate the 2 Home/Elsewhere conditions into 1 because I cannot choose Wifi state a 2nd time in the same condition (to switch it off at condition end, instead of switching it off in a separate condition, as hhaveri told me). Why? |
Re: Situations app - bugs, questions, answers, help etc..
Quote:
First of all, if I remember correctly. it does not work well on Sailfish when the device is sleeping -> Situations might recognise cell changes only after user wakes up the device. Secondly you need to cover (record) cells in all network technologies (2G/3G/4G/...) and over a long time span to make it as reliable as possible. But of course the location accuracy then suffers. Quote:
Br, Heikki |
Re: Situations app - bugs, questions, answers, help etc..
Quote:
So does that mean more is better (when Situations is scanning network cells)? I collected 8 cells with 2 sim cards, switching all available network modes (2G/3G/4G - took almost half an hour), and still Situations immediately recognizes my "Home" Situation, so that proves that logic wrong. I will now test how it fares when I leave home, and if it generally switches Wlan off reliably. |
| All times are GMT. The time now is 09:19. |
vBulletin® Version 3.8.8