svenmeier / coxswain

Your rowing servant
http://play.google.com/store/apps/details?id=svenmeier.coxswain
Apache License 2.0
80 stars 21 forks source link

S4 not detected #71

Closed at062084 closed 4 years ago

at062084 commented 6 years ago

Thanks for providing this nice app. Got a problem connecting, though.

Device: Sony Xperia Z Ultra (C8633), Kernel 3.4.0, Android 5.0.2 Waterrower: CDC RS-232: WR-S4.2, Vendor 1240, Product 10, Class2 (as shown in Coxswain 5.0) Cable: Hama US-OTG Adapter Cable (Micro B Plug 180deg) USB Stick works OK

Symptoms: S4 turned off, Coxswain not started -> plugin cable -> no reaction on S4 or phone Turn on S4 -> no reaction on phone Start Coxswain -> S4 listed in Coxswain USB settings Start training on WR and in Coxswain -> display of monitoring screen, but no data Enabled trace -> did not find trace file Changed 'USB Connectivity' to MSC and MTP on phone -> no difference

Again a cable issue ? Thanks for help

svenmeier commented 6 years ago

Could be a permission problem, so try with re-installing Coxswain: Then when you connect the S4 to your Android device, Android should show a popup, asking you whether you want to start Coxswain. Make sure you check the option "Remember my decision".

Please report back whether this solves the problem.

at062084 commented 6 years ago

Did a reinstall, no difference

svenmeier commented 6 years ago

Since Coxswain is listing the S4 correctly in the settings (Vendor 1240, Product 10), this is not a problem with the cable.

Can you please check the permissions of the App in the Android system settings?

at062084 commented 6 years ago

Installed 'Advanced Permission Manager (Pro)'. This is what the app lists for Coxswain: approx loc, precise loc, body sensors, view network connections, full network access, pair with BT, access BT settings, mod/del content on SD card, control vibration. Installed 'USB OTG Checker': Lists the S4 similar to Coxswain As reported, can mount/unmount access USB memory stick

Bought another USB OTG connector (Renkforce 3 port OTG hub with SD card reader):

Enabled developer mode in Android

--> no change --> did not find anything useful about this "USB devices disabled error". Still investigating

svenmeier commented 6 years ago

Everything looks good to me in respect to your hardware: your S4 is correctly listed in Coxswain an USB OTG Checker - that's good!

I suspect there's a problem with the way Android 5 reports connected USB devices to the App - without this notification Coxswain will not even try to read anything from your S4.

I'm trying to get hold of an older Android device.

at062084 commented 6 years ago

Did a bit of googling for handling of USB on Android (e.g. android.hardware.usb.*) . I'm not a Android developer, though. Seems there's quite a few things that may cause problems. Any e.g. USB sniffer app i could use to help detect the problem ?

svenmeier commented 6 years ago

Here's what you can do:

Please report back precisely whether this works or what doesn't work.

at062084 commented 6 years ago

Sorry for delay. Did as instructed:

And yes, the S4 responds with a single WR, then PING's forever. If i hold the the On/Off on the S4 till it sounds a beep, then a single 'AKR' is transmitted to the Terminal. Keeping 'OK' pressed for a while yields a single 'AIS'. No other response.

svenmeier commented 6 years ago

That's good actually: Communication with the S4 works fine!

There's just an Android notification missing: asking you, whether you want to allow Coxswain to connect to the S4. Perhaps this is a bug in Android 5 :(.

Seems I'll have to add the possibility to explicitly start a connection from inside Coxswain.

NZBeermonster commented 6 years ago

Hi, I have what appears to be the same problem with Android 6.0.1. Sony Xperia Z2 tablet.

Sven, do you have a release date for the ability to explicitly start a connection?

Many thanks.

svenmeier commented 6 years ago

Hm, maybe this is really a Sony specific problem:

https://stackoverflow.com/questions/32001736/sony-xperia-z-with-android-lollipop-not-registering-action-usb-device-attached

I wasn't working on this yet, but I'll see what I can do tomorrow.

svenmeier commented 6 years ago

May be related too: https://stackoverflow.com/questions/32608887/missing-intent-on-real-device-when-intent-filter-is-used/33148451 https://stackoverflow.com/questions/30930616/com-sonyericsson-permission-blacklisted-usb-device?rq=1

NZBeermonster commented 6 years ago

Certainly looks like there may be a smoking gun there.

Many thanks.

svenmeier commented 6 years ago

I've pushed 5.2 into the Play store: it allows you to start a connection by tapping on a device listed in the preferences: Android should ask you whether you allow Coxswain to access the device, the connection should then be established.

My device offered a checkbox to make that decision permanent, and now Coxswain is started as soon as I re-plug in the S4. It would be interesting whether that works for you too.

NZBeermonster commented 6 years ago

Hi Sven,

I've loaded up the new version. I'm struggling to find the device in preferences. Just so I am clear, which preferences are you referring to?

Many thanks.

svenmeier commented 6 years ago

In Coxswain's settings scroll to the bottom, tap on devices, your connected S4 should be listed, tap on that device and it should be connected.

NZBeermonster commented 6 years ago

Hi Sven, Sorry for late response. I've tried this and got no device listed. I'm trying a couple of other android devices today along with new cables just in case I have a fault there. I'll let you know the outcome. Many thanks for your help so far.

svenmeier commented 6 years ago

This issue is about devices listing a connected S4, but not connecting automatically.

If your S4 isn't listed, you have an other problem. Check that your device supports USB OTG and your OTG adapter is working.

NZBeermonster commented 6 years ago

Hi,

Thanks again.

I know my device supports OTG because I have been using Coxswain for 4 months and it's great. It has suddenly stopped working (which I attributed to Sony and their background updates).

I've tested the S4 and it's usb cable (by connecting up to a PC and connecting through to the WaterCoach software). All working fine.

I've checked the Sony tablet by connecting up to a PC via the USB port. The PC recognised the tablet. So the usb port is working.

I think that can only mean my OTG cable has failed. I will get a new one and report back.

NZBeermonster commented 6 years ago

I have replaced my OTG cable with yet another new one and the software now works fine. Hooray!!

This process has taken ages, and I had a few things that led me astray.

Firstly I bought two new upmarket OTG cables that I have now discovered we're not working. I concluded that when I diagnosed that all the other components were Ok. Following that diagnosis a third new OTG cable which is the same brand as the old one (the cheapest on the market) has now worked.

Secondly, the old cable triggers the S4 when I connect my Tablet to it (I.e. It beeps and the S4 comes to life). However, the S4 didn't appear in the device list. This left me confused. On reflection I think that one or more of the conductors in the old OTG has failed such that limited handshaking can occur but data cannot get through - hence the symptoms I witness.

Anyway, I have taken great satisfaction in destroying my old cable with a very large hammer.

Many thanks for your help and prompt responses. Now I have the tools to get back into rowing.

Cheers

svenmeier commented 6 years ago

Thanks @NZBeermonster for reporting back: I'll keep your information in mind for when other users experience similar problems with their OTG adapters.

So back to the original problem: @at062084 have you tried connecting to your S4 with the new app version?