I have installed a Wifi-enabled microcontroller module in my espresso machine which collects data, such as shot time, shot weight and temperature. It sends such data continuously to apps that listen. The data transfer is a simple serial connection using plain text (telnet to the TCP/IP port on the module).
I'd like to write an app for the Galaxy Watch 4 that uses this data. It should at least display the duration of the ongoing shot in a stopwatch-like manner, ideally more (weight, pressure and flow rate). This display would need to appear automatically as soon as the espresso machine is used (user starts pump). Before I start learning to program the watch, I'd like to find out if this has any chance of success?
Is it possible to write a Wear OS app that always runs in the background and permanently keeps a Wifi connection to an IP in the LAN (user-entered IP of the espresso machine) and that automatically brings itself to the front within one second when needed, ie. when the user starts the pump?
Since one would have to restart that app after every restart of the watch, it would probably be better to implement something like that as a tile. Same question: Is it possible to program a tile that holds a LAN connection and automatically brings itself to the front within a second when needed?
The module in the espresso machine continuously sends a data packet of about 250 characters via Wifi twice per second, containing all details of the current state of the machine (pump state, temperature and so on). This data would have to be constantly received and examined. Would that be too much work for the watch/battery?
Related
Hi xda-developers,
I wonder if you can help me. I've been battling with Motorola(Symbol) over a major power saving issue. What they have done is whenever a TCP or UDP data packet is sent or received, they force a reset of the system idle timer. So, as you can imagine if the device were set to sleep after 5 minutes and a mail client checked for mail every 4 minutes the device would never sleep.
Please correct me if I'm wrong but doesn't that go against the design of the OS?
This is causing major problems with our application that retains an open connection for pushing data from our servers to our mobile devices. The application sends a keep alive packet every 45 seconds to let the server know the device is within GPRS range and online.
Motorola seem very reluctant to change this stating it's "the desired and better behavior for MOST customers".
They also state that it would be "impossible to transfer big file since the terminals will suspend before finishing". Surely this is why an application transfering a large file should call SystemIdleTimerReset function.
Please note, this feature is only implemented on 2 devices. Motorola claim that these two devices are "focused in different environments where the user needs and preferences are different".
Personally, I can't think of any scenario in which you'd want to force this functionality. Regardless of environment.
I don't really know where to go next on this issue. Motorola are not listening.
Any help or comments would be greatly appreciated.
Thanks in advance
Tom Bradley
Has anyone heard or know of software that'll switch my WiFi on or off depeding upon where i am currently located using GPS? e.g. home or work? or wherever i've previously manually turned WiFi on and got a connection?
CMP
You should go for CMP - Commmanagerpro by Daniel Herrero
Its the most important program for a device running WM !!!
And I mean it.
Depending on cell towers and/or scheduled tasks it will change profiles, task and whatever you can think your device should do for you...
Exampel: My phones runs a close apps at 0100. At 0600 it reboots, turn on sound and let the alarm go. At 0730 the phone turns on and the screen becomes brighter. At 0800 a schedule starts, so IF CMP recons certain cell towers it turns on my Car profile. That one changes when I arrive at work to a work profile. Different sounds and lots more. IF my calender say I am in a meeting the screen will turn off and and sms will be sent to any that call me...
I have schedules for everyting. Nights - evening, weekend and wifi, tugging kids to bed and more....
So in short. CMP let you control whatever your device should do according to your position, the time of the day or your calender.
http://forum.xda-developers.com/showthread.php?t=299070
It has MANY details so it might take you some time to get deep with it, but from then it WILL become THE app of your device..trust me.
Thanks Martin, That looks like it does what i want, using cell phone masts is a much better idea than using GPS i guess.
However i'm put off slightly by the ugly skins and many details that will take me some time to get configured, i just want a simple background service that remembers what cell phone masts were responding when i get a successful authenticated wifi connection, and to use that information to turn wifi on the next time i'm in that area. The rest of my phone's profile such as back-light and ringtones etc i'm totally happy with managing myself as i'm not yet ready for my phone to be in control of my life! - i guess what i'm saying is the service shouldn't have any need for a configuration screen, and if it does, then it should be formatted and laid out in a standard way that doesn't look so scary or require me to identify my screen size before i download it!..
perhaps someone out there with more time on there hands than me could write this service and sell it on marketplace?!
CMP runs as a service
I couldn't resist the challenge.. i have written this as a tiny background service...
Wherever you turn your wifi on and get a connection, your phone will remember this and turn it on next time your there, also if you wander outside that 'connected' location and loose your wifi connection your wifi will be turned off until either you wander into a previously 'connected' location or turn it on manually... - turning it on manually and connecting to a wifi network will add that location etc etc... so no profiles, no config, no skins, no setup, no frills.. just plain handy.
if like me anyone is sick of wifi draining the battery when accidentally left on, or up sizing your phone bill when its accidentally left off, then get in touch and i'll slip you a copy to beta-test for me!
Cheers
Saw someone post this on Slashdot. Is this guy right about ActiveSync, in that it does not leave the radio open but somehow doesn't close the connection to whichever server it's connected to and therefore saves more power than, say, keeping an IMAP-Idle connection open? Or is this different for the iPhone and does some Blackberry-like method?
Running an active TCP session for an IM client constantly would light up much more of the iPhone's hardware, and drain the battery that much faster.
​Well, not exactly....
An active TCP session is EXACTLY what Apple's Push Notification Service [apple.com] uses.
Its an extended version of ActivSync [microsoft.com], Licensed from Microsoft.
It works like this:
You open a TCP connection with an Apple Notification server, and shutdown the radio, leaving the connection open, by never explicitly closing it. With the radio down, the phone is Saving power.
Periodically, you wake up the radio, check if the TCP socket is readable. If so, you read it, and notify the user, and optionally launch that application that the notification was destined for.
If the socket failed, (timed out, network dropped, etc) you reestablish the socket.
Since TCP timeout is usually on the order of 12 minutes or longer, this happens only about 5 times an hour.
Checking socket readability takes just a tiny bit of power for a very very short time. So your radio is on for a few seconds every hour. (Which it is anyway, listening for incoming calls).
Apple's push notification leverages this single socket connection to an unlimited number of applications in the iPhone, by having a single daemon watching the socket, signaling the target app, and notifying the user.
It operates similar to InetD [about.com] in Linux, other than instead of waiting for new connections, it is watching existing ones. In fact, there is some discussion as to whether ActiveSync is even patentable because it is so obvious.
And to be perfectly pedantic, Antennas do not consume any power when receiving.
Click to expand...
Click to collapse
Also I found this article written yesterday claiming, I think, that Google has updated Google Sync to include Gmail support for activesync-using devices. I think it's implying that the addition of push-email is free. Can someone confirm that? If so with a regular Gmail account, if you have added another email account to use as a from address, could you use the same from address over ActiveSync or is that a web-only thing?
Finally, any phone-side registry-like tweaks to get your phone to chill and not care that your server doesn't have a certificate, self-signed/generated or otherwise, with ActiveSync over SSL?
Thanks.
Doug
Google active sync
Hello,
I read the article too, and ofcourse I tried it out, it works perfectly.
just use m.google.com as the exchange server, and use your full google username+gmail.com, leave the domain field blank.
I use it now for more than a week and found no problems.
Previously I used www.nuevasync.com
grz..
I used an iphone for some days. I've ever used nokia phones. Each day I use a blackberry. All devices seems to use internet connection better than Android, using that only when needed and starting/stopping it automatically.
What I don't like about Android is that you can't set device to enable internet connection only when needed. What I understood is that if you like to sync mails every 5 minutes, for example, you have to take internet connection always on.
I don't like this because mainly it's battery consuming.
Is there any way to set Android (I've a Desire but I think it could be the same for each device) to automatically turns on internet connection just before syncing an app and turns off just when finished?
i agree... any hints and helps here? my experience in winmo is much better as it connects only on need.
especially now my Galaxy S battery life is so short
this app might help.
mensa07 said:
this app might help.
Click to expand...
Click to collapse
Yes, thank you.
I already tried it but if I configured it right it manages only sync operations and no internet connection. So internet connection must be taken ON (on the screen you continue to see arrows) and it stop only sync traffic.
Right?
I mean to stop internet connection at all and enable it only at a specific frequency (so on the screen arrows should appear and disappear when needed). Is it possible?
Suggestions or questions are welcome!
Description:
Here is a simple-ish script I wrote to manage data flow on my phone. Mobile data on/off is easy enough but what most users have a hard time pulling off is when to toggle wifi on and off with minimal consumption. Using local tower states is pretty common but it's inaccurate and slow; additionally my method uses less battery life.
Room for improvement:
The only thing I would like to do in order to improve this is to have the script not disable data when downloading or streaming. This is possible but is unique per device per ROM so I can't really go into detail about how to do it. As a summary though there's a file that is written to that keeps information about bytes traffic. You just read this file to determine how much data is flowing in a specific interval and if it exceeds a certain amount then don't turn off data just yet. It's also a known issue where with some devices the 3G state change won't register when toggling manually while connected to wifi.
Features:
Wifi and 3G will disable two minutes after the screen is off so it's not constantly toggled through intermittent use.
On some phones or providers the 3G status becomes unknown when in a call or when connected to wifi; this script works around that.
Unlike most data management apps this one will remember your 3G status should you manually change it, in case you don't want 3G on at all.
Data is still checked on an hourly basis(this can be adjusted of course).
Fast and accurate wifi connecting with very minimal power drain.
Just a few things explained for those curious:
I check the phone state to ensure that 3G isn't detected as manually disabled when your provider uses 3G to place calls.
I check the screen on time because on some phones/ROMs the 3G doesn't actually register as toggled until the screen flickers back on. Because of this 3G appears to only become disabled once the screen turns back on and it can be registered as manually turning it off.
The wifi timer exist so the script won't check for a wifi too frequently.
You can adjust the hourly checks under Cycle 3G.
What version of Tasker is this developed under? Just curious, I'm running the 4.0 beta, and I just had to back out of b19 to b18 because of issues with my data management profile. I'll try yours out, it sounds a lot better than mine...
Can't seem to get this to work...tasker wont recognize the file
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
It's working great for me on 4.0b18. I still need to look at the logic being used as to what causes it to 'wake up' and connect to wireless, is it simply a delay after screen on, or are you also looking at other factors?
Tasker 1.3.3u2
My friend had problems getting his to recognize the profile as well. I'm not sure why.. It might have to be in the proper directory. You might also have to make a new profile tab for it. Hopefully rpr69 can give us some insight.
But to answer your question as to how I check Wifi...
When screen turns on I immediately try to connect to Wifi before trying 3g. 3g will still enable briefly after for phones that require it for MMS. If Wifi isn't connected after X seconds then it disables Wifi and won't try again for 10 minutes. If it does connect successfully there will be no 10 minute wait next screen on.
Added manual toggle memory to Wifi as well. I'll post the changes later and update the zip file.
Are you importing the profile, or just dropping it in a directory? The proper way is to import into a new project. In 1.3 of Tasker (from memory, it's been awhile), you need to pull down from the top of the Tasker top bar which should then give you the Projects tabs. Long press on the Home tab, and you should get an 'import' option, navigate to where you downloaded the project file on your phone and select it, and it should create a new tab for it, with the profile and tasks under it. If you had previously just manually copied the xml file into the projects directory, move it out of there or the import may fail.
Looking forward to the update!
Ok got it to work I forgot is was a project and kept trying to import only a profile. It seems great so far!!!
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
To make it so it won't check wifi when you don't want it to add the following...
ProfileName - Record Wifi State
Trigger - State > Wifi Connected *
Enter Task - Set Variable %wifistate to 1 if screen ~ on
Exit Task - STOP If %ScreenOnTime + 2 > %UPS
......Set Variable %wifistate to 0 if screen ~ on
then under task "Data Types On - Type 2 P2"
very first line add - If Then > %wifistate = 1
Place a closing End If at the very bottom, and move the "Mobile Data > Set On (if %3GState = 1)" second from the bottom, just above closing.
I also just uploaded the xml file again to the main post.