bertrandmartel / fadecandy-android

:sparkles: Fadecandy server library to manage your Fadecandy USB controlled LED driver on Android
https://bertrandmartel.github.io/fadecandy-android
MIT License
25 stars 3 forks source link

Un-explained disconnections #2

Closed smallfly closed 7 years ago

smallfly commented 7 years ago

Hi Bertrand, hi Micah,

We are currently working on an artist/circus project that uses FadeCandy and NeoPixels controlled from an Android Asus ZenFone 3 using Bertrand's Android port. All this is magic! Thanks to both of you.

Yet, it would not be fun if everything was working as planned ;) ... We are encountering some intermittent disconnections that we are not really able to understand as they are hard to reproduce.

The FaceCandy seems to disconnect when we send some specific colors. For example, if I send #FF0000, #00FF00, #0000FF it works, but if I send #FFFF00 or #FF00FF the LEDs will turn off as the FadeCandy will be disconnected. In order to work again, I will have to unplug and replug it to the phone. I had the issue with both our application and Bertrand's application available on Google Play.

It seems to me that I have tried everything, and yet I not able to constantly reproduce the problem - meaning that it will work for sometime (undefined) and then the issue will pop again. Therefore I'm taking the liberty to contact you both in order to see if you have ever had this issue, or if you would have any advice.

Thanks a lot,

Hugues.

bertrandmartel commented 7 years ago

Hello, did you experienced the issue with other Android phones ? Did you try to change power cables ? I remember having kinds of disconnection due to the power cable or wiring issue. Are you powering using OTG cable ? In that case do you experience the issue when the phone is on battery (without OTG power cable)

smallfly commented 7 years ago

Hello,

Thanks for the quick reply!

It's hard to say if we did experienced the issue with other phones - and as it's, at least for now, impossible for us to reproduce the problem on demand we can not really test this

We have the issue with at least 2 differents OTG cables.

We are not powering using the OTG cable. The FadeCandy and LEDs are powered by an external battery.

bertrandmartel commented 7 years ago

I see I will try to reproduce the issue tomorrow. I meant was the phone powered by the otg cable or by its own battery ?

smallfly commented 7 years ago

It seems that:

Here is a photo of the 'setup'. As you can see the OTG cable is a single cable (not a splitted one - OTG cable with a power connection) FadeCandy otg

Thanks!

bertrandmartel commented 7 years ago

I think this is related as you're not using a splitted cable which matches your internal android device USB wiring. IMO buying any splitted cable is likely not going to work (it will either charge the battery or perform usb host but not both) unless someone who has exactly the same phone has found a cable which perfom both (people usually buy this kind of cable to charge their phone in their car while connecting to a USB peripheral at the same time but it's quite rare).

But to confirm this is the issue, you can remove power from the OTG cable (so smartphone is only powered on battery) and see if the issue happens

smallfly commented 7 years ago

Hi,

Sorry for not updating this thread.

We have found the issue. It was indeed a 'power related' issue. I think it's related to the fact that the phone can do 'reverse charging'. To solve it, we have to follow specific steps to plug every parts of our setup. The FadeCandy & LEDs kit needs to be pluggued to the battery first. Then the battery needs to be awaken / on, before plugging the OTG cable in the phone. Doing so the battery will be used to power the FadeCandy and LEDs, and the phone will charge from the battery too.

Thanks!