ponewheel / android-ponewheel

pOneWheel Android app
MIT License
71 stars 25 forks source link

No stats after firmware update #86

Closed jj05y closed 4 years ago

jj05y commented 5 years ago

Hey, I just cloned the repo and while the app connects fine, there's no stats available. It may be the firmware update. Can you repro?

ghost commented 5 years ago

Huh, maybe it's a staged release or something, we'll have to ask @kwatkins I guess.

hammer-is commented 5 years ago

@Nanoux app is on Github if you don't want to build yourself (Gemini support is in master branch). https://github.com/ponewheel/android-ponewheel/releases/tag/gemini_support

ghost commented 5 years ago

I'm aware @hammer-is but thank you.

On second thought I think the build Target is the problem, according to this page Google stopped allowing app updates targeting below API level 26 last fall. https://developer.android.com/distribute/best-practices/develop/target-sdk

What Android version is your OnePlus running?

hammer-is commented 5 years ago

@Nanoux my phone is on Android 8.0 but I think it's only minsdkversion that limits what phones can install app/update. If it was targetsdkversion that was causing the limit then no phones with <Android 8.0 would have been able to update any app since last fall and that does not make sense. Targetsdkversion is at 26 https://github.com/ponewheel/android-ponewheel/commit/daddd3bde15a58d4644e8d7e6b778ad313702821

ghost commented 5 years ago

I misunderstood your original comment then, I have no idea.

COM8 commented 5 years ago

What do you guys think about the following: Instead of just sitting here and wondering about their next steps, why don't we proactively try to get in touch with FM? I don't think Facebook is the right way to go there. We should draft a letter/email to them and ASK them why they are doing what they are doing and maybe even suggest some better ways (open sourcing the official app(s), ...) so we both can get along.

Fact is they are trying to lock down the Onewheel to first party apps only. So maybe in the future they actually manage to lock out all third party apps and we can't get around it. At this point it might be to late to get in touch with them.

muellergit commented 5 years ago

I only show the April 2018 release in Play store also. I am running Android 7.1.1 and had been waiting for the update since the New Year.

On Sat, Feb 2, 2019, 6:28 AM Fabian Sauter <notifications@github.com wrote:

What do you guys think about the following: Instead of just sitting here and wondering about their next steps, why don't we proactively try to get in touch with FM? I don't think Facebook is the right way to go there. We should draft a letter/email to them and ASK them why they are doing what they are doing and maybe even suggest some better ways (open sourcing the official app(s), ...) so we both can get along.

Fact is they are trying to lock down the Onewheel to first party apps only. So maybe in the future they actually manage to lock out all third party apps and we can't get around it. At this point it might be to late to get in touch with them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/86#issuecomment-459969364, or mute the thread https://github.com/notifications/unsubscribe-auth/APHfOQNKfqwncLGPBoxsMQWkbCck5jTwks5vJaCJgaJpZM4YnXma .

ghost commented 5 years ago

@COM8 I was planning on doing that, but I can't find a good way outside of the customer support system. Any ideas?

COM8 commented 5 years ago

One way would be creating a thread in the forum.

ghost commented 5 years ago

Last time I did that just mentioning my app existed they deleted my thread, there's no way they would leave that up.

COM8 commented 5 years ago

If they delete our post we know they wouldn't answer us via mail/support. I think if enough of us would comment the initial post with something like:

I'm the dev of XYZ and I would like to know what's up (or so).

The thread has to get some attention form normal people and staff

ghost commented 5 years ago

Forum Moderators and policy makers at FM are probably not the same people, they may just not want drama in their forums.

Does anyone know if the OWBuddy guys still work at FM and how to contact them? They seem like the perfect people to ask

hammer-is commented 5 years ago

Next chapter as I try to solve the Play store version mystery using an old Galaxy S4 on Android 5.0.1.

Factory reset + sign in with my own Google account = access to newest 3.4/Gemini version according to the Play store page. I verified that it could connect to my OW+ successfully. Factory reset and + sign in with another Google account = access to the old 3.3 version! I verified that it did not work with the OW+ (as I don't know how to see the version inside pOnewheel).

So bottom line is that using Android 5.0(.1) pOnewheel can be retrieved from the Play store IF the Google account have access to it...

@kwatkins any idea why only some Google accounts can access version 3.4 of pOnewheel?

ghost commented 5 years ago

If I had to guess, he used the staged rollout feature, whether he intended to or not, which just rolls out the update to a select % of users. It's used mostly by big apps who only want to have 5% of their users experience horrible undiscovered bugs instead of all 100% :p

kwatkins commented 5 years ago

It's a partial rollout (33%) to get logs, make sure it's stable. And it doesn't appear to be, lots of ANR's. More people testing here it the better, especially developers, when I get a chance dive deeper into what is causing the crashes and report back here.

On Sat, Feb 2, 2019 at 9:03 AM Nanoux notifications@github.com wrote:

@COM8 https://github.com/COM8 I was planning on doing that, but I can't find a good way outside of the customer support system. Any ideas?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/86#issuecomment-459980961, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0LrVe7LE5kHHVmqVqzEcjm8JPmnXQOks5vJcTEgaJpZM4YnXma .

kwatkins commented 5 years ago

@nanoux exactly.

Also, from reading the unfortunate DMCA news from this thread - the genesis of this app was to collect data, a black box recorder of sorts to help diagnose wtf was happening with all the nose dives... FM wasn't helping the us figure it out with their heads in the sand. And the information we get from the app also shows placement of foot sensors, when they are engaged, again, this is all safety stuff beyond what the official app or FM talks about.

Annoying to say the least.

On Sat, Feb 2, 2019 at 3:38 PM Nanoux notifications@github.com wrote:

If I had to guess, he used the staged rollout feature, whether he intended to or not, which just rolls out the update to a select % of users. It's used mostly by big apps who only want to have 5% of their users experience horrible undiscovered bugs instead of all 100% :p

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ponewheel/android-ponewheel/issues/86#issuecomment-460009067, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0LrQQ2e5-1zI7HtXT_GbuVN9Lgdapfks5vJiFmgaJpZM4YnXma .

ghost commented 5 years ago

Looking through it really quick, I might know why its happening. In your OnServicesDiscovered function, you setNotify & read every bluetooth characteristic you want, and then do the gemini thing as you get the value for the firmware version. In my experience, the values you setNotify initially will work, but anytime you try to setNotify or un-setNotify (not great with the lingo, sorry), or try to read a characteristic, you get null values.

Heres the flow in my app: I setNotify to all the characteristics I want in a seprate function, because Gemini & Andromeda do it at different times. Step 1: In OnServicesDiscovered, JUST read the firmware version. Step 2: In OnCharacteristicRead, if the value is of the char firmware version, parse it's value. If its >= 4034, JUST write the descriptor for the Serial Read characteristic to Enable notifications, and set notify to true with gatt. Otherwise its Andromeda or lower and we can call the method to read & notify all the characteristics we want. (Although I learned doing this that some android devices have a max of 12 notify characteristics at once for some reason. At least I'm pretty sure.) I also set a class-wide boolean value isGemini to true here so I don't have to keep checking if its Andromeda or Gemini later on. Step 3: In OnDescriptorWrite, if isGemini and the characteristic descriptor that was written was Serial Write, then trigger the byte stream by writing the firmware version onto itself. Step 4: In OnCharacteristicChanged, if isGemini and characteristic is serial read, do the gemini hash crap and stuff and setNotify for serial read to false. Step 5: In OnCharacteristicWrite, if isGemini & characteristic is Serial Write, NOW setNotify and read all the characteristics you want. its also only now that I start the repeated handshake clock thing, but I don't think it really matters, this all happens pretty quick.

That will get you connected, but if you want to do it reliably theres a few tips I found. If you try to reconnect within 24 seconds of the last handshake, for some reason the onewheel sends more than 20 bytes. Like, a lot more. If you do the same hash thing with the first 20 bytes it sends it will still connect, but you have to do something like (inkey.toByteArray().length >= 20) in you gemini function, and put in some logic so that it only executes once and not every time you recieve a byte after the first 20. Also in this case, writing the characteristic usually fails. gatt.writeCharacteristic returns a boolean to tell you if it worked, and when you try to reconnect in this window it usually fails. I just wait a bit and then keep trying, over and over, until it works, but there may be a better solution.

Also, I had a super weird bug on my Pie Pixel where if I tried to read the firmware version immediately in OnServicesDiscovered, the connection would sometimes instantly time out, so I used a Handler thread to delay it 500 ms and that makes it a lot more stable, so do with that what you will.

Anyway, I hope this helps @kwatkins , if you have questions or want a flowchart or something lemme know :P

EDIT: If i can find the time I'll try and add these myself, but between college, work, and trying to save my own app I don't know if that'll happen. But I'll try.

mherfurt commented 5 years ago

@Nanoux Thanks for this helpful insight!

kwatkins commented 5 years ago

@nanoux +1 to the thanks, super helpful. I'll implement this workflow when cycles open up, have a newborn/little dude and dirty diapers to change before changing my dirty code ;)

As always appreciate the help from everywhere here, and definitely open to others implementing this, I can help test and roll out the changes.

ghost commented 5 years ago

I was thinking, does Bluetooth the company have any rules about restricting access to a Bluetooth device in order to get licensed? I can't find anything but that seems like it should be a thing.

mherfurt commented 5 years ago

@Nanoux About 10 years ago, I attended several so-called UPF events (UnPlugFest) organized by the Bluetooth SIG. The Bluetooth SIG itself is an association of different Bluetooth device/chip manufacturers that drive the development of new features of this manufacturer-independent forward.

Back then, it was obligatory for every manufacturer of Bluetooth enabled devices to have their product/platform certified by the Bluetooth SIG. Each platform was certified for implementing a minimum set of Bluetooth functionality so that it is entitled to wear the Bluetooth brand... (Fee for this was about 10k$ per platform)

FM uses a Bluetooth SoC that was developed by TexasInstruments. In this case - I believe - it is sufficient that the SoC module is certified.

The Bluetooth SIG itself does not enforce rules that guarantee a safe/secure use of the Bluetooth wireless technology. Due to the high segmentation, it is almost impossiblke for them to monitor all use-cases of Bluetooth technology.

Long answer short: I do not think so.

ghost commented 5 years ago

Alright, thanks, that's quite helpful. I'll probably write a message to FM customer support sometime in the next few days and hope for the best, really not much else I can do it seems.

ghost commented 5 years ago

Update:

Customer Support ticket has been sent, I couldn't find any other way of contacting FM

I open sourced the free version of Onewave and put a built, unsigned APK in a release for anyone desperate. This class may be of interest to you guys, Its diverged quite a bit from when I got it from the pOnewheel source but it should be quite useful nonetheless. https://github.com/Nanoux/Onewave/blob/master/app/src/main/java/com/nanowheel/nanoux/nanowheel/util/BluetoothUtilImpl.java

EDIT: Just wanted to thank @kwatkins and anyone whos worked on this project, reverse engineering it taught me so much about Android Development and specifically how to connect to BLE.

COM8 commented 5 years ago

Has anybody tested the unlock mechanism with a OW+XR? Since the XR might have a slightly different FW revision. https://github.com/COM8/UWP-Onewheel/issues/5

COM8 commented 5 years ago

Ok, yes confirmed: To unlock an OW+XR we need to listen for and write back the 4134 (0x1026) FW revision instead of the 4034 (0x0fc2) FW revision of an OW+.

Thanks to @TomasHubelbauer.

beeradmoore commented 5 years ago

5686... That is a huge firmware jump, and odd that it isn't 5086 or something. I assume it's via analytics? Any idea of rough location, like California maybe?

TomasHubelbauer commented 5 years ago

@beeradmoore My bad, that was a messup on my part! I was looking at a wrong buffer 🙄

beeradmoore commented 5 years ago

Damn, got me excited for a new OW being discovered in the wild :p (I guess they wouldn't use 3rd party apps to test the new OWs for this very reason).

@jj05y this can probably all be closed now.

COM8 commented 5 years ago

@Nanoux Any news about your ticket?

COM8 commented 5 years ago

Anyone here planing to get the new Pint board? Since it will probably have it's own FW revision.

beeradmoore commented 5 years ago

Yep to the Pint board, although others may get it before me as I wait for it to ship (and clear customs) to Australia.

ghost commented 5 years ago

They closed my ticket without notifying me or even speaking to me ~ 2 weeks after I filed it. Honestly I dunno if I want it to exist in spite of FM or not.

I want a pint so bad, it looks like it solves all the problems I have with my +, just can't afford it rn without selling my current board, which I need for school.

Is ponewheel ok @kwatkins ? I havent gotten the gemini update on my phone and im in the beta channel. We may have a new connection method to crack when pints come out.

I would also really like to know if custom shaping is just locked out in the app and 3rd party apps could enable it. That would be interesting and explain a lot.

COM8 commented 5 years ago

To me it looks like custom shaping is working on my end. I even remembers the set values (most of the time). The only thing I do not notice while driving is changing stance.

grafik

kwatkins commented 4 years ago

Closing this ticket since we got support rolled in... other tickets are/will be/have been spun out from this one for sure.