01-25-2018 03:59 PM
1,003 ... 1415161718 ...
tools
  1. nickmax1's Avatar
    Olivier

    I notice that the two events Near Wifi and Wifi Disconnected to clash when you reboot the phone. Now my two events are green (as when i rebooted the phone the phone disconnected from the wifi, and my Near wifi is green as well but isnt firing.
    07-22-2013 06:22 AM
  2. Olivier D's Avatar
    Olivier

    I notice that the two events Near Wifi and Wifi Disconnected to clash when you reboot the phone. Now my two events are green (as when i rebooted the phone the phone disconnected from the wifi, and my Near wifi is green as well but isnt firing.
    Maybe because you're still using wifi polling. I don't use it anymore, but I still keep the technic, as of cells that are near my home, I call them Near home. My Near wifi event has two distinct conditions, one when I'm in the range of my home cells (near home) and the other when i'm not connected to wifi. For me it works just like wifi polling!
    07-22-2013 06:42 AM
  3. nickmax1's Avatar
    No i dont use wifi polling at all (never have)

    My wifi events now look like this:

    Wifi connected:
    When connected to KNOWN WIFIS - set variable wifi connected to yes, variable wifi on to yes, disable mobile data

    Wifi disconnected:
    When disconnected from KNOWN WIFIS - delay 1 minute, thn disable wifi if not connected, variable wifi connected = no and enable mobile data

    Near Wifi
    At Home or Work when disconnected from KNOWN WIFIS - delay 2 minutes then enable wifi, queue an event Wifi Disable (this is a delayed event for 10 seconds, when variable wifi connected = no, then disable wifi if not connected and enable mobile data) - then mobile data off

    I have just noticed that my queued event above in my Near Wifi ignores the condition of the wifi connected variable being no. It enables my mobile data regardless!

    Not sure why i have those delays yet but i noticed that without them and rebooting there was a clash.
    07-22-2013 06:52 AM
  4. Olivier D's Avatar
    No i dont use wifi polling at all (never have)

    My wifi events now look like this:

    Wifi connected:
    When connected to KNOWN WIFIS - set variable wifi connected to yes, variable wifi on to yes, disable mobile data

    Wifi disconnected:
    When disconnected from KNOWN WIFIS - delay 1 minute, thn disable wifi if not connected, variable wifi connected = no and enable mobile data

    Near Wifi
    At Home or Work when disconnected from KNOWN WIFIS - delay 2 minutes then enable wifi, queue an event Wifi Disable (this is a delayed event for 10 seconds, when variable wifi connected = no, then disable wifi if not connected and enable mobile data) - then mobile data off

    I have just noticed that my queued event above in my Near Wifi ignores the condition of the wifi connected variable being no. It enables my mobile data regardless!

    Not sure why i have those delays yet but i noticed that without them and rebooting there was a clash.
    Your Near wifi event is delayed, note that because of that delay, its queued event will fire either 10 seconds after the actual event's conditions are met, or 2 minutes and 10 seconds after.

    I've noticed that variables don't play well with queued events, I guess they only work when in conditions or actions of an event.

    I would suggest for your Near Wifi event (as sometimes you might not be near your known wifis in 2 minutes when entering home or work areas) :
    to make it a repeating event and make it turn "wifi off (if not connected)" in a queued event which is already implemented in Llama, no conditions nor variables needed.
    Attached Thumbnails Llama - Who's Using It and Any Good Examples?-media-20130722.png  
    07-22-2013 07:18 AM
  5. nickmax1's Avatar
    cool - i have deleted all variables -
    My queued event in my near wifi does trigger no matter what condition i put in there, so if I put in as a condition "wifi disconnected from KNOWN WIFI" , disable wifi and enable mobile data and then test that queued event it will enable my mobile data even if my wifi is connected.......weird.

    more testing needed!
    07-22-2013 07:36 AM
  6. calisro's Avatar
    I didn't want to compile rsync myself so I grabbed this APK (https://code.google.com/p/rsyncdroid/downloads/list), downloaded it, renamed it to rsyncdroid-0.4.zip. If you open it in with any of your zip programs, you can pull the rsync executable from the apk. I put that rsync in /data/local/bin (where I install all my binaries and 'chmod +x'. I use that location since you cant use the sdcard to execute binaries directly in shell). I then exchanged keys with my nas and put the resulting key in /sdcard/.ssh/ and set permissions as required by a key exchange.

    Now it is just a matter of running normal rsync like anywhere else. I execute it with SL4A shell because with that localle plugin you can have it execute in the background. Remember this needs root so you'll need to execute rsync like this in the shell script:

    rsync.sh script:
    /system/xbin/su -c "/data/local/bin/rsync -e \"ssh -i /sdcard/.ssh/id_rsa\" -thlvr --delete /sdcard/ root@nas:/some/path/sdcard/"

    I run cyanogenmod so it has the right ssh for this to work. Im sure you can do the same with busybox but I cant test that.
    /system

    My Llama event is simple. When a variable for night = yes and time is between 2am and 6am, run localle plugin SL4A:/rsync.sh.
    07-22-2013 08:40 AM
  7. calisro's Avatar
    To anyone that is having issues with location awareness, these work very well for me. It does use wifi polling when Im close to the home or at home (just incase I get a temporary disconnect) and turns that off when im away. Yopu can import these and take a look if you want. You'll notice I use variables extensively. It is much simpler to keep variables and use other events to trigger off the variables. I don't set anything really in the 'location' events except hte varaibles. My profiles are set in other events and trigger from the variables. I can then reuse these variables for other things (like rsync for example) without rewriting the event.

    These are URLs made using the 'llama share' functionality. It will allow you to import them into your llama by clicking.

    Location Events:
    http://llama.location.profiles/1+-+A...Cp%7C500000%7C

    Profile adjustment events:
    http://llama.location.profiles/1+-+H...7CQuiet%7C0%7C

    For those of you whom are having trouble using the URLs to import them directly into Llama, here is hte english version:

    Event name: 1 - At home
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Enter Area: Home wifi

    Actions:
    Queue another event >
    Event name: 1a - Wifi Polling on home
    Queue delay seconds: 5

    Actions:
    Llama WiFi Polling: 5 minutes

    Llama variable >
    Variable name: loc
    Variable value : home
    Toggle WiFi: WiFi On




    Event name: 2 - Near home
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Enter Area: Home Area
    Not in Area: Home wifi

    Actions:
    Llama variable >
    Variable name: loc
    Variable value : away
    Toggle WiFi: WiFi On for at least 5 minutes
    Queue another event >
    Event name: 2a - wifi polling on near home
    Queue delay seconds: 5

    Actions:
    Llama WiFi Polling: 5 minutes



    Event name: 3 - At work
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Enter Area: Work wifi

    Actions:
    Llama variable >
    Variable name: loc
    Variable value : work
    Toggle WiFi: WiFi On
    Queue another event >
    Event name: 3a - wifi polling on work
    Queue delay seconds: 30

    Actions:
    Llama WiFi Polling: 5 minutes

    Event name: 4 - Near work
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Enter Area: Work Area
    Not in Area: Work wifi

    Actions:
    Llama variable >
    Variable name: loc
    Variable value : away
    Toggle WiFi: WiFi Off(if not connected)
    Queue another event >
    Event name: 4a - wifi polling on near work
    Queue delay seconds: 5

    Actions:
    Llama WiFi Polling: 5 minutes



    Event name: 5 - Near other known areas
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Enter Area: Mom and Dads, Price|Ralph|Susan
    Not in Area: Home Area, Home wifi|Work Area|Work wifi

    Actions:
    Llama variable >
    Variable name: loc
    Variable value : away
    Toggle WiFi: WiFi On for at least 5 minutes
    Queue another event >
    Event name: 5a - wifi polling on others
    Queue delay seconds: 30

    Actions:
    Llama WiFi Polling: 5 minutes



    Event name: 9 - Away from known areas
    Event group (optional): Location/Wifi mgmt

    Advanced...:
    Delay event
    Delay seconds: 30 seconds

    Conditions (match all):
    Not in Area: Home Area, Home wifi|Mom and Dads|Price|Ralph|Susan|Work Area|Work wifi

    Actions:
    Llama variable >
    Variable name: loc
    Variable value : away
    Toggle WiFi: WiFi Off(if not connected)
    Queue another event >
    Event name: 9a - wifi polling off
    Queue delay seconds: 5

    Actions:
    Llama WiFi Polling: Never




    Event name: 1 - Home
    Event group (optional): Profile mgmt

    Conditions (match all):
    Llama variable >
    Variable name: loc
    Current value
    Variable value : home
    Llama variable >
    Variable name: night
    Current value
    Variable value
    Time Between >
    From: 07:30
    To: 22:30

    Actions:
    Profile: Home



    - - - - -
    Event name: 2 - Night
    Event group (optional): Profile mgmt

    Conditions (match all):
    Time Between >
    From: 22:30
    To: 06:30
    Llama variable >
    Variable name: loc
    Current value
    Variable value : home

    Actions:
    Profile: Night
    Screen Brightness: 40%
    Screen rotation: No rotation
    Queue another event >
    Event name: 2a - Night turn off

    Conditions :
    Time Between >
    From: 06:30
    To: 23:00
    Charging Status: Using battery

    Actions:
    Run App Shortcut: Home
    Screen rotation: Rotation on
    Screen Brightness: 80%
    Llama variable >
    Variable name: night
    Variable value

    Llama variable >
    Variable name: night
    Variable value : yes



    - - - - -
    Event name: 3 - Away
    Event group (optional): Profile mgmt

    Advanced...:
    Delay event
    Delay minutes: 1 minutes

    Conditions (match all):
    Llama variable >
    Variable name: loc
    Current value
    Variable value : away

    Actions:
    Profile: Away
    Mobile Data: Mobile Data On


    - - - - -
    Event name: 4 - Work
    Event group (optional): Profile mgmt

    Conditions (match all):
    Llama variable >
    Variable name: loc
    Current value
    Variable value : work

    Actions:
    Profile: Quiet

    Events:
    When 'loc' has a value of 'work' - change profile to Quiet
    07-22-2013 09:04 AM
  8. calisro's Avatar
    DO NOT forget to turn on wifi polling the settings for the events above to work. Don't worry about the interval as the events will take care of that and toggle between 'never' and 5 minutes. These events will need that.

    reference for 'sharing' events:
    KebabApps: Ooo, a social Llama
    07-22-2013 09:06 AM
  9. MathP's Avatar
    Hello Calisro,

    thanks a lot for sharing rsync & scripting method: I may try to setup some rsync with my NAS.

    Regarding WiFi polling, I can't manage to import directly from you links in Llama:
    - is it because there are several events in it?
    - in the end, by using the Human-readable description tool of a Llama event URL created using the share menu, I managed to decode them (but again not to import them directly in Llama

    Did you also configured your Llama configuration to do Juice Defender job (like kurokirasama)? I'm currently studying it

    Regards, Math
    07-23-2013 01:45 AM
  10. calisro's Avatar
    hmm. llama won't launch for me either to import my own from the url. I even tried from gmail on my phone. I edited the above to include the 'english' versions of the encoded URLs for others having issues importing directly to llama.

    I've not done juice defender type things.
    07-23-2013 07:18 AM
  11. npaladin-2000's Avatar
    Hey guys, I skimmed the thread and nothing jumped out at me regarding this, so I figured I'd ask. I've got an LG Optimus G Pro, which I love to death, but my car charger can't keep up with, just because of that (frigging lovely) screen. So what I'm thinking is to figure out a way to throttle the CPU when certain applications (WAZE, Google Maps/Navigation, Car Dashboard, etc) are running, maybe give the charger half a chance to keep up. I was running Waze on the way home today and I actually LOST battery on the way (something like 4%). Obviously disabling GPS and data are not options here, I need to save power other ways if there's any way to do it.

    So anyone figure out how to use Llama to throttle the CPU?
    07-29-2013 06:20 PM
  12. calisro's Avatar
    Hey guys, I skimmed the thread and nothing jumped out at me regarding this, so I figured I'd ask. I've got an LG Optimus G Pro, which I love to death, but my car charger can't keep up with, just because of that (frigging lovely) screen. So what I'm thinking is to figure out a way to throttle the CPU when certain applications (WAZE, Google Maps/Navigation, Car Dashboard, etc) are running, maybe give the charger half a chance to keep up. I was running Waze on the way home today and I actually LOST battery on the way (something like 4%). Obviously disabling GPS and data are not options here, I need to save power other ways if there's any way to do it.

    So anyone figure out how to use Llama to throttle the CPU?
    You can do it with llama and sl4a. If you install sl4a you will be able to run shell scripts as a localle plugin. that script can run a root command to modify the cpu step. You would create say 2 shell scripts. One for your "slow" cpu speed and one for your normal speed. then you would call each one depending on the condition.

    your script would look something like this:

    su -c 'echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'

    that would set the max to 700mhz for example. assuming your kernel supports this.
    07-29-2013 08:03 PM
  13. calisro's Avatar
    Hey guys, I skimmed the thread and nothing jumped out at me regarding this, so I figured I'd ask. I've got an LG Optimus G Pro, which I love to death, but my car charger can't keep up with, just because of that (frigging lovely) screen. So what I'm thinking is to figure out a way to throttle the CPU when certain applications (WAZE, Google Maps/Navigation, Car Dashboard, etc) are running, maybe give the charger half a chance to keep up. I was running Waze on the way home today and I actually LOST battery on the way (something like 4%). Obviously disabling GPS and data are not options here, I need to save power other ways if there's any way to do it.



    So anyone figure out how to use Llama to throttle the CPU?
    btw, they sell better car chargers. ones that will produce 1000ma. I bet the reason your car charger can't keep up is because its crap and only produces a "usb" rate of 300-400ma. my home charger produces 1400ma and my car charger is 1100ma and both can keep up. Most manufacturers don't disclose the output ma. if they don't, its crap. don't buy it.
    07-29-2013 08:19 PM
  14. npaladin-2000's Avatar
    btw, they sell better car chargers. ones that will produce 1000ma. I bet the reason your car charger can't keep up is because its crap and only produces a "usb" rate of 300-400ma. my home charger produces 1400ma and my car charger is 1100ma and both can keep up. Most manufacturers don't disclose the output ma. if they don't, its crap. don't buy it.
    Actually this is one of the 1+ amp ones. Might need a 2 amp.

    Sent from my LG Optimus G Pro using Tapatalk 2.
    07-29-2013 09:24 PM
  15. Olivier D's Avatar
    Actually this is one of the 1+ amp ones. Might need a 2 amp.

    Sent from my LG Optimus G Pro using Tapatalk 2.
    If your device is rooted, in the meanwhile try your Llama event idea with CPU for root users
    07-30-2013 02:03 AM
  16. calisro's Avatar
    (rooted devices only!) Training my Llama to learn shell, python, and intents....

    Requirements: llama, SL4A app, and Python language for SL4A

    I thought i'd share some other interesting things (geeky) I do with llama that involve llama and sl4a. This will be over many people's heads but some may find it door opening. The ability to send variables to llama directly opens the door to extending llama far beyond its current state.

    In talking to the developer he gave me a llama intent that can be executed to set a llama variable outside of the llama program (from the root command line for example). This is entirely unsupported and undocumented btw. This means that I can now execute use OS commands to check phone conditions and report that condition back to llama for action. One example that I use is this:

    When I connect to my work wifi, I want to ensure that my openVPN is always ON when im connected. So I wrote a llama event to do just that:
    Code:
    When ( phone is connected to "work wifi" AND llama variable LOC = work AND screen turns on )  
        Run a shortcut OPENVPN.
    This worked great but I found that it was annoyingly reconnecting everytime my screen turns on. If removed the screen on, then it would only connect when I initially connected to my work wifi and if it became disconnected throughout the day (happens a lot) then that sucked.

    So I changed my action to:
    Code:
    Condition When ( phone is connected to "work wifi" AND llama variable LOC = work AND screen turns on )  
        Run a locale plugin: SL4A: chk-vpn.py
        QUEUE and event named "VPN Fire"         
             VPNFire:  (delay 7 seconds) Conditions When llama variable 'VPNConnected" has a value of 'False' 
                       Run a shortcut OPENVPN.
                       Set llama variable VPNConnected to 'True'
    In the SL4A app, I have the script chk-vpn.py (a python script) check my home network is visable and set a llama variable depending on its status:

    script: chk-vpn.py
    Code:
    import socket
    import subprocess
    #function to do a port check on a particular address.  very lightweight.
    def chk_server(address,port):
        s = socket.socket()
        s.settimeout(4)
        try:
            s.connect((address,port))
            return True
        except socket.error, e:
            return False
    #modify to any open port on your router and your routers internal address
    check = chk_server("192.168.1.1", 80)
    script = "/sdcard/sl4a/scripts/llamavar.sh"
    var = "VPNConnected"
    val = str(check)
    subprocess.call(["/system/bin/sh" , script, var , val ])
    shell script: "/sdcard/sl4a/scripts/llamavar.sh" (referenced by above program)
    Code:
    #!/system/bin/sh
    /system/xbin/su -c "am broadcast -a com.kebab.Llama.SetLlamaVariable --es VariableName $1 --es VariableValue $2 com.kebab.Llama/com.kebab.Llama.ExportedReceiver"
    Now my 2 scripts will check if VPN is in fact connected and let llama know.
    buggy_droid likes this.
    07-30-2013 10:41 AM
  17. calisro's Avatar
    Actually this is one of the 1+ amp ones. Might need a 2 amp.
    I'm not doubting you. But just because it says 1+ amps doesn't mean it is delivering 1+ amps PER PORT. Lots of these multi-usb plug chargers claim 1+ amps when they have multiple ports but only deliver a nominal (less than) 500ma for each port. This is totally off topic of this thread and my apologies to everyone. Anyway best of luck but yes try llama changing your CPU or perhaps your governer to /conservative/ (which can be done also the same way as above).
    07-30-2013 11:22 AM
  18. npaladin-2000's Avatar
    I'm not doubting you. But just because it says 1+ amps doesn't mean it is delivering 1+ amps PER PORT. Lots of these multi-usb plug chargers claim 1+ amps when they have multiple ports but only deliver a nominal (less than) 500ma for each port. This is totally off topic of this thread and my apologies to everyone. Anyway best of luck but yes try llama changing your CPU or perhaps your governer to /conservative/ (which can be done also the same way as above).
    It's one port. Still, it's probably not delivering any more than 1.1 amps, and that probably isn't cutting it. Sorry for hijacking the thread. I should be able to find a 2 amp one somewhere. Of course, if that doesn't cut it I'll still need to do some CPU throttling.
    07-30-2013 09:35 PM
  19. mmmcubed's Avatar
    I can't get the links to work - says "Reload Page" or other error... same with Chrome, Dolphin and Firefox...
    08-08-2013 10:15 AM
  20. calisro's Avatar
    I can't get the links to work - says "Reload Page" or other error... same with Chrome, Dolphin and Firefox...
    Yea. Its supposed to work but must be a llama bug.... Anyway I also pasted a regular text output too.
    08-08-2013 12:17 PM
  21. nickmax1's Avatar
    everyone upgrade to the new llama just released to google play - has some new things in there

    I have done a quick look and some new conditions have been added which is cool
    08-14-2013 08:59 AM
  22. dondove's Avatar
    When Bluetooth(in my truck) connects > launch "Slacker"
    When Bluetooth disconnects > kill with root "Slacker"

    This used to work great but after a couple of recent Slacker updates, kill with root Slacker is buggy.
    08-17-2013 07:13 AM
  23. calisro's Avatar
    When Bluetooth(in my truck) connects > launch "Slacker"
    When Bluetooth disconnects > kill with root "Slacker"

    This used to work great but after a couple of recent Slacker updates, kill with root Slacker is buggy.
    Slacker uses a background service that may restart itself when you kill its process. Is that what you are seeing? You may be able to send slacker an intent to interact with it like to stop playback rather than killing it.
    08-17-2013 07:53 AM
  24. Rodrigo Batista's Avatar
    Is anybody having issues with Llama on JellyBean 4.3? I have the latest Llama from the play store (1.2013.08.10.2211) running on a stock 4.3 phone and am getting a notification saying "Llama could not get root access in time". All actions are performed properly, but I would like to get rid of the notification.

    By the way, I am running SuperSU 1.51 and Llama has been granted su access rights.

    Rodrigo
    08-19-2013 01:56 PM
  25. Olivier D's Avatar
    Is anybody having issues with Llama on JellyBean 4.3? I have the latest Llama from the play store (1.2013.08.10.2211) running on a stock 4.3 phone and am getting a notification saying "Llama could not get root access in time". All actions are performed properly, but I would like to get rid of the notification.

    By the way, I am running SuperSU 1.51 and Llama has been granted su access rights.

    Rodrigo
    I would help you but I'm currently using CyanogenMod and their latest stable is 4.2 based
    08-21-2013 05:35 AM
1,003 ... 1415161718 ...
LINK TO POST COPIED TO CLIPBOARD