Hacking the Casio G-Shock GW-B5600 BLE - Other SmartWatches

Hello all, this is my first post here!
In this article I will explain my method of hacking the Square G-Shocks that make use of a Bluetooth module (I have a GW-B5600, but it should theoretically work on the GMW-B5000 too) with the goal to create our own Android app that will allow to get info and set the watch via BLE (Bluetooth Low Energy) commands/requests.
The tools I am using are: (sorry no link I am too new)
nRF Connect for Android by Nordic Semiconductor from the Play Store
Wireshark desktop (Windows/Mac) from the official website
The official "G-Shock Connected" Android app from the Play Store
And adb that can be found in the Android platform tools (by default in "C:\Users\usrname\AppData\Local\Android\Sdk\platform-tools")
Your phone does not need to be rooted but needs the Developer options enabled.
1 Discover the services offered by the G-Shock
I am using nRF Connect installed from the Play Store to scan for BT devices.
Long-press the (C) (bottom left) button on the B5600 to enable BT on the watch.
Hit Scan in nRF and search for "CASIO GW-B5600" and tap it to show the following details:
Code:
Device BT Name: CASIO GW-B5600
Device BT Address: [B]EB:1C:FF:90:C2:34[/B]
Offered services: 0x1801 Generic Attribute
0x1800 Generic Access
0x2A00 (R) Device Name
0x2A01 (R) Appearance
0x1804 Tx Power
0x2A07 (R) Tx Power Level
0x26EB00 0D Unknown Service
(UUID 0x2902 for all)
[B]0x26EB002C (W*) Custom Service #2C[/B]
[B]0x26EB002D (NW) Custom Service #2D[/B]
0x26EB0023 (NW) Custom Service #23
0x26EB0024 (NW*)Custom Service #24
(R) is read only (W) write (W*) write no response (N) notify.
The important information has been set in bold: the BT address that we will use to analyze the packets, and the 2 services that I called #2C and #2D that are used by the official G-Shock app to get and set info from/to the watch.
2 Enable Bluetooth traces on the phone
After that, open the phone Developer options > Enable Bluetooth HCI snoop log.
Or use the USB debugging mode, plug the phone to the computer and type the following command in a prompt:
Code:
adb shell settings put secure bluetooth_hci_log 1
To know where the BT traces will be stored, type the following command:
Code:
adb shell cat /etc/bluetooth/bt_stack.conf
and look at the line starting with 'BtSnoopFileName=' to locate the BT log files.
3 Capture BT activity and save the logs on computer
Install and run the "G-Shock Connected" app on your phone from the Play Store.
Do manipulations between the watch and the app, take note of the time you make them.
Then plug the phone and type:
Code:
adb pull /data/log/bt/btsnoop_hci*.log
Note: the place and name of the logs are for my Huawei Mate 10. You will need to adapt the path with the one you got at step 2.
4 Analyze the BT traces in Wireshark
Open Wireshark and drag and drop one of the "btsnoop_hci*.log" files pulled to the computer onto the program.
Add a filter on the G-Shock BT address we got from nRF Connect at step 1:
Code:
bluetooth.addr==EB:1C:FF:90:C2:34
And hit enter to see the BLE activity on the watch.
Now the fun (or the boring part, it depends ) begins... Understanding the BT requests/answers (get info) and BT commands (set info)!

In Wireshark, the important information for each BT frame are contained in the fields
Bluetooth Attribute Protocol > Handle > UUID
and in Bluetooth Attribute Protocol > Value
The very first -easiest- command I was able to identify is the one to Get and Set the Home City and the 5 World Time (WT) Cities.
When you analyse the BT packets, you can see the name of the cities written in all letters in the Value field:
Code:
0000 1f 01 48 4f ..HO
0010 4e 47 20 4b 4f 4e 47 00 00 00 00 00 00 00 00 00 NG KONG.........
We can observe that to GET the Home City, we send a Write command with the value 1F00 to the service 0x26EB002C (aka Custom Service #2C). In return, we will receive a notification through the service 0x26EB002D (aka Custom Service #2D) containing an echo of the Command ID (1F00) followed by the name of the Home City in upper-case (e.g. "PARIS").
To SET the Home City is just as easy: we send a Write request to the service 0x26EB002D (Custom Service #2D) with the value 1F00 followed by the name of the new Home City on 18 Bytes (e.g. "PARIS"), tailed with 0x00.
GETting and SETting the 5 World Time Cities is very similar: you only need to use the Command IDs 1F01 to 1F05...

The next command I reverse engineered is the one to set the date and time.
I started to search for the hexadecimal value "07 E4" in the traces (2020 in decimal = the current year). The search returned zero result... If finding a WORD (value encoded on 2 bytes) in big endian* fails, you gotta try searching it in little endian* so I did another search for "E4 07" this time, and bingo! It appears in a SET command starting with the ID 0x09.
* search Wikipedia for "Endianness"
The full structure of the binary value is:
Code:
([B]09[/B]) YYYY MM DD HH mm ss ?? ?? 01 ?? ?? is the milliseconds in big endian(?)
[B]Mon.13-JAN (15:54:10) traces[/B]
([B]09[/B]) E4 07 01 0D 0F 36 0B 01 F2 01 --> 2020-01-13 15:54:11 (,498?)
[B]Wed.15-JAN (15:29:27) traces[/B]
([B]09[/B]) E4 07 01 0F 0F 1D 1E 03 44 01 --> 2020-01-15 15:29:30 (,836?)
You can notice there's a difference in the trace timestamp and the time sent, respectively 1 second and 3 seconds. That is quite normal: I disabled the time synchronization in the watch settings, so the watch time can deviate from the atomic time by a few seconds (the user guide states a tolerance of +/- 15s per month average).

Hey, did you ever manage to get any further with this @mougino ? I've also got one of these watches, and have been playing around with the BLE connection to it. I've managed to successfully set the alarm times and on/off state – but so far haven't had any luck with setting the actual time. I tried writing with the op-code you suggested of 0x09, but it doesn't seem to actually do anything for me.

Up its interesting.

Hope somebody can help me. I'm having trouble getting/setting time on my Casio GW-B5600BC-2BJF. I can get and Set most other things like alarms, home city, etc using the #2D command (Characteristic: 26eb002d-b012-49a8-b1f8-394fb2032b0f), but when I try to set the time, it has no effect. The command does not complain, but does not change the time. Should I be using a different characteristic? Here are supported BLE services on my watch:
[CD:85:24:01:62:17][LE]> connect
Attempting to connect to CD:85:24:01:62:17
Connection successful
[CD:85:24:01:62:17][LE]> characteristics
handle: 0x0003, char properties: 0x02, char value handle: 0x0004, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0005, char properties: 0x02, char value handle: 0x0006, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002a07-0000-1000-8000-00805f9b34fb
handle: 0x000b, char properties: 0x04, char value handle: 0x000c, uuid: 26eb002c-b012-49a8-b1f8-394fb2032b0f
handle: 0x000d, char properties: 0x18, char value handle: 0x000e, uuid: 26eb002d-b012-49a8-b1f8-394fb2032b0f
handle: 0x0010, char properties: 0x18, char value handle: 0x0011, uuid: 26eb0023-b012-49a8-b1f8-394fb2032b0f
handle: 0x0013, char properties: 0x14, char value handle: 0x0014, uuid: 26eb0024-b012-49a8-b1f8-394fb2032b0f
[CD:85:24:01:62:17][LE]>
Here is the command I'm sending:
Wrote to characteristic 26eb002d-b012-49a8-b1f8-394fb2032b0f | value: 0x09 E6 07 03 19 0B 29 07 05 4F 01
Thanks in advance.

seanlano said:
Hey, did you ever manage to get any further with this @mougino ? I've also got one of these watches, and have been playing around with the BLE connection to it. I've managed to successfully set the alarm times and on/off state – but so far haven't had any luck with setting the actual time. I tried writing with the op-code you suggested of 0x09, but it doesn't seem to actually do anything for me.
Click to expand...
Click to collapse
Same here. Did you resolve this? See my message above. Thanks.

izivkov said:
Same here. Did you resolve this? See my message above. Thanks.
Click to expand...
Click to collapse
Nah I kind of dropped it, and haven't picked it up again for quite a while. I'd love to get it working though!

seanlano said:
Nah I kind of dropped it, and haven't picked it up again for quite a while. I'd love to get it working though!
Click to expand...
Click to collapse
OK, I will let you know if I figure it out.
Just curious, are you wring an Android app for the watch?

izivkov said:
OK, I will let you know if I figure it out.
Just curious, are you wring an Android app for the watch?
Click to expand...
Click to collapse
I was planning on having something running on a Raspberry Pi Zero W – I can program, but I've never made an Android app. My plan was to do something in Python, ideally having the Pi Zero running somewhere in my bedroom so that the Casio watch can do the time synchronisation at night. If I can get that working I'd also thought about setting some alarms and reminders for the day ahead, like maybe connect it to a calendar and put any important events into the reminders function of the watch, things that the existing Casio app can't do. An Android app would be a better way of doing this, but I figured I'd get it working in Python first since it's faster for me.

Ok, thanks for the info.
I more or less figured out how to set the time. It involves setting the DST for all world locations first. I guess makes sense, since the casio will update the time for all locations. I still don't understand some things so I will need to figure it out first, and I can share if you are interested.
I am working on an open source Android app to integrate the Casio watch with Google services on android, such as calendar and Alarm ckock. It will not replace the official app. I have been working on this app for about a month now, and got the alarms and now the time setting working. I think the callender integration will be the most challenging, since I don't know what the data means to Casio.
Currently the github is private, because it is WIP, but I will make it public when it is ready.

That would be very cool! I'll be happy to do some beta testing if you end up getting to that stage. Good luck!

@seanlano I have the basic app running, except for the reminders. If you like to try it, here is the github:
GitHub - izivkov/CasioGShockSmartSync
Contribute to izivkov/CasioGShockSmartSync development by creating an account on GitHub.
github.com
It is private, so not sure if you can access it, so let me know.
If you don't want to bother building the APK, I have put it on on my Google drive:
Google Drive: Sign-in
Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).
drive.google.com
I'm curious to see if for you the local time works properly, and the battery level is correct. Where are you located?
Of course, use at your own risk. It might screw up some settings on your watch. In that case, you may have to reset it like this:
Google Drive: Sign-in
Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).
drive.google.com
Ivo

izivkov said:
I'm curious to see if for you the local time works properly, and the battery level is correct. Where are you located?
Click to expand...
Click to collapse
Hey @izivkov, I tried it out and it seems to mostly work!
The time setting worked correctly (I made sure by manually setting the time to be very wrong, and your app brought it back to the correct time). The home time zone (Sydney) was correct too.
However, the battery level didn't work – the Casio app shows my watch at 100% but your app shows only maybe 20%.
The alarms worked well too, although I found that any time I set the alarms it turns off the hourly signal, and the app doesn't have a way to turn it back on (this isn't a big deal though, since it's only a couple of buttons to press on the watch).
Keep up the good work!

seanlano said:
Hey @izivkov, I tried it out and it seems to mostly work!
The time setting worked correctly (I made sure by manually setting the time to be very wrong, and your app brought it back to the correct time). The home time zone (Sydney) was correct too.
However, the battery level didn't work – the Casio app shows my watch at 100% but your app shows only maybe 20%.
The alarms worked well too, although I found that any time I set the alarms it turns off the hourly signal, and the app doesn't have a way to turn it back on (this isn't a big deal though, since it's only a couple of buttons to press on the watch).
Keep up the good work!
Click to expand...
Click to collapse
Hey, thanks for the feedback.
- I did not notice the hourly signal setting and will fix it. Possibly add a setting to the app to turn it on/off.
- For the battery level, I was not sure I was getting the right value, but for me seemed to be about right. Obviously, should look at other ways to set it.
- I'm working on Calendar events integration with Watch's reminders, and when I finish this and fix these issues you mentioned I will have another version and will let you know.
Cheers

izivkov said:
Hey, thanks for the feedback.
- I did not notice the hourly signal setting and will fix it. Possibly add a setting to the app to turn it on/off.
- For the battery level, I was not sure I was getting the right value, but for me seemed to be about right. Obviously, should look at other ways to set it.
- I'm working on Calendar events integration with Watch's reminders, and when I finish this and fix these issues you mentioned I will have another version and will let you know.
Cheers
Click to expand...
Click to collapse
Hay, thanks for starring my github. I moved the code to another repository: https://github.com/izivkov/CasioGShockPhoneSync, which is now public. Feel free to star the new one. ;-)
Basically, I added Google calendar event support, and fixed the issue with hourly chime getting reset. Still cannot figure out how the battery level is read. I get a value using command 0x28, but the value does not make sense. I get back something like 0x28 0x0f 0x17 0x00 for about 25% charged battery, and 0x28 0x13 0x19 0x00 for almost fully charged one. I think I will disable the battery icon until I can figure what is going on.
Anyway, adding some documentation now. Hope other people can contribute to this project and possibly support more watch models.

I'm a bit stuck. I'm trying to detect the difference between GW-B5600 long-press lower left button and short-press lower-right button as far at connection to the Android device is concerned. The app on the phone should be able to tell the difference, becase the official app acts differntly when the right button is pressed, i.e. sets the current location. This does not happen for left-button connection. But the data sent to the phone from the watch is identical. If somebody has figured this out, please let me know.

For those who are interested in how to communicate with the Casio G-Shock 5600 BT watches, here is the latest github I created:
GitHub - izivkov/CasioGShockSmartSync
Contribute to izivkov/CasioGShockSmartSync development by creating an account on GitHub.
github.com
And you can get the android app on PlayStore:
Casio G-Shock Smart Sync - Apps on Google Play
Add Smart functions to your Casio G-Shock Bluetooth (B5600, B5000, B2100) watch.
play.google.com
Enjoy

I've been working on a very similar app but for a slightly different Casio model. I'm not very familiar with the BLE and getting to a point where I'd happily pay someone for investigating the communication.
Would anyone be willing to figure it out?

drunkenHiker said:
I've been working on a very similar app but for a slightly different Casio model. I'm not very familiar with the BLE and getting to a point where I'd happily pay someone for investigating the communication.
Would anyone be willing to figure it out?
Click to expand...
Click to collapse
Sure, I can take a look. You can contact me by email directly at [email protected], or better still you can post to the github repository:
izivkov/CasioGShockSmartSync · Discussions
Explore the GitHub Discussions forum for izivkov CasioGShockSmartSync. Discuss code, ask questions & collaborate with the developer community.
github.com

Related

How to interrupt ACTION_CALL

I'm a new android developer working on an extremely simple app and I just need a quick pointer! My app, once started, needs to call a certain phone number. This part was simple and works fine. However, I need that call to end after a specific amount of time (10 seconds is the number I'd like).
At this point I'm unsure how to proceed. I've tried spawning a thread that simply waits for 10 seconds, and then tries to call finishActivity() on the activity that I originally started. However, I'm assuming that one thread can't control another threads activities, so this clearly doesn't work. I've also tried a few other methods and none of them seem to work, or they simply crash my app.
If someone can even give me just a high level overview of what I need to do that would be great! My next thought is to spawn a timer thread and use RPC to call a function that will activate finishActivity() in the thread that is running the activity.
Any information you guys can provide me with will be fantastic!
The API won't let you, however, you could try to switch ON airplane mode and the switch it OFF, the inconvenience of this is that all your active connections will be droped (3G, GRPS, Bluetooth, WiFi)
Are you sure its not possible? Using various callbacks I've sent finishActivity() to the action with success. The problem is that there are no callbacks that occur around the time that I want the call to end.
Since it does work with callbacks, I was tempted to have finishActivity() be called when the app is backgrounded. That way after 10 seconds I can just hit the home key and it will close the app down entirely? Not exactly what I want, but could work for now.
Due to the fact that it can be finished during a call back I think it must be possible, I'm just not sure how to go about achieving it. Does anyone have any ideas?
Try the following code:
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
Class clazz = Class.forName(tm.getClass().getName());
Method m = clazz.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony it = (ITelephony) m.invoke(tm);
it.endCall();
But you need to get ITelephony.aidl from Android sources and compile it.

[TUT] Tasker - Total Data Connection & Sync Control V4 [MASSIVE Battery Savings!!!]

[TUT] Tasker - Total Data Connection & Sync Control V4 [MASSIVE Battery Savings!!!]
Assuming your device is already very battery efficient because you are using my CPU profiles from here, next up is controlling your data connections and syncing schedule.
New to Tasker? Call yourself a geek?! Delete your XDA account immediately or get a free trial from here
The Theory
In order, the most important things in my life are as follows:
1) Preserving my phone’s battery life.
2) Sexually satisfying my girlfriend.
As you can see, it’s pretty important for me that I can get through a couple of days with medium usage without having a panic attack about the distance I am from my charger. Download my DistanceFromCharger profile here (just kidding).
So, I looked at my data connections and their battery usage when my scheduled once hourly sync of widgets, emails, facebook, twitter, rss etc etc took place. Without extensive testing, it became clear that these synchronisations became misaligned from the hourly slot due to data quantity, connection time/errors etc etc. Over time, it is therefore theoretically possible to have 10 applications/widgets/processes causing a data sync separately every six minutes (60 mins/10) and although some might say that the total data volume may be the same overall, the act of using the data connection so many more times tells me it will use more battery life. Do you concur?
Even if you don’t (liar!), the following Tasker profiles are to completely manage your wireless connectivity and prevent syncing of unwanted applications at misaligned times.
The Practice
My phone starts its day set to 2g networks only, data connection off, wireless off, screen brightness set so low I need there to be solar eclipse for me to see it and all system volumes set to only alert nearby dogs that I have a text message – all naturally for maximum battery preservation. Depending on the day, my location, calendar entries etc Tasker selects a relevant profile for me to use.
For the benefit of the profiles below, I am going to assume the phone starts in full battery saving mode and go from there. Once you’re up to speed with the flow of the profiles, you can adjust them accordingly to suit your usage.
Firstly, I learnt pretty recently that a wireless connection actually uses less battery than 3g (yes, honestly) and therefore whenever I sync data, I look to use wireless first. For those with constricting data plans, I’m assuming this suits you too?
Wireless states to consider:
On
Off
On and connected to a preferred network
On and connected to an open network
On but not connected to a network
On and recently disconnected from a network
I think that just about covers it?
Download and install Locale Execute Plug-in free from the market here. Import all the profiles (un-tick them) and tasks and with the relevant profile and tasks open (it will make a whole lot more sense then), follow the guide below.
Before we can look at the syncing profile itself, we need to set up some variables for the above first. For battery preservation, I couldn’t have an individual profile for each of the above, as many of them would be active at the same time and constantly on - After a lot of head scratching (and I mean a lot) I came up with the profile WIFI-OnCon let’s have a look at it:
We start with the state of ‘Wifi Connected’. This state means wifi is connected to a network (rather than just ‘on’). The task WifiOnConVar firstly runs a separate task WIFIPREFCON.
WIFIPREFCON writes a text file containing the standard wifi info variable %WIFII (you can take a look at the output file for your information). The next step is to extract just the SSID from the file so Tasker can set this as a variable %WIFIPREF (short for a wifi preferred network). The task ends with speech for you to test the variable has been set correctly (make sure you are connected to a network at the time).
Next, WifiOnConVar sets a variable %WIFIOC (standing for wifi on and connected) to a value of 2. It then sets a variable of %WIFIHOME to the value 2 only IF the name matches that of your home wireless SSID. You can set and add as many of these variables in as you like e.g. %WIFIWORK, %WIFIGIRLFRIENDHOUSE, %WIFIMASSAGEPARLOUR with the IF statement for their respective SSID’s. Setting up these variables is very useful to let Tasker determine your location for use in other profiles, without the need of running GPS or cell tower location profiles (yes, I’m a genius).
Ok, so at the moment, Tasker knows wifi is on and connected (%WIFIOC set to value 2) and you are at home (%WIFIHOME set to your home SSID) (assuming you are testing this at home). A speech task confirms the variables are set.
The next state to consider is when wifi is no longer BOTH on AND connected. We do this in the exit task – the exit task starting when the state of on and connected is no longer true. Firstly it checks if wifi is still on, if it is (goto action 7), it sets the variable %WIFIOC to a value of 3 (another profile reads this shortly) and then clears the name of the preferred network in %WIFIPREF as of course, that cannot be connected anymore…
If the wifi is off, it sets the variable %WIFIHOME to the value 1 and if you have added multiple preferred network variables (%WIFIWORK etc), you should insert that it sets these to a value of 1 too. A speech action confirms the values for your testing purposes (remember, if you delete the speech when you are happy it is working properly, you’ll need to change the Goto Action number accordingly!), the variable %WIFIPREF is cleared as of course you cannot be connected to a preferred network anymore and the task STOPs.
Finally, to complete the wifi control, we need to deal with the wireless still being on, but out of range of a preferred network (that you were connected to). This is definitely a chance to save some battery life, as we’ve all left wifi on by accident when we are not going to be using it. Above, we set the variable of wifi on and connected (%WIFIOC) to a value of 3 when the state became ON but NOT connected. The profile of WIFI-AutoDiscon is set up to come to life when %WIFIOC is set to a value of 3. It activates the task to start a one minute countdown before checking on the wifi state again. This one minute wait allows time where you may have been in a black spot in your office or home and experienced a short disconnection. At the end of the minute, it checks that the value of %WIFIOC has not been changed back to 2 (it has reconnected to a preferred network) and then switches off wifi with your battery giving you a high-5.
That concludes the wireless management. The only missing eventualities are:
On and connected to an open network. (I have little use for this, but can’t sort something out if the demand is high enough).
On and not connected to a network. Not having a profile for this may surprise you, but in actually fact, how often do you turn wireless on when you are not around a preferred network and just leave it? The only reason you would surely do this, is if you were scanning for open networks, in which case a battery saving profile is pretty irrelevant to the scenario. Remember, the state of on and not connected to a network when you were previously connected IS covered, the %WIFIOC variable 3 and the WIFI-AutoDiscon profile monitors this. Happy?
If not, set up a new profile with the state of wifi connected and click ‘invert’ – but this of course will be active when you’re not even using wifi at all…
Taking control of your data syncing
The profile AutoSync is of course time activated, as you would set up your normal ‘between hours’ for email synchronisation. The repeat value sets how often you would like to sync your emails, widgets, applications, weather updates etc etc, by simply restricting their access to an active data connection in-between-times.
The task of AutoSync itself, firstly checks your battery is above a chosen threshold (you decide) to perform the action and that it’s not the weekend (if you want). Again, once you get to grips with the task flow, you can add in separate entries for individual applications, actions etc based on an individual setting – not syncing your work email on the weekend for example.
Action 4 sets a new variable of %WIFIORS. This stands for the ‘original state of wifi’ when the task began and populates using the previously created %WIFIOC variable. The purpose of this is to make sure that once the task has finished it does not turn off wifi if you were in the middle of using it – it will return wifi to the state it was when the task started – clever hey?
Next it uses the third party Locale Execute Plug-in. Locale will be executing commands that will create and record a logcat file for you for the duration of your sync. The purpose of this is so you can review the logcat file and determine what applications are syncing and pulling data. I’ll discuss this further shortly. LOGCAT ACTIONS REMOVED IN LATER VERSIONS DUE TO ERRORS.
The task continues by turning on wifi (if it is already on nothing will change) and waiting to see if it connects to a preferred network by checking the value of the variable %WIFIOC. If a wifi connection is established, it skips to turning on automatic syncing (settings/accounts and sync to view what will sync), if it isn’t, it turns wifi off and uses your phone’s data connection until either eventuality ends up at action 16 where wifi is requested to switch off IF it was off when the task began using the value of %WIFIORS (clever hey).
Mobile Data (added in V4)
Due to popular demand, the context of mobile data has been added as a profile and then to the tasks. Limitations allow the task only to tell if the mobile data is on, it cannot tell if your preferences are 2g only for example. The variable %MOBORS acts in the same way as %WIFIORS above and will not switch off the mobile data connection if it was on at the beginning of AutoSync. As standard, the profiles assume that your device was set to 2g only to preserve battery. The tasks therefore look to return the device to this state. If you always use 3g preferred, you will need to remove these entries.
Finally, logcat commands are run and files are created, renamed with date and time stamp, moved and zipped up for your future perusal.. *LOGCAT ACTIONS REMOVED IN LATER VERSIONS* The task STOPS if %WIFIORS tells tasker that wifi was on originally or it continues on to switch to 2g only and kill the mobile data connection (these wouldn’t have been activated if wifi had connected or already been on).
So there you have it… Full wifi control and full sync management, with not a single byte of data or rouge connection in sight… You are free to switch off your wifi, data connection, uncheck auto-sync (settings/accounts and sync) and go to 2g only. Tick the profile boxes, hit apply and it’s job done.
Don't forget to set all of your applications and widgets etc that will be syncing to just below the AutoSync repeat time!
Give me your feedback please folks and don’t forget the thanks meter! – At the moment I feel very unappreciated
What do I do with the logcat file? *THESE HAVE NOW BEEN REMOVED*
The logcat files are zipped up and stored in the /tasker folder on your sd card. Looking through these will alert you to any unexpected processes that are requesting to send/receive data. These may be applications you don’t use any more and therefore could be uninstalled or archived (archiving can be achieved with applications such as Bloat Freezer).
Another reason I have stored the logcat is so Tasker could read it and therefore confirm which of your applications have successfully synced, or alert you to failures. This is effort to design and I will only go on to do this by popular demand. In addition, Tasker could be used to kill the rouge processes that are lining up to sync, but are unnecessary… Again, you tell me…
What’s next?
Over to you! Please give me your suggestions. These profiles were set up to suit my individual usage and it may be that most of you focus on your mobile data connection management rather than wifi? Don’t be afraid to post and let me know.
Credits
Unknown for zip file profile
Bdanders for wifi variable inspiration
Conclusion
Knowing my phone can remain in deep sleep between syncing times with all data connections switched off has got to be good for battery life? If I ever stop fiddling with my phone for long enough, I'll let you know!
Let me know your feedback please folks, inconsistencies, errors, I’m all ears.
FAQ
Q) I didn't understand the %WIFIPREF variables and how and where I add in my own %WIFIWORK ones etc? Help!
A) A wrote an additional tutorial on how to do this and why here
Q) These profiles always turn my phone to 2g only. I like to use 3g preferred - what do I do??
A) Remove action #21 in the task AutoSync
Q) I don't always want my data connection to be turned off after I sync & I want to leave wifi on if connected to a preferred network.
A) See this post for ideas - credit Nacrul
Q) I don't want to switch between 2g/3g and how do I keep mobile data connections to their original state so I don't disconnect?
A) See this post for ideas - credit lodder
Q) I have many other Tasker questions, can I post them here??
A) To avoid clutter, probably best to use this official Google group
Q) Where can I learn more about Tasker?
A) The manual and Profiles and step-throughs on the Tasker wiki and you’ll be up to speed in no time.
Change Log
Code:
The profiles and tasks include a lot of 'wait' times. These can be reduced to therefore reduce the time you are syncing and the profile is active. They are set to thresholds that ensure enough time is given to each task - you can adjust these manually depending on your device's performance and testing experience.
[B][U]V2[/U][/B]
Additional wait times added to allow data connection more time after switching from 2g to 3g
Added additional example of [B]%WIFIWORK [/B]
[B]%WIFIWORK [/B]& [B]%WIFIHOME[/B] are reverted correctly to a value of 1 in the exit task
Unneeded split variables cleared for good housekeeping - credit Nacrul
Voice-overs removed (if you want to check your variables are assigning correct, add a pop up or speech anywhere!).
Adjusted positions of data connection to prevent lag.
Added time based notifications to show LAST successful sync
New [B]%INCALL[/B] variable added to ensure 2g/3g switch does not happen during calls *
* The [B]%INCALL[/B] variables are already created in my CPU tutorial [URL="http://forum.xda-developers.com/showthread.php?t=1018245"]here[/URL]. If you are not running these, then you'll need to create two simple profiles:
[B]DuringCall [/B]- the event is '[B]phone offhook[/B]' and in the task 'variable set' [B]%INCALL[/B] to a value of 2 (2 = call active)
[B]EndCall [/B]- the event is '[B]phone idle[/B]' and in the task 'variable set'' [B]%INCALL[/B] to a value of 1 (1= no call is taking place)
The above will come in handy in many other profiles I'm sure...
[B][U]V3[/U][/B]
[COLOR="Red"]REMOVED ALL LOGCAT ACTIONS
[Should the running task be interrupted, the logcat may continue to be written to /sdcard/taskerlogcat.txt. Please check that this file is not present! If it is, delete it.] [/COLOR]
If you are really interested in the logcat contents to see what your device is up to when it has a data connection, V2 is stable and works well - the above considered.
Credit (and apologies) for the above - pasteyface
[B][U]V3.1[/U][/B]
Updated incorrect 'goto' action in the exit task [B]WifiDisVar[/B]. Should have been 'goto' action 7 (not 6). Credit [URL="http://forum.xda-developers.com/member.php?u=3311156"]torsrex[/URL]
[COLOR="Red"]Nothing else has changed from V3, so very easy to change for those currently on V3, no need to download and re-install![/COLOR]
[B][U]V4[/U][/B]
Fixed device-asleep notifications
Adding mobile data controls (equivalent to [B]%WIFIOC[/B] and [B]%WIFIORS[/B])
Added WiFi or Data to notifications so you can tell which your device used to sync.
Added Minimalistic Text task for home-screen widget.
Added days of the week as a context
Bugs
'Sync Successful - %TIME' notifications not cancelled when device asleep - Fixed in V4
Future Requests
* Wifi remaining on when certain SSID's detected - I'll write up the instructions for this soon...
* Data connection to remain on if it was on at the beginning of the task - I'm working on it... Added in V4
Installation Instructions
In menu options/profile data 'Import One Task':
WIFIPREFCON.tsk.xml
In menu options/profile data 'Import One Profile':
AutoSync.prf.xml
WIFI-AutoDiscon.prf.xml
WIFI-OnCon.prf.xml
MobileData.prf.xml
The thanks meter lets me know I'm appreciated!
Questions
Questions:
1)
Does these profiles/tasks work out of the box, or do I have to change them to make them work?
2)
"I am going to assume the phone starts in full battery saving mode and go
from there. "
Is this Auto-set by the profiles?
3)
"Import all the profiles (un-tick them) and tasks and with the relevant
profile and tasks open (it will make a whole lot more sense then),
follow the guide below."
I guess un-tick means deactivate. When should I tick (activate) them again?
4)
"It then sets a variable of %WIFIHOME to the value 2 only IF the name matches that of your home wireless SSID. You can set and add as many of these variables in as you like e.g. %WIFIWORK, %WIFIGIRLFRIENDHOUSE, %WIFIMASSAGEPARLOUR with the IF statement for their respective SSID’s"
Do I have to set SSID manually?
5)
You can set and add as many of these variables in as you like e.g. %WIFIWORK, %WIFIGIRLFRIENDHOUSE, %WIFIMASSAGEPARLOUR with the IF statement for their respective SSID’s.
Where/how can i set up those?
6)
"The logcat files are zipped up and stored in the /tasker folder on your sd card"
I can't find any LogCat file in my /Tasker folder...
7)
"Don't forget to set all of your applications and widgets etc that will be syncing to just below the AutoSync repeat time!"
So if the AutoSync repeat time is set to 30 min, the AppSync time should be <29 min...?
/Peter
peswe said:
Questions:
1)
Does these profiles/tasks work out of the box, or do I have to change them to make them work?
Click to expand...
Click to collapse
They work straight out of the box. You only need to enter your wifi SSID in place of the SKYXXXXX and adjust the sync times to suit you
peswe said:
2)
"I am going to assume the phone starts in full battery saving mode and go
from there. "
Is this Auto-set by the profiles?
Click to expand...
Click to collapse
No. If I had to consider all phone conditions from outset, such as wifi on, wifi off and data on, 3g off etc etc it would have been very complicated. It simply assumes all data connections are off and phone is set to 2g, which is the ideal battery saving state.
peswe said:
3)
"Import all the profiles (un-tick them) and tasks and with the relevant
profile and tasks open (it will make a whole lot more sense then),
follow the guide below."
I guess un-tick means deactivate. When should I tick (activate) them again?
Click to expand...
Click to collapse
Once you have made all of the adjustments you see fit (sync time, SKYXXXXX and tested) you can activated them.
peswe said:
4)
"It then sets a variable of %WIFIHOME to the value 2 only IF the name matches that of your home wireless SSID. You can set and add as many of these variables in as you like e.g. %WIFIWORK, %WIFIGIRLFRIENDHOUSE, %WIFIMASSAGEPARLOUR with the IF statement for their respective SSID’s"
Do I have to set SSID manually?
Click to expand...
Click to collapse
In the task WIFIOnConVar a variable is created of %WIFIHOME by matching the SSID with the IF statement.
You can create as many new variables here as you like, such as %WIFIWORK or %WIFICOLLEGE , just put the corresponding SSID in the IF statement. Tasker will look at the IF statement of each and when it finds a match, update the correct %WIFI'LOCATION' to a value of 2 - which means you are there! You can then reference this in other tasks you create - For example when %WIFIWORK = 2, set phone ringing volume to low. In other words, Tasker knows you are at work from the SSID and knows you want your phone to ring quietly when you are there. An exit task could be added so that when you leave, the phone volume increases again....
Get it?
peswe said:
5)
You can set and add as many of these variables in as you like e.g. %WIFIWORK, %WIFIGIRLFRIENDHOUSE, %WIFIMASSAGEPARLOUR with the IF statement for their respective SSID’s.
Where/how can i set up those?
Click to expand...
Click to collapse
As above, in the task WIFIOnConVar, same as action 3. Press +, select variable, select variable set, name it %WIFIWORK (for example), 'to' 2, tick 'IF' and enter %WIFIPREF matches your works SSID. ....
peswe said:
6)
"The logcat files are zipped up and stored in the /tasker folder on your sd card"
I can't find any LogCat file in my /Tasker folder...
Click to expand...
Click to collapse
It won't be created in that location until the profile AutoSync has run.
peswe said:
7)
"Don't forget to set all of your applications and widgets etc that will be syncing to just below the AutoSync repeat time!"
So if the AutoSync repeat time is set to 30 min, the AppSync time should be <29 min...?
Click to expand...
Click to collapse
Theoretically yes. My point was that your widgets, emails, etc etc should be waiting to sync when a data connection becomes active. If they are set to update every 1.5 hours but your AutoSync profile is set up for 1 hour, then they won't sync correctly every time!
Hope this answers all of your questions?
brandall said:
They work straight out of the box. You only need to enter your wifi SSID in place of the SKYXXXXX and adjust the sync times to suit you
Click to expand...
Click to collapse
Could you please tell me were to look (Which Profile/Task?)
brandall said:
You can create as many new variables here as you like, such as %WIFIWORK or %WIFICOLLEGE , just put the corresponding SSID in the IF statement. Tasker will look at the IF statement of each and when it finds a match, update the correct %WIFI'LOCATION' to a value of 2 - which means you are there! You can then reference this in other tasks you create - For example when %WIFIWORK = 2, set phone ringing volume to low. In other words, Tasker knows you are at work from the SSID and knows you want your phone to ring quietly when you are there. An exit task could be added so that when you leave, the phone volume increases again....
Get it?
Click to expand...
Click to collapse
Not really. In this and the next Question I need a full guideline.
If I add a Variable Set for let's say %WIFIWORK. Then I suppose it must have an corresponding Variable Set in the WIFI-OnCon<=Exit Task like %WIFIWORK To 1, and that affects the Goto Action 7 (in the first line).
A little step-by-step info about how to add multiple SSIDs would be nice.
brandall said:
As above, in the task WIFIOnConVar, same as action 3. Press +, select variable, select variable set, name it %WIFIWORK (for example), 'to' 2, tick 'IF' and enter %WIFIPREF matches your works SSID. ....
Click to expand...
Click to collapse
peswe said:
You can create as many new variables here as you like, such as %WIFIWORK or %WIFICOLLEGE , just put the corresponding SSID in the IF statement. Tasker will look at the IF statement of each and when it finds a match, update the correct %WIFI'LOCATION' to a value of 2 - which means you are there! You can then reference this in other tasks you create - For example when %WIFIWORK = 2, set phone ringing volume to low. In other words, Tasker knows you are at work from the SSID and knows you want your phone to ring quietly when you are there. An exit task could be added so that when you leave, the phone volume increases again....
Click to expand...
Click to collapse
Not really. In this and the next Question I need a full guideline.
If I add a Variable Set for let's say %WIFIWORK. Then I suppose it must have an corresponding Variable Set in the WIFI-OnCon<=Exit Task like %WIFIWORK To 1, and that affects the Goto Action 7 (in the first line).
Click to expand...
Click to collapse
Yes, your understanding is correct! I know this can get a little confusing, but having these %WIFI'location' variables created can really come in handy in other profiles. In the next post I'll type a detailed explanation and update the FAQ so others can follow.
Creating location based wifi variables
A little tutorial for you:
In the task WIFIOnConVar the first action is to run a separate task called WIFIPREFCON (standing for 'wifi is connected to a preferred network'). To view its actions, click on tasks on the main Tasker page and scroll down to select WIFIPREFCON.
You'll see that it uses the inbuilt 'wifi information' variable (%WIFII) and writes the information it contains to a text file called wifii.txt on the route of your storage card. Make sure you are connected to a wireless network and press the 'test' button. The file will then be created and you can use your file explorer to view its contents.
The only information we require from this text file is the SSID (the public name of your wireless network). In the task WIFIPREFCON, the next step is to extract ONLY that, by 'splitting' (using variable split) the text file before and then after the SSID. This snips out the SSID and writes it to a new variable we create called %WIFIPREF.
So, at this point, when wifi is on and you are connected to a network, the SSID of that network will be contained in the variable %WIFIPREF. Back over in the task of WIFIOnConVar, tasker is setting the variable of %WIFIOC (on & connected) to a value of 2. (1=not connected 2=connected 3=recently disconnected). Our newly created %WIFIPREF variable contains the SSID name of your current connection. The next action is to set a variable that it matches. A variable is only set to a value of 2 (2=connected) >>IF<< the SSID name stored in %WIFIPREF matches the SSID you enter in the IF statement.
For example, my home SSID is SKY12345, so if I was creating the action from scratch +,variable, varible set, name = %WIFIHOME, To 2 , IF %WIFIPREF ~ (matches) SKY12345. You should add in ALL of your frequently used preferred networks in the same way:
name = %WIFIWORK, To 2 (connected), IF %WIFIPREF ~ (matches) Linkys12345.
name = %WIFIPARENTS, To 2 (connected), IF %WIFIPREF ~ (matches) BT-HomeHuB12345.
name = %WIFIGIRLFRIENDSHOUSE, To 2 (connected), IF %WIFIPREF ~ (matches) VIGIN54321.
This way Tasker can always determine where you are if you are connected to a preferred wireless network.
Why is this useful though? There are many profiles kicking around that use GPS or cell tower location so Tasker can estiblish your location. Such profiles can be battery intensive, so avoiding using them would be a bonus whenever possible.
Let's use a scenario:
You are at your girlfriend's house and your last AutoSync used her wireless network. Tasker will know that you are there because %WIFIPREF found her SSID, saw it matched the IF statement in %WIFIGIRLFRIENDSHOUSE and updated the value to 2 (connected). Imagine you are cheating on her and you set up a profile that activates when you are at your girlfriend's house (%WIFIGIRLFRIENDSHOUSE=2). The CheatingProfile reacting to %WIFIGIRLFRIENDSHOUE being updated to a value of 2, diverts all calls from your other girlfriend directly to voicemail, changes the text message recieved profile for just her to silent, copies the text message to a zip folder on the SD card and deletes her message from the inbox, before automatically reply to her saying "stuck in traffic, no hands free, battery low, catch you later princess, love you enternally xxx" Get it?
Another one:
You are at work. When you are at work you use your PC to check your emails and therefore to preserve battery you want to change your AutoSync shedule to 3 hours apart. This can be activated when Tasker sees that %WIFIWORK has been updated to a value of 2. It could also lower you ring tone volume and change it to something more business-like. Really pushing the boundaries it could read your calendar, check when you're next entry label is set to 'busy', read the location information within the entry, check the distance using an HTTP GET command for directions and load up sat Nav for you 5 minutes before the time it's read from google maps you would have to leave the office to get there! Not forgetting to change your AutoSync back to its normally interval. Oh and in your rush to leave, if you forget to turn off wifi, don't worry though, the profile WIFI-AutoDiscon will do it for you in one minutes time
Yes, with Tasker, the possibilities are endless, I just wish it could actually get me a girlfriend, let alone 2!
I really hope that's helped you understand how having location variables ready to use can assist you further in whatever profiles you choose to create.
Don't forget, that for every new location variable you set in WIFIOnConVar you will need to add the equalivalent entry into the exit task. An example is already in there under %WIFIHOME being set back to a value of 1 (disconnected). And finally, don't forget to change the first GoTO action so it points to the correction action after STOP.
I've just realised, that they also need to be added in to change the values to 1 in the profile WIFI-AutoDiscon - Oops! I'll do that in version 2.
Credit peswe for making me realise this!
Any questions, let me know...
hmmm... Not much interest so far!?
Version 2 out after the weekend - Mainly to prevent 2g/3g switching during a call! Oops...
Any feedback as yet, or suggestions?
brandall, I've subscribed and am interested, I'm just gonna have to try and find some time this weekend to read all of this and see about implementing. I will and will report back
I have juicedefender ultimate and it does all this automatically. Still, kudos to you for the write-up.
Just tested the profiles.
Seems to work so far, but got a question:
Do you need the WIFII1, WIFII2... variables later again? If not you can clean up the variables in the next version
Combined with my homeprofile this setup may replace the my old one
I just read through a bit and one thing I noticed:
Above, we set the variable of wifi on and connected (%WIFIOC) to a value of 3 when the state became ON but NOT connected.
Click to expand...
Click to collapse
This is one of my problems with Android, it can take up to 10 minutes before it realizes that you are out of range of your access point.
For instance, I'm at work with WiFi connected, I put phone in pocket and get in my car for the 10 minute ride home. Tasker is supposed to switch Bluetooth/GPS on for me when Wifi is disconnected. Well, my car's Bluetooth device won't pick the phone up sometimes until I'm pulling into my driveway, because Android is still thinking I'm connected to work Wifi and I'm 5 miles away! This happens on AOSP and OTA and on 2 separate phones, the EXACT behavior. The phone should more aggressively switch from WiFi to 3G.. meaning when I step outside from Work, and I am definitely out of range, it shouldn't require me to wake the phone up so it checks "oh yeah, no WiFi lets switch"
I can improve the behavior a bit by using "Wifi connected" profiles in conjunction with "Cell near" stuff , but that only marginally improves the time and eats more battery..
The bottom line here is Android's WiFi management has some problems and you're stuck with leaving it on all the time or manually managing it
sacredsoul said:
I have juicedefender ultimate and it does all this automatically. Still, kudos to you for the write-up.
Click to expand...
Click to collapse
Thanks for the kudos!
Agreed on juicedefender - it's just something about Tasker that makes me want to use it instead of other applications by replicating what they do... It gets pretty addictive! My next tutorial is how to use it as a task manager and they are ten a penny on the market!
It's just the complete flexibility that Tasker provides, the things you'd love to tweak and adjust on other applications, with Tasker you can...
Nacrul said:
Just tested the profiles.
Seems to work so far, but got a question:
Do you need the WIFII1, WIFII2... variables later again? If not you can clean up the variables in the next version
Combined with my homeprofile this setup may replace the my old one
Click to expand...
Click to collapse
I think you are talking about WIFII2 and WIFI21 in the task WIFIPREFCON?
They are splitting the information contained in the variable %WIFII, which unfortunately doesn't just show the SSID - we have to extract it by showing Tasker where to start reading and where to stop <-- the stop is set by WIFII2 and the output is sent to %WIFII21 = SSID
If you have a look at the text file on your storage card/wifi.txt you'll see what %WIFII originally contained and why it needs dissecting.
That process can be removed if you don't find the SSID useful - but if you read post 8 here, I hope you can see how they are very handy!
Let me know if I didn't answer the right question!
crachel said:
This is one of my problems with Android, it can take up to 10 minutes before it realizes that you are out of range of your access point.
For instance, I'm at work with WiFi connected, I put phone in pocket and get in my car for the 10 minute ride home. Tasker is supposed to switch Bluetooth/GPS on for me when Wifi is disconnected. Well, my car's Bluetooth device won't pick the phone up sometimes until I'm pulling into my driveway, because Android is still thinking I'm connected to work Wifi and I'm 5 miles away! This happens on AOSP and OTA and on 2 separate phones, the EXACT behavior. The phone should more aggressively switch from WiFi to 3G.. meaning when I step outside from Work, and I am definitely out of range, it shouldn't require me to wake the phone up so it checks "oh yeah, no WiFi lets switch"
I can improve the behavior a bit by using "Wifi connected" profiles in conjunction with "Cell near" stuff , but that only marginally improves the time and eats more battery..
The bottom line here is Android's WiFi management has some problems and you're stuck with leaving it on all the time or manually managing it
Click to expand...
Click to collapse
I'm sure you are correct crachel, but I have to say this is not my experience... I don't know why that would be though?
I've tested the WIFI-AutoDiscon in different ways, in different places and each time (even with the phone sleeping and speech updating me of the state) it shuts wifi down in around 1 minute.
Have you looked in the preferences in Tasker and looked what your display on and off settings are? I'm sure you are aware they will eat your battery if reduced dramatically.
None of my profiles are location based and therefore do not rely on these settings. Try them! It should kill wifi in one minute (less if you reduce the wait time).... Whatever you set the interval to in AutoSync is the longest it will take Tasker to realise where you are, as long as you've added in the SSID as detailed here, you can kick off other profiles such as 'work' or 'home' using the created variable %WIFIPREF
The times you normally arrive at work or back home you could have Tasker syncing every 5 minutes to pick this up quicker and then 1 hour at other times...?
You may know all of the above (it's hard to know what level people are at with Tasker), but regardless I hope they help and please let me know your feedback or ideas!
This is a paid app, so I am moving it to the Paid app section.
Im using this variable too, but i delete the unused variables after extracting the SSID. I check sometimes all variables in use with flash all variables and the splitted variable needs too much space for me of not needed. (And also better programming style to delete variables u dont need anymore i think)
Nacrul said:
Im using this variable too, but i delete the unused variables after extracting the SSID. I check sometimes all variables in use with flash all variables and the splitted variable needs too much space for me of not needed. (And also better programming style to delete variables u dont need anymore i think)
Click to expand...
Click to collapse
Thanks for this Nacrul - I can understand clearing the variables is good 'house-keeping', but I didn't consider that not clearing them would take up resource. I've just tested this and indeed the variables %WIFII2 and %WIFII21 contain unnecessary data and clearing them does not affect the content of %WIFIPREF which was my concern.
I'll update this in the next release! (and look over all of my previous profiles!). Thanks again.
ps. 'flash variables' - I always 'speak' them - do you have an alternative method to quickly show their content??
V2 Up
V2
Additional wait times added to allow data connection more time after switching from 2g to 3g
Added additional example of %WIFIWORK
%WIFIWORK & %WIFIHOME are reverted correctly to a value of 1 in the exit task
Unneeded split variables cleared for good housekeeping
Voice-overs removed (if you want to check your variables are assigning correct, add a pop up or speech anywhere!).
Adjusted positions of data connection to prevent lag.
Added time based notifications to show LAST successful sync
New %INCALL variable added to ensure 2g/3g switch does not happen during calls **.
* The %INCALL variables are already created in my CPU tutorial here. If you are not running these, then you'll need to create two simple profiles:
DuringCall - the event is 'phone offhook' and in the task 'variable set' %INCALL to a value of 2 (2 = call active)
EndCall - the event is 'phone idle' and in the task 'variable set'' %INCALL to a value of 1 (1= no call is taking place)
The above will come in handy in many other profiles I'm sure...
--------
Feedback needed as always please!

CommMgrPro for Android (Rules Engine) [ 2012-06-20 V1.1.19 ]

Hi.
Market URL https://play.google.com/store/apps/details?id=com.dhr.commmgrpro&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5kaHIuY29tbW1ncnBybyJd
I am porting CommMgrPro from Windows Mobile to Android.
This is the original post.
http://forum.xda-developers.com/showthread.php?t=299070
The goal of this project is to customize the behaviour of your device depending of many events, like time, date, position, battery state, calendar, radios states, and any environment element.
Rules Engine is a complete rules engine to customize your device behaviour automatically. The idea is simple and powerfull:
The device broadcast automatically events about many thinks
Hardware events like Bluetooth, wifi, battery level, cpu state, position events, time events, calendar events, phone ring state, screen state
And much more...
And the device can perform automatically many actions without user intervention:
Set hardware state, wifi, bluetooth, speaker, launch or kill a program, apply a predefined profile, send a SMS/Email, ringtones....
And much more...
With Rules Engine you can create many rules. Each one is composed of:
Conditions. Simple or complex conditions using AND/OR clauses. For example, if weekday is monday, between 7:00 and 9:00 and my current position is my office and battery level is higher than 20% then send an email .....
Actions. Actions to be executed when the rule passes from unmatched to matched and actions to be executed when the rule passes from matched to unmatched. User can set their order, delays, etc
Other features:
Profiles: These are set of actions that the user can select / unselect quickly from the main page.
Quick timed switchers: For example, set Bluetooth on, but put off again after 90 minutes
New actions and conditions are being added each day.
Current conditions:
Weekday and time
Wifi state
Speaker state
Bluetooth state
Flight mode state
Data connections enabled / disabled
AC power / Battery
Location. To be inside or outside of some place (defined by point and radius)
Screen state
To match or unmatch other rule
Some program is running or not
Battery level (min, max)
Bluetooth connected to an specified device
Phone status (ringing, in call...)
Calendar events. To be in a caleendar event that contains some word, like 'meeting"
Autorotation screen On/Off
Mobile network type in use (GPRS, HSDPA, CDMA, LTE, etc)
Data connection On/Off
Headphone plugged or not
Car mode activated / deactivated
Current action:
Set wifi state
Set speaker state
Set bluetooth state
Set flightmode state
Set connections enabled / disabled
Launch a program
Kill a program
Apply a profile (Set of rules)
Set autorotation screen state
Set screen bright state
Set auto sync accounts state (gmail, facebook, etc)
Play a song.
Send SMS
Send Email
Set car mode
Set wallpaper
Set ringtone (as user mp3 or android ringtone)
As we did with CommMgrPro for Windows Mobile I hope this project become a user driven project.
Thanks¡¡
Known bugs
Empty
Next features being developed
Roaming condition
Condition connected to a specified hotspot
Was a CommMgrPro user for a long time on WM so I'm looking forward to how this turns out on Android, Daniel. Glad to see you're here!
For my part, I'd like to
1) have ALL of those notifications available to me (with the possible4 exception of date/time set)
2) be able to change settings, run scripts, use Locale plug-ins (no reason for you to replicate functionallity that's available in existing code), start/kill other apps and send arbitrary Intents to other apps. Output to a file would be nice as would being able to read and parse a file (rudimentary parsing is OK)
Perhaps a tall order, eh? Start small. GPS and/or cell tower location-based notifications to trigger actions like turning on/off WiFi, bluetooth, cellular radio, conditioned on time of day/day of week/date would be a good start, for me at least. I'd also like to be able to create profiles that I can trigger manually, preferably by a shortcut. While I'm not big on widgets, people will want them and give you bad ratings in the Market if you don't have them.
short/y said:
Was a CommMgrPro user for a long time on WM so I'm looking forward to how this turns out on Android, Daniel. Glad to see you're here!
For my part, I'd like to
1) have ALL of those notifications available to me (with the possible4 exception of date/time set)
2) be able to change settings, run scripts, use Locale plug-ins (no reason for you to replicate functionallity that's available in existing code), start/kill other apps and send arbitrary Intents to other apps. Output to a file would be nice as would being able to read and parse a file (rudimentary parsing is OK)
Perhaps a tall order, eh? Start small. GPS and/or cell tower location-based notifications to trigger actions like turning on/off WiFi, bluetooth, cellular radio, conditioned on time of day/day of week/date would be a good start, for me at least. I'd also like to be able to create profiles that I can trigger manually, preferably by a shortcut. While I'm not big on widgets, people will want them and give you bad ratings in the Market if you don't have them.
Click to expand...
Click to collapse
Thanks¡ and happy to see you again
Hi Daniel,
Great news that you are thinking of a port to Android. You will make me (and a lot of others as well) very happy with that. I am still using a bunch of programs to let at least do a part of what your program did for WinMo. After I finally ported my HTC HD2 permanently to Android (one of the things that was holding me, was the lack of your program for Android), but I am still missing CommMgrPro.
short/y said:
1) have ALL of those notifications available to me (with the possible4 exception of date/time set)
2) be able to change settings, run scripts, use Locale plug-ins (no reason for you to replicate functionallity that's available in existing code), start/kill other apps and send arbitrary Intents to other apps. Output to a file would be nice as would being able to read and parse a file (rudimentary parsing is OK)
Perhaps a tall order, eh? Start small. GPS and/or cell tower location-based notifications to trigger actions like turning on/off WiFi, bluetooth, cellular radio, conditioned on time of day/day of week/date would be a good start, for me at least. I'd also like to be able to create profiles that I can trigger manually, preferably by a shortcut. While I'm not big on widgets, people will want them and give you bad ratings in the Market if you don't have them.
Click to expand...
Click to collapse
I do totally agree with this. Lets start with cell-tower switched on and off, of 3G, WiFi and GPS. One of the biggest problems with Android is the huge amount of battery drain. This will make a good start. I know, there are a lot of programs which does it in a simular way, but CommMgrPro has a lot more to offer, after some time. And Daniel, you have the proof and skills of a very good programmer
Thanks!
Hi.
Right now there is a fully working version. I am testing it myself and works very well. In a few days I will post it. Then I will fix bugs and will add more features. Basically:
1) More conditions to trigger a rule. Battery level, incomming call from XXX, incomming SMS, etc
2) More actions to be executed when a rule is matched: run or kill a process, etc
Thanks
Gigabyte Gsmart G1345
I will be locking forward to get this working on my device.
It is really needed.
I sincerely hope that it could work on my device with Android 2.3.4.
God damn D man you finally turned to the dark side. Thought you had abandoned development. CMP was the only thing that kept me on WM until Jan this year. Have looked for CMP for android a couple of times but now you are ready. Cool man. I have started to use Tasker, and have some pretty crazy rules, but some things are not possible with Tasker, so I hope that you make it possible to integrate with Tasker as a plugin.
Anyway D. Its good CMP have not died.
One thing I miss. Being able to run my CMP as a service. Actually I believe tons of apps could save battery if they were better programmed and just called the part of the app that is needed. Maybe its nonsense, as I am not a dev, but I look forward to have you back on the train D.
---------- Post added at 11:39 PM ---------- Previous post was at 11:30 PM ----------
Just went to the CMP page. MAN, memories from good old wm days. I really spent many hours tweaking CMP.
I miss the possibility to see all cell towers in a time scheme, and then add them to different profiles..... Is that part coming?
By the way, what phonie are you having?
HI answer in my next post (5 minutes)
Hi Martin. Time passes hehehehehhe
Well, as I posted before I didn't want to waste your time with buggie releases.
Answering your question, positions are given by location + radius. But I will develop a simple way to provide cells. It is a old way but has a good advantage. It doesn't require internet connection. You teach CMP which cells are near your home so CMP doesn't need internet. Well, currently you define a point and a radius.
As you know CMP is a rule engine. The device gets thousand of events (battery levels, positions, week days, hardware status, calendar events) so you can create complex rules to launch actions (set hardware status, launch programs, kill processes and much more.
The program will be FREE and will probably contain ADDs. There will be a donate version (0.99$) to avoid ADDs to support me.
Don't forget Martin, post suggestion about conditions and actions. Rememeber, one rule = Condition 1 AND Condition 2 AND condition 3.......and if matched then execute Action1 and Action 2 and ACtion 3......
There are other rules programs, but this one will what we really need (from programmer to programmer)
andddd just sold my galaxy S2 to buy a galaxy note. I ve iPhone 4s to develop projects for old and busy customers (you know, MAC=MONEY)
Don't worry, I will come up with suggestions if something comes up. Like your way to always answer our good and sometimes stupid questions, but important to me is flexibility. I know there is is problem calling GPS functionality, but Secure Settings solved that by an external plugin that could be called from Tasker and others. So are you planning an SDK or similar to let CMP interact with other software? In my head CMP could be a standalone app, but also the app that could be used in bits or integrated with other software.
Have another...
One thing I miss on android is being able to copy screen press like calling an app and then copy the button interactions. I will send you thoughts on this in a pm later when more thinking have been done as it could be a standalone app you could develope later.... And perhaps make some earning on.
Note..I am thinking about buying it, so I look forward to hear your thoughts about it.... When do you get it?
Hi Martin.
CMP will interact with other programs using android Intents. And other programs can interact with CMP, applying rules for example, using intents too.. I dont really know if you know what intents are, but they are a nice and easy way to allow programs interaction.
I didnt understand your sugestion about copy press. What does it mean? You know my english is poor, hehee
Enviado desde mi GT-N7000 usando Tapatalk
Daniel, I've been away from CMP (and Windows Mobile/Phone) since Android launched but I have missed CMP just about every day. Because of the value I received from CMP back then, I plan to buy it as soon as it's available. And when you're ready for beta testers I want to participate.
looking to test myself,I remember testing back in the wm5-6.5 days
Very soon I will upload the first version. Let me finish a couple of conditions (a program is running or is stopped and other one, battery level range). So probably next week i will upload it,but remember, much work to do
Enviado desde mi GT-N7000 usando Tapatalk
may i ask why you don't simply use one of the many many already available apps of this kind?
just to name a few:
tasker
settings profile pro
llama (it's free)
...
Well, it isnt a profiler. Its a rule engine. Of course, you can use it as a profiler. The idea is a total automation of the device. Soon the conditions can be used as complex AND/OR clauses. Well, its a rule engine as I think it should be. I did it in Windows MObile and I am trying to translate it to Android learning from old errors...
tasker is a rule engine too.
and llama and settings profiles is just a simpler rule engine, more optimized towords profiles, but not only!
Thanks, I am trying to make CMP better than those programs
ok. no worries. i just wanted to mention this as maybe it would be easier.
but this of course is a reasonable reason to port it.
good luck.
I've used several of the other apps (Locale, Tasker, Settings Profile and a few other profile programs I can't recall). Tasker is currently my workhorse. It's extremely powerful but it's a PAIN to program. There's no good way to cross-reference variables or other tasks so, to make global changes to a routine, I need to export my profile, bring it up in a file viewer on my PC and do searches and such on the PC while changing the programming on my phone. I'm not knocking Pent, the developer, he's done a phenomenal job on Tasker, especially given that it's only one person doing the development. But, for all its power, once I got beyond a few relatively trivial profiles, its become nearly unwieldy.
I don't know exactly what Daniel has in mind but I know what I did with CMP on Windows Mobile. With the additional capabilities in Android, I think Daniel could do really really good things (no pressure, Daniel). I'm looking for power with more facilities to make it easier on someone who does lots of things with the app.

[International Pushbullet Server] [US Pushbullet] [N6 Browser Launch] N6 Availability

International Nexus 6 Pushbullet Java Server channel
I can't setup Nexus 6 Pushbullet Channels outside US because is where I'm living now but I can share a Java program that will work at any country so you can setup your country channel.
Be aware:
The program will check the page where the server or computer is located.
If you use a VPN be careful because maybe the server will be checking a different country page.
The only restriction is that the Nexus 6 page has to be available.
If you share your channel please try to run the Pushbullet server 24/7 because people will be disappointed if the nexus appear and the server is not running.
How to setup:
Setup a Pushbullet account: https://www.pushbullet.com/
Create a new channel: https://www.pushbullet.com/my-channels
Find and save your api key also called acces token: https://www.pushbullet.com/account
Download the servernexus.jar file
Install the latest Java in your laptop, PC or Server.
Setup your java environment variables properly (help)
Open your terminal or cmd
Go to the path where your file is located
Run your servernexus.jar file as: java -jar servernexus.jar <api key> <channel tag> (help)
Example: java -jar servernexus.jar 11KJ45JH34NDWFN234N423 nexus6availabilityuk
If everything works well you will see a Pushbullet notification on your channel indicating that the server is running.
The refresh time is 5 seconds
US Nexus 6 Pushbullet channel
For those who are still waiting for it I prepared this Pushbullet channel for myself and it worked fine so if you want to use it go ahead I'll keep my server running until stock gets fluent.
The refresh time is 5 seconds
Channel: allnexus6availabilityus
Web: https://www.pushbullet.com/channel?tag=allnexus6availabilityus
International browser launcher Nexus 6
If you don't believe in Pushbullet notifications and you prefer something different I also prepared this nexus.jar file that will look for your desired device and if it's available will launch your browser into the device page when appears available.
The refresh time is 2 seconds
To use it you will need the latest Java installed on your computer and java path in your environment variables.
Then for N6 Blue 32Gb introduce: java -jar nexus.jar 0
For N6 White 32Gb introduce: java -jar nexus.jar 1
For N6 Blue 64Gb introduce: java -jar nexus.jar 2
For N6 White 64Gb introduce: java -jar nexus.jar 3
Hopefully will be usefull for somebody.
Worked great. Many thanks. Got the 34 gig midnight blue. Average stock available time was about 8 seconds.
geebee1932 said:
Worked great. Many thanks. Got the 34 gig midnight blue. Average stock available time was about 8 seconds.
Click to expand...
Click to collapse
You are very welcome Did you use the Pushbullet Channel or the Java file though?
I used Pushbullet. It was the first time using it.
Thanks! Hoping for some luck next week if not sooner. Using the channel.
geebee1932 said:
Worked great. Many thanks. Got the 34 gig midnight blue. Average stock available time was about 8 seconds.
Click to expand...
Click to collapse
Damn bro. Where'd you see the 34GB option? All I could do was the 32 or 64!
Can anybody do anything similar for the UK?
bigf00t said:
Can anybody do anything similar for the UK?
Click to expand...
Click to collapse
If you have a computer in UK that can be online 24/7 I can share you my program so you can setup your own channel if you want.
For anyone looking for a python script, I did this, based on another scrit. Sorry, I lost the original script to give credits
I don't use pushbullet, I use notify my android (https://play.google.com/store/apps/details?id=com.usk.app.notifymyandroid)
First, download the python lib to send notifications to NotifyMyAndroid
https://github.com/uskr/pynma
Download the zip and unpack it. Go to the extracted dir and create a file. ex: nexus632gbblue.py
Code:
#!/usr/bin/python
from urllib import urlopen
import logging
import pynma
#nma api key
nma = "your_nma_api_key"
#change to your desired model
urlnex = "https://play.google.com/store/devices/details?id=nexus_6_blue_32gb"
contents = urlopen(urlnex).read()
if contents.find("Add to cart") != -1: #Found magic button!
try:
p = pynma.PyNMA([nma])
# application, event, description, (opt) url, (opt) priority, (opt) batch mode
res = p.push("Nexus 6 Available", 'Nexus 6 - Blue 32gb ', 'Nexus 6 - Blue 32GB Available', urlnex, 2, batch_mode=False)
except Exception:
print logging.exception('')
To test:
chmod +x nexus632gbblue.py
python nexus632gbblue.py
edit: on crontab, to set update interval less than 1 minute:
You can change the script and put a while loop and a sleep on python script. It's just an example
Code:
* * * * * python nexus632gbblue.py
* * * * * sleep 10; python nexus632gbblue.py
* * * * * sleep 20; python nexus632gbblue.py
* * * * * sleep 30; python nexus632gbblue.py
* * * * * sleep 40; python nexus632gbblue.py
* * * * * sleep 50; python nexus632gbblue.py
Now, just put on your job scheduler and chose the update time
Thanks X, that channel has been very helpful in keeping me up to date with the stock.
Is there a script to automate the ordering? Like click Buy, Checkout, etc so I don't waste seconds fumbling for the button?
xbassols said:
If you have a computer in UK that can be online 24/7 I can share you my program so you can setup your own channel if you want.
Click to expand...
Click to collapse
Hi xbassols, If you could share the program that would be much appreciated. The uk play store is now showing the Nexus 6, all be it with "coming soon" but it would be good to get prepared.
Cheers,
Rochey
This works for specific country or just US?
Rochey13 said:
Hi xbassols, If you could share the program that would be much appreciated. The uk play store is now showing the Nexus 6, all be it with "coming soon" but it would be good to get prepared.
Cheers,
Rochey
Click to expand...
Click to collapse
I've updated the first page.
Seadra said:
This works for specific country or just US?
Click to expand...
Click to collapse
The channel only in US but the java files everywhere where the nexus 6 page exists
Hey, what text does this search for on the page and/or does it just detect changes between a previous version and the current version of the page? I ask as the UK site says "add to basket" when available rather than "add to cart" as the US does. Other than that, the pushbullet java server seems to be up and running well for me here - thanks!
GavinAshford said:
Hey, what text does this search for on the page and/or does it just detect changes between a previous version and the current version of the page? I ask as the UK site says "add to basket" when available rather than "add to cart" as the US does. Other than that, the pushbullet java server seems to be up and running well for me here - thanks!
Click to expand...
Click to collapse
Don't worry about that, it doesn't really search any visible text. It works monitoring the class name of some specific tags so can work at any country even if the page language is different and it's way more reliable than other programs that just search any difference in the webpage.
It will work properly if Google don't mess with the internal classes and that shouldn't happen.
If you intend to keep your pc running 24/7 or so, I think other users would appreciate having the opportunity to use your channel
BTW don't forget to subscribe to your own channel... For some weird reason it's not done automatically when you create the channel.
uknexus6stockcheck
Just managed to set this up on my mac mini which is on in the uk 24/7.
Updating Java was a pain as OS X wanted to keep using version 1.6. In the end I had to symlink the 1.8 java in /usr/bin/.
Seems to be working now. If I start the script I get a pushbullet notification saying that the "server is up and running" and I can see the poll every few seconds.
Thanks for the script and if anyone wants the channel name to use themselves subscribe to;
uknexus6stockcheck
Quick query, Does the script check for both colors and sizes? I'm assuming it will message when each comes available as there are no options. Just thought I'd check.
Thanks again for the java script and instructions - here's to hoping that I get a nexus 6 before a few of my friends! lol!
Yeah you're right, a quick compare of the page source US vs UK does indeed show the class names all match between both.
Unfortunately I doubt I'll be keeping my PC on 24/7 else I'd gladly share. No-one wants to be prematurely excited about a notification to then see its just the server starting again!
Thanks for the heads up, I had already noticed that I wasn't automatically subscribed to my own channel, I found it odd too.
could someone make a channel for the german playstore?
thanks in advance
Meh. I changed my mind. Not talented enough to set this up.
Now if someone could just make a .jar that monitors motorola.com's "Out of Stock" message for the Nexus 6 Buy page...

Mi-W2 smartwatch

Hello all,
I bought a smart watch from here : http://www.banggood.com/MI-W2-Pedometer-Sync-Phonebook-SMS-Camera-Control-Bluetooth-Smart-Watch-For-Android-p-990272.html
I have several issues with this smart watch, and I need your help, guide.
The user manual inside the box is not for this watch. The application it suggests to use, can not even connect to it.
What the watch offers application, points to Podoor. The closest Podoor smart watch, based on look and feel is the PW305.
Problems with the watch: displays Fahrenheit, can not set it to celsius. Can not sync phonebook.
Further investigation:
Processor is MT6260A. In the menu it says model: SM-1 and Version: V0.6.
Questions: where can I find the latest firmware with Celsius? Do you have other guides, like how to backup the watch? Methods described with 6250 doesn't work: unknown flash_id.
Phone .apk can be downloaded from Mimi websitehttp://www.mimi-hk.com/download.php
the phonebook is pushed from the phone using that software. Joe's Tech Review http://joestechreview.ning.com/page/mi-w2-smartwatch uploaded firmware a while ago, I'd start looking there.
Pseud O'Nym said:
Phone .apk can be downloaded from Mimi websitehttp://www.mimi-hk.com/download.php
the phonebook is pushed from the phone using that software. Joe's Tech Review http://joestechreview.ning.com/page/mi-w2-smartwatch uploaded firmware a while ago, I'd start looking there.
Click to expand...
Click to collapse
Based on that site, my smartwatch is a W2A, something translated as "adaptation watch" with firmware 0.6 and later. This application says Error: Not connect to SmartWatch! (connection according to BT settings and the watch itself is fine)
I tried the application for v0.5 watches just to be sure, same error message. Could be an issue with the watch itself?
poganytamas said:
Based on that site, my smartwatch is a W2A, something translated as "adaptation watch" with firmware 0.6 and later. This application says Error: Not connect to SmartWatch! (connection according to BT settings and the watch itself is fine)
I tried the application for v0.5 watches just to be sure, same error message. Could be an issue with the watch itself?
Click to expand...
Click to collapse
I've only seen that error when the smartwatch software wasn't enabled in Settings>Accessibility on the phone.
Pseud O'Nym said:
I've only seen that error when the smartwatch software wasn't enabled in Settings>Accessibility on the phone.
Click to expand...
Click to collapse
This was the first thing I turned on after installing the app, after a reboot I am waiting for a replacement watch (same model), I will see if it has the same issue or not. I also tried it with another phone, running Android 5.0, same error.
Pseud O'Nym said:
I've only seen that error when the smartwatch software wasn't enabled in Settings>Accessibility on the phone.
Click to expand...
Click to collapse
I received my second smart watch. Same model, same errors. This is the look and feel of the only application capable to do at least something with it (it is offered by the watch itself) : http://imgur.com/OhzD1H0
It is capable to:
Find watch
Set weather city and send it to watch
Retrieve sport data from watch
If I click Camera, it says waiting for conformation forever. If I initiate it from watch, it works. Sync contacts doesn't work. I guess it also requires a confirmation on the watch, but no dialog is shown. And the weather data displayed in Fahrenheit, no way to set it to Celsius.
Any suggestions?
I noticed on the PCB an RX and TX pad. Connecting a serial module, it displays (115200 8-N-1 mode):
Code:
F1: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
U0: 0000 0001 [0000]
G0: 0002 0000 [0000]
T0: 0000 00C0
Jump to BL
Init Start
Init done, 0x50f8773
Jump to ExtBL, 0x3460
~~~ Welcome to MTK Bootloader V005 (since 2005) ~~~
**===================================================**
Bye bye bootloader, jump to=0x100102d8
I extracted all the chip numbers from the PCB, hope it helps someone to identify the watch.
This is an uncompressed high resolution version: http://imgur.com/fQQxY12
Other side of the PCB says 1516 W2S_MBPCB_V3.0.
I found this apk: http://joestechreview.ning.com/page/new-apk-mi-w2
With this, pretty much everything works, but you have to initiate everything from the watch, like phonebook sync.
But I am afraid the watch is pretty much useless:
Sync is not really a sync, if you sync twice, you get all contacts 2 times
Temperature is only Fahrenheit
Voice quaility is terrible

Categories

Resources