-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device setup: Fail to send device commands after connecting to Wi-Fi on Android 12+ #111
Comments
Hey folks, a few questions as we look into this:
I'm looking at this specific change right now FYI:
Thanks, N |
Hi Nick Thanks for the response, appreciate you looking into this. See answers to your questions below.
Yes the device was already connected to a local Wi-Fi network with internet connectivity when starting to setup process.
ip address: 192.168.1.1
The device is a Google Pixel 6a running Android 13. See attached screenshot for Android version details. |
Thanks! Working on a patch to get you out of the immediate jail. Will loop back shortly! |
Initial PR is here - #112 . Its thanksgiving eve and Particle is off on vacation today, so its accordingly a little rough and ready (I need to fix a couple of misc files already from my PR), however, I tested the fix using the exact configuration that was struggling last time and it appears to work. However, potentially my test isn't correct! Please give this a go and lmk - I'll continue to test tomorrow and tweak (for example, the timeout I added in probably is not needed to be so long). |
That's awesome thanks, I appreciate it! I'll give it a test and let you know how it goes. Happy thanksgiving! |
I tried out the new PR, but unfortunately the issue is still happening. See console logs below. Let me know if you need any further information.
|
I see the issue - its because I'm using an Android phone on 13 (pixel 4a) that doesn't have dual wifi AP support, so it disconnects from one network to join the other. I think my fix is directionally correct, but its missing a filter on the network callback to determine which type of network its looking for (internet or local). I'll find a pixel 7 and use that but I can probably change the code in the interim and we can give it a go again. |
I'm happy to test it out if you push through some changes. |
@mrlambchop is there any update on this issue? Could you give me an indication of how long it will take? We are hoping to get an app update out ASAP |
If your app targets sdk 31 and above, the device setup process is not working anymore. It fails after you connect to the device AP, at the point where it is trying to send a device command to get the device ID.
Tested with latest particle repo code, using Pixel 6a running Android 13. If you build the project using targetSdk 30 it works fine as before (same as production version of particle app on play store). But if you change the targetSdk to 31 (or 32/33), the issue occurs.
Might be related to changes in Android 12 - https://developer.android.com/about/versions/12/behavior-changes-12#concurrent-connections
See video showing behaviour when target sdk 31+ https://drive.google.com/file/d/10-BuJg1R71d3_qY8rlUo--bFdv0wqPJe/view?usp=share_link
See console logs during setup process below.
Seems like the cause is this error:
particle-android/devicesetup/src/main/java/io/particle/android/sdk/devicesetup/commands/CommandClient.java
Line 55 in bda2153
Looks like line 55 is where the actually error is occurring, while it's trying to create a socket to use to send and receive device commands.
We are need to target sdk 31 asap to comply with latest Play Store requirements - https://developer.android.com/google/play/requirements/target-sdk
The text was updated successfully, but these errors were encountered: