particle-iot / particle-android

Particle Open Source for Android
Apache License 2.0
37 stars 38 forks source link

Problem with onboarding Photon in some environments #60

Open jensck opened 5 years ago

jensck commented 5 years ago

Original issue: https://github.com/particle-iot/spark-setup-android/issues/51


Hi,

we are developing product based on particle platform and we are using Photon device, which is integrated into our hardware. We have problems with onboarding using Android devices, iOS ones are mostly fine. This onboarding problem happens in approx 80% of tries when in specific environment so it actually succeeds sometimes. This problem happen only on specific wifi networks and can not be reproduced everywhere. Result is that process fails on step 5 - checking if device was claimed. Problem probably occurs earlier - if we watch successful onboarding in Particle console, we can see that device comes online around step 2 in newly added graphical event log. In case that onboarding fails, we can not see any activity in Particle console.

During the onboarding we can se various error logs in logcat. Some of them are "normal" for us and we know, that even if they happen, onboarding can succeed. One stacktrace, which is repeating during step 5 when device fails to set up is this:

I/CheckIfDeviceClaimedStep: Running step CheckIfDeviceClaimedStep E/ParticleCloudException: best msg: Permission Denied W/System.err: io.particle.android.sdk.cloud.ParticleCloudException W/System.err: at io.particle.android.sdk.cloud.ParticleCloud.getDevice(ParticleCloud.java:525) W/System.err: at io.particle.android.sdk.cloud.ParticleCloud.getDevice(ParticleCloud.java:316) W/System.err: at io.particle.android.sdk.devicesetup.setupsteps.CheckIfDeviceClaimedStep.onRunStep(CheckIfDeviceClaimedStep.java:73) W/System.err: at io.particle.android.sdk.devicesetup.setupsteps.SetupStep.runStep(SetupStep.java:54) W/System.err: at io.particle.android.sdk.devicesetup.setupsteps.SetupStepsRunnerTask.runSteps(SetupStepsRunnerTask.java:76) W/System.err: at io.particle.android.sdk.devicesetup.setupsteps.SetupStepsRunnerTask.doInBackground(SetupStepsRunnerTask.java:40) W/System.err: at io.particle.android.sdk.devicesetup.setupsteps.SetupStepsRunnerTask.doInBackground(SetupStepsRunnerTask.java:13) W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:305) W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) W/System.err: at java.lang.Thread.run(Thread.java:761)

We wonder what might cause this inconsistency (that onboarding is sometimes working and sometimes not). It would be best if you would be open to call to discuss this problem. Let me know, if you want to see full logs form onboarding.

Thanks, Ondrej