ponewheel / android-ponewheel

pOneWheel Android app
MIT License
72 stars 25 forks source link

Battery Temperature Not Logged #56

Open muellergit opened 6 years ago

muellergit commented 6 years ago

I noticed that battery temperature is not being logged, and since that statistic is very important when trying to understand battery performance in the cold Winter I think it should be included.

I found in the OWDevice.java file where all of the Characteristics are pulled in from the board and how only some are selected to be logged, so I could add it myself but don't understand the process of using git yet. This may be my chance to learn.

There is a Characteristic called SafetyHeadroom that may be interesting to look at. It could have to do with the regen setting, but if it is instead some sort of dynamic measurement of power or otherwise? I'm curious if anyone here knows. Also is there a separate area (board) for us to discuss things or ask questions/discuss the code without opening "Issues" here? Sorry for being a nube.

kwatkins commented 6 years ago

Glad your jumping into the code, your observations/questions are the type that will help and improve the app.

There are a good handful of characteristics that are referenced in other places - like the official app - and they don't return anything. SafetyHeadroom included. I remember figuring out what that meant but forgot :/.

I will plan to try listening to all the Bluetooth notifications from the board and list them out in a GitHub wiki page. Getting eyes on different value formats might get a match on what the Onewheelin board is saying.

On Jan 12, 2018 2:54 PM, "muellergit" notifications@github.com wrote:

I noticed that battery temperature is not being logged, and since that statistic is very important when trying to understand battery performance in the cold Winter I think it should be included.

I found in the OWDevice.java file where all of the Characteristics are pulled in from the board and how only some are selected to be logged, so I could add it myself but don't understand the process of using git yet. This may be my chance to learn.

There is a Characteristic called SafetyHeadroom that may be interesting to look at. It could have to do with the regen setting, but if it is instead some sort of dynamic measurement of power or otherwise? I'm curious if anyone here knows. Also is there a separate area (board) for us to discuss things or ask questions/discuss the code without opening "Issues" here? Sorry for being a nube.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/56, or

muellergit commented 6 years ago

I look forward to getting more into this and how to use Github after I move this month.

Battery temperature is definitely there and put into the characteristic "dc" array variable anyway, just not selected by the code that sets up what is pulled from that for the logging.

On Fri, Jan 12, 2018 at 9:29 PM, Kevin Watkins notifications@github.com wrote:

Glad your jumping into the code, your observations/questions are the type that will help and improve the app.

There are a good handful of characteristics that are referenced in other places - like the official app - and they don't return anything. SafetyHeadroom included. I remember figuring out what that meant but forgot :/.

I will plan to try listening to all the Bluetooth notifications from the board and list them out in a GitHub wiki page. Getting eyes on different value formats might get a match on what the Onewheelin board is saying.

On Jan 12, 2018 2:54 PM, "muellergit" notifications@github.com wrote:

I noticed that battery temperature is not being logged, and since that statistic is very important when trying to understand battery performance in the cold Winter I think it should be included.

I found in the OWDevice.java file where all of the Characteristics are pulled in from the board and how only some are selected to be logged, so I could add it myself but don't understand the process of using git yet. This may be my chance to learn.

There is a Characteristic called SafetyHeadroom that may be interesting to look at. It could have to do with the regen setting, but if it is instead some sort of dynamic measurement of power or otherwise? I'm curious if anyone here knows. Also is there a separate area (board) for us to discuss things or ask questions/discuss the code without opening "Issues" here? Sorry for being a nube.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/56, or

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/56#issuecomment-357406357, or mute the thread https://github.com/notifications/unsubscribe-auth/APHfObHbMRoIngsPQDY1ovQdjE0ejqV2ks5tKCMjgaJpZM4Rc9F- .

ebabel commented 6 years ago

When we get the notify with uuid for OnewheelCharacteristicBatteryTemp its actually getting set into value of characteristics.get(OnewheelCharacteristicTemperature)

OnewheelCharacteristicTemperature has its own uuid, so I think this is a mistake. controllerTemp is also getting assigned to the same place.

ebabel commented 6 years ago

@muellergit join us here: https://join.slack.com/t/ponewheel/shared_invite/enQtMjk5Nzg0NzAzMzAzLTRmMDY1YWVlN2NlYThhMDRkNzEyMTIwOWRmM2Y3YzcyNDRkMmRkM2I1Zjc3MWQ4ODc1OTNiMjAwZGZhZjYxOTA

ebabel commented 6 years ago

I tried adding the OnewheelCharacteristicBatteryTemp uuid to notify characteristics thinking that maybe you just forgot to add it and its not coming back with anything. @kwatkins can you take a look at that?

see branch batteryTemp

ebabel commented 6 years ago

I fixed the battery not showing up in the UI, although if I understand it correctly its meant to be read on demand and not on an interval like the other stats we log, which means the log will only show one value. I suppose we could poll this on an interval maybe? @kwatkins does that sound legit? Maybe its expensive to turn on that sensor?

two-x commented 6 years ago

Does anyone know how the four different temperature readings are combined to produce the displayed temperature number? (back when the app displayed the batt temp)? Is it an average or a max or min?

This is another two-x related behavior I wish there was an app setting for ...

In the OW+ the four sensors are evenly spaced around the battery pack.

With the two-x upgrade, the first sensor is on the front satellite pack, the second sensor is on the rear satellite pack, and the 3rd and 4th are spaced apart on the internal main pack. So it'd be cool to have separate displayed and logged values for the 1st, the 2nd, and (avg of 3rd & 4th) sensors. So you could see separate temps for each of the 3 separate packs.

I don't see this as necessary, but would be really cool.

Soren

biell commented 4 years ago

Based on my tests, the official app has always reported only on the first number. With pull request #106, I have updated the code to pull this once a minute. I needed to get the temperature on a periodic basis so I can update my alternate battery % remaining methods.

In particular to my code, is how much battery is left after the OW reports it is at 1%, that changes slightly with temperature. Now that I have all that covered, my next todo list item is to look into this more and see what is going on with battery temperature. Battery temperatures are only reported in 5°C increments.

biell commented 4 years ago

I have motor and battery temperatures logged on the main screen with branch https://github.com/ponewheel/android-ponewheel/compare/master...battery_temp_issue56

However, I can only find 2 battery temperatures being sent from the OW to the app. Soren @two-x , you mentioned 4 temperatures, but that was because there are 4 physical temperature sensors, not because you were aware that the Onewheel actually sends 4 temperature readings back to the application, right? I just want to make sure there isn't something you know about that I can't find. If I don't hear back that there is something I am not finding about the temperature readings, I will open up a pull request for this branch.

In my previous research, only one of the two temperatures the Onewheel reports seems to change a lot, though they do both change. I wonder if maybe there is already some averaging going on.