numbersprotocol / starling-capture

A photo-sharing app with only verifiable photos and videos for professionals.
https://numbersprotocol.io/
GNU General Public License v3.0
17 stars 4 forks source link

Cannot Connect to Internet When Establish Connections in Both WiFi to Canon Camera and Mobile Data #22

Open seanwu1105 opened 4 years ago

seanwu1105 commented 4 years ago

Move from https://github.com/numbersprotocol/mediant/issues/14

Android: 8.0.0 Mobile: Exodus 1 App version: 0.12.1 Capture type: image

Steps to reproduce (Dual Capture mode):

  1. Enable WiFi only i. And connect to the Canon camera WiFi access point.
  2. Go to Settings, i. Click Connect to Canon Camera ii. Enable Polling
  3. Go back to the main screen, i. Click Open CCAPI Live View ii. Enable Dual Capture
  4. Enable Mobile network (and keep WiFi enabled).
  5. Trigger Canon camera shot.
  6. See the pop-up messages in order: i. Successfully uploaded media via Textile. ii. failed to connect to /52.90.13.186 (port 80) from /192.168.1.10 (port 40884) after 1...

Steps to reproduce (Camera Capture mode):

  1. Enable WiFi only i. And connect to the Canon camera WiFi access point.
  2. Go to Settings, i. Click Connect to Canon Camera ii. Enable Polling
  3. Enable Mobile network (and keep WiFi enabled).
  4. Trigger Canon camera shot.
  5. See the pop-up messages in order: i. Successfully uploaded media via Textile. ii. failed to connect to /52.90.13.186 (port 80) from /192.168.1.10 (port 40884) after 1...

Steps to reproduce (Mobile Capture mode):

  1. Enable WiFi only i. And connect to the Canon camera WiFi access point.
  2. Go to Settings, i. Click Connect to Canon Camera ii. Enable Polling
  3. Enable Mobile network (and keep WiFi enabled).
  4. Trigger Mobile camera shot.
  5. See the pop-up messages in order: i. Successfully uploaded media via Textile. ii. failed to connect to /52.90.13.186 (port 80) from /192.168.1.10 (port 40884) after 1...
seanwu1105 commented 4 years ago

This issue requires further study to change the default behavior of the Android networking policy. We need to set the transport type of CanonCameraControlApi connections to Wi-Fi manually. We should try to provide [a custom socket factory from Android Network class](https://developer.android.com/reference/android/net/Network.html#getSocketFactory()) to OkHttp client. Further details: https://github.com/square/okhttp/issues/3736

Reference:

tammyyang commented 4 years ago

This sprint (20.09.10) will focus on the survey of the solution of this issue. The implementation may come later.

seanwu1105 commented 4 years ago

@tammyyang If this issue is not that critical, we should postpone the implementation to the next milestone (beta6).