We want a simple method to get battery level if it exists on a system regardless if its Linux, Windows, or Mac OSX.
Turns out this is pretty messy as part of it relies on the OS vendor and part is really low-level hardware implementation details. But I thought I got all 3 major operating systems covered.
I tested Windows 7 64 bit & Linux Ubuntu 14.04 64 bit - was all worky, but Gael had different results :(
What do you get ?
win 10 64 bit no worky.
I tried here on win 10 , 64 bit.. but no worky "None" was returned (null)
Not much debbuging info.. This was with a fresh install into a new folder with the latest.
Also of interested, the exception/stack trace showed up in the myrobotlab.log, but did NOT show up in the log service or in the java log in the python window.. not sure why the stack trace was supressed there...
.................................................................................
Thanks Kwatters, I can see
Thanks Kwatters,
I can see "C:\WINDOWS\System32\Wbem;" is one of the entries in your PATH variable ... I would have expected Apache-common-exec 'by default' to execute in the same inherited environment for which mrl is running ....
We (Gael, You, and I) are :
Sooooo... by process of elimination IT MUST BE A JAVA 8 THING ! ... cuz I'm running Java 1.7 :)
Now I'm dumping the environment and did a slight code change :
from :
exec.execute(commandline);
to:
exec.execute(commandline, EnvironmentUtils.getProcEnvironment());
As per suggestions from here :
http://stackoverflow.com/questions/2693020/commons-exec-executing-a-pro…;
Hopefully it worky !
Gee, I wouldn't have expected
Gee, I wouldn't have expected this to be so difficult to set up. I fact, I initially tried to set it up myself...
I'm so glad you are on it, otherwise I would be out of charge long before it would finally work.
:)
Raspberry PI 2 with latest Jessie OS
It responds
None
I think that's OK since it doesn't have a battery
Aye .. None for no battery is
Aye .. None for no battery is expected...
Worky on Mac in the
Worky on Mac in the debugger.... Got to see which version of Java i have...
UPDATE : i have java 1.7
UPDATE : i have java 1.7
Worky on Mac ! A miracle !
Worky on Mac ! A miracle ! :D
Thanks :)
Aight found the issue in
Aight found the issue in Windows Java 8 fixed