* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Clouttery - the smart, cross-platform battery monitor  (Read 7410 times)

0 Members and 1 Guest are viewing this topic.

Offline 123outerme

  • Super User
  • Join Date: Jan 2015
  • Location: In spaaace! Well, the Earth is anyhow.
  • Posts: 575
  • Post Rating Ratio: +2/-0
  • Professional Unpaid Intern
    • 113/11355
    • View Profile
  • Gender: Male
I just wanted to drop by again (reminded by DJ posting on this topic) and say that I really love this. The app is extremely useful for even one device, since it keeps battery logs. I, at one point, had two Android devices (one was an older one I was gonna give to a friend), and being able to monitor one phone's battery from the other was an awesome idea, that I'm surprised no one has thought of before.

I have to ask a question, though. On my Moto X running Android 4.4 I think, I was able to access battery information through a seperate window (like Temperature, charge, voltage, health), but on my Galaxy S7 running Android 6.0, I don't see the window anymore. Is this a removed feature, or a glitch, or something that Android 6.0 won't allow?
  • Calculators owned: TI-84+CSE, TI-nspire Clickpad, TI-84+SE

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
@123outerme
Somehow, the forum failed to notify me about your message, and this is not a very popular topic so it took until now for me to see it  :-\

Glad to know you find the service useful.

The battery information window you're talking about is a system activity that is only available in some devices. Clouttery hides its option when it's not available. I think some manufacturers (namely Samsung, I think?) never included it in the first place, and my generic Chinese phone running a Android 7.1 ROM very close to AOSP doesn't have it either. With it being gone from AOSP, I don't think it's coming back.

I'd like the Clouttery Android app to evolve to the point where it completely replaces that window (it can already display and log the battery temperature...), but for now it may be better to use a separate app for that kind of detailed stuff.



I finally found some motivation to work on this project again. I had some ideas for features that were starting to be kind of hard to implement using the current database system (a simple key-value store with buckets, see https://github.com/boltdb/bolt ), so I'm currently on day three of rewriting a significant portion of the server to work with relational databases instead, using SQL queries. This should also make it easier to scale the Clouttery server to work on multiple machines by using a database with replication support.
I'm thinking of using https://www.c*ockroachlabs.com/ (access that URL after removing the asterisk, because the forum apparently censors the substring(0,4) of C*ockroachDB  :-[). If that doesn't work out, the SQL I've been writing should be compatible with PostgreSQL.
Most things already work even if not especially optimized, but I still need to test the hell out of this and ensure the server is as secure as before, before pushing it to production. And most importantly, write code to migrate the data from the current Bolt database to the new one...
  • Calculators owned: Prizm CG-20

Offline Unicorn

  • PICKACHUP IS LYFE
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: PICKACHUP land
  • Posts: 2715
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • UnicornCalcs
  • Gender: Male
So I've gotten around to re-installing clouttery on my new windows installation, and am liking it :)

The one thing I've found is that it takes from 15 minutes to an hour for the dotAccount two factor authentication to send me an email. Is there any reason that it takes so long?

Also... Linux application? :P

great job, @gbl08ma!
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something
  • Consoles, mobile devices and vintage computers owned: PICKACHUP



Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
The one thing I've found is that it takes from 15 minutes to an hour for the dotAccount two factor authentication to send me an email. Is there any reason that it takes so long?

I too have noticed that, and other people have complained. I blame it on Mailgun. The emails appear there as sent and accepted by the destination almost as soon as I submit them, but it takes some time until emails appear in people's inboxes. Perhaps one of these days I'll try to switch to an alternative service like Sendgrid.

Actually I have a redesign of the Windows client in progress, to use WPF instead of Windows Forms. I posted some screenshots earlier in this thread. But I haven't worked on that in like two months, and it's yet another thing I have not yet found the time nor motivation to continue. The fact that the UI is also apparently becoming slower and more memory intensive isn't very motivating, either, but that could be due to these being debug builds and having the Visual Studio debugger attached.

The work on Linux client lags even more behind, the fact that there are so many desktop environment configurations doesn't make development easy at all, especially for something that requires a tray icon - something most desktop environments, since a few years ago, have all agreed to disagree on how it should work.
Some have kind of dropped support for tray icons, others use appindicator - with varying degrees of functionality/compatibility - and others are meant to support just about anything but then it turns out it's really buggy. What's a left click in some turns into a right click in others, sometimes you can set a tooltip and other times you don't, or the tooltip turns into a badge, or the badge overrides the tooltip... and then there's the icon, which in some desktops appears fine and others is just a blank space.
And then there's the question of whether the distro/environment in question supports the right version of GTK with the right libs, and whether packages for certain Python dependencies are available or not, etc..
And there's the problem that it's Python, because apparently it's the only language with some support for GUI toolkits that is not C or C++ (while I have enough experience with those, I really don't want to be dealing with networking and message packing/unpacking in them). There's Mono, but guess what, there you must use GTK 2 (which surprise surprise, some distros no longer come with it either!) because the GTK 3 bindings are buggy/incomplete/focus on old GTK3 versions only. Also, it turns out I can't port much of the Windows code at all.
It's really infuriating... I could go on for hours.
  • Calculators owned: Prizm CG-20

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
I mentioned some posts ago that I was working on a complete redesign of how the Clouttery server stores data.

It was using a simple key-value store (Bolt). I slowly came to the realization that some of the features I have planned would be kind of hard to implement using Bolt; that the nested buckets structure used with Bolt was too limiting, by forcing a hierarchy (or interpretation, if you wish) on the data. The databases course I took last semester forced me to get my hands very dirty with SQL, and after seeing the benefits, I decided to move to a relational database.

Another reason for moving was that Bolt can't scale (no replication, it's meant for use by a single app, like SQLite), and while the server software is not yet ready to be clustered, moving away from Bolt (and, in general, uncoupling the server from the database) is a giant step towards that goal. I had known for long that I had to use something other than Bolt if I wanted to make the server distributed, I just wasn't sure whether to move to a relational database, another barebones key-value store, or some amalgamation of solutions involving specialized time series databases or what-have-you.

The database can now be accessed transparently by multiple applications, which means that, for example, in case I want to do some complex analysis on the battery histories, I no longer have to stuff that code into the server. I can even use a language other than the one the server is written in (Go), like Python, which I really don't like but has many libraries for data analysis.

Clouttery is now powered by a traditional PostgreSQL database.

The changes were pushed to production less than a hour ago - after extensive testing on the staging environment, which unfortunately didn't catch all the bugs.
A few hotfixes later, everything appears to be working fine. :D

It would be great if over the next few days users could pay a bit more attention to the behavior of Clouttery, namely making sure that battery histories are updating as they should, and that notifications are generated when they should, according to their settings.

I'm available to answer questions about the database design (both the new one and the previous one), the reasons for the switch, or really anything. I'm a bit too much proud of this (until I find out more horrible bugs...) so I really want to talk about it but I don't know where to start :)
« Last Edit: February 18, 2017, 10:56:42 pm by gbl08ma »
  • Calculators owned: Prizm CG-20

Online p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 1885
  • Post Rating Ratio: +7/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
    • View Profile
  • Gender: Male
you know... if you just pushed two more posts, this could have been your 100th... <_<

I sadly lost sight of all the projects around, sooo I might sound pretty stupid now:
which Operating systems are supported so far? :)
(is iOS supported?) :)

also where are you hosting the data? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
I'm not racing for posts :)

Right now, the officially supported operating systems are Windows and Android. Some work has been made on a Linux GUI client, but it isn't finished yet. I even sent @DarkestEx a alpha version for testing, but never heard back, and looking at the server it doesn't seem like he's ever used it. From my testing, it works, but installing it requires lots of different packages, that aren't called the same on all distros (and some must be installed through pip as they aren't in the distro repos). I tried to package the app (which is written in Python) as a single binary, using multiple methods, but all of them failed, namely due to how the GTK bindings work.

iOS support will require at least $1500-$3000 in profits/donations, since I'd need Mac hardware for developing and the Apple dev account for store publishing, and of course some real iOS hardware would more or less mandatory, since I suppose the battery stuff and standby synchronization is kind of hard to test on the simulator. All of this, assuming of course that Apple even made the necessary battery info APIs available (I think we already discussed this a while back, but I don't remember the conclusions?).
A client that can only show information for other devices in your account would be more or less useless, for that you might as well just use the website.

Data is currently stored in one of my VPSs in the US. Data is encrypted in transit (without any MITM like Cloudflare proxies), options for protecting the data while stored in the database are being studied. It's kind of hard, because the server should be able to open the data up for analysis, this means that it would need to store any encryption keys, making database encryption pointless.

EDIT: I forgot to mention, but earlier today I fixed a problem that was preventing the pairing of new devices. This also meant that new users were having trouble signing up. All should be fixed now.
  • Calculators owned: Prizm CG-20

Offline DarkestEx

  • Super User
  • News Editor
  • Join Date: Jan 2015
  • Location:
  • Posts: 1297
  • Post Rating Ratio: +10/-2
    • @0xbmuessig
    • @muessigb
    • View Profile
    • My homepage
  • Gender: Male
I'm not racing for posts :)

Right now, the officially supported operating systems are Windows and Android. Some work has been made on a Linux GUI client, but it isn't finished yet. I even sent @DarkestEx a alpha version for testing, but never heard back, and looking at the server it doesn't seem like he's ever used it. From my testing, it works, but installing it requires lots of different packages, that aren't called the same on all distros (and some must be installed through pip as they aren't in the distro repos). I tried to package the app (which is written in Python) as a single binary, using multiple methods, but all of them failed, namely due to how the GTK bindings work.

iOS support will require at least $1500-$3000 in profits/donations, since I'd need Mac hardware for developing and the Apple dev account for store publishing, and of course some real iOS hardware would more or less mandatory, since I suppose the battery stuff and standby synchronization is kind of hard to test on the simulator. All of this, assuming of course that Apple even made the necessary battery info APIs available (I think we already discussed this a while back, but I don't remember the conclusions?).
A client that can only show information for other devices in your account would be more or less useless, for that you might as well just use the website.

Data is currently stored in one of my VPSs in the US. Data is encrypted in transit (without any MITM like Cloudflare proxies), options for protecting the data while stored in the database are being studied. It's kind of hard, because the server should be able to open the data up for analysis, this means that it would need to store any encryption keys, making database encryption pointless.

EDIT: I forgot to mention, but earlier today I fixed a problem that was preventing the pairing of new devices. This also meant that new users were having trouble signing up. All should be fixed now.
Oops, I am sorry.
I actually used your program and tried it on Windows but it refused to work. No error, but I never lanuched again and Manual tries failed.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc
  • Consoles, mobile devices and vintage computers owned: Hewlett-Packard 100LX, Original Commodore 64C, Tektronix AWG2021, IBM X60s
<- Check out Claw if you like writing code once and having it run on most embedded devices alike :)

Avatar drewn for me by Tabbes.

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
Did you follow the instructions to install the required packages? I think some of them are not available in Windows, namely the GTK bindings might not work correctly.
  • Calculators owned: Prizm CG-20

Offline DarkestEx

  • Super User
  • News Editor
  • Join Date: Jan 2015
  • Location:
  • Posts: 1297
  • Post Rating Ratio: +10/-2
    • @0xbmuessig
    • @muessigb
    • View Profile
    • My homepage
  • Gender: Male
Did you follow the instructions to install the required packages? I think some of them are not available in Windows, namely the GTK bindings might not work correctly.
I think it launced once and never again. I will check later if I can get it to work.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc
  • Consoles, mobile devices and vintage computers owned: Hewlett-Packard 100LX, Original Commodore 64C, Tektronix AWG2021, IBM X60s
<- Check out Claw if you like writing code once and having it run on most embedded devices alike :)

Avatar drewn for me by Tabbes.

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
Out of curiosity I decided to take a look at the Linux client written in Go that I was writing before I decided going for Python instead.

After removing all webkit4gtk related stuff and compiling it with the latest version of the GTK3 bindings, it actually worked better than I expected.

So if you want to try it, check out:
https://clouttery.xyz/static/linux/v0.1/x86_64/clouttery-nix
SHA256 sum: bcfc3e893c3a1a6a3074a6639303e11cfc30c8f36422946007d0c1d51b6b1040

Requirements: a relatively recent version of GTK 3.
It's a (mostly) static Linux binary, chmod +x it and run.
It will create a config.json file on the same directory where the executable is the first time it is run. So it's not a good idea to copy it to any system directory. Keep it in your home directory for now. Later I'll add the option to specify a config file path, and make it look under ~/.config by default, etc.

What works: you find out (not much).

If people can actually use this, I guess I'll try to build a Linux client on top of it instead. It's much easier to package a Go program as a single binary, with assets and everything, than a Python program.
  • Calculators owned: Prizm CG-20

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17448
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
While I haven't gotten enough free time to setup my dumb devices and calibrate them for Clouttery monitoring, I must say that this have become handy a few times since I installed it. I often forget to charge my phone  while on the computer or to remove it from charging, so Clouttery will notify me if battery levels are below 30 or fully charged.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX, HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline gbl08ma

  • Full User
  • Join Date: Jul 2015
  • Location:
  • Posts: 104
  • Post Rating Ratio: +5/-1
    • gbl08ma
    • @gbl08ma
    • gbl08ma
    • View Profile
    • My personal website
  • Gender: Male
I just pushed an update for Clouttery for Windows that was preventing the client from working in certain time zones (in fact, about half of the world!).

The only reason I found out about this was because this night lots of European countries including mine entered daylight saving time.

This is all the more embarrassing because an extremely similar problem had already been detected when we exited DST. I'm pretty sure that at the time I tested the fix with multiple timezones, and the problem didn't occur. Now, and for future reference, I did the same, for time zones ranging from UTC-12 to UTC+12. If things go south again next October, I think I'll lose my mind.
  • Calculators owned: Prizm CG-20

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games