question

weightup avatar image
weightup asked

HTTP POST Request Fails

I have an app that works fine on all android devices except for Fire Tablets.

The app makes an http call every 1s. This is a POST request to an API Gateway endpoint with JSON data in body. The body is less than 256KB in size.

The requests either do not complete or take well over 30 seconds to complete. On all other android devices we have tested on, the requests complete in less than 3 seconds.

Is there something specific we need to do to support the Fire Tablets? We are using OKHTTP2 to make the requests.

fire tabletandroid
6 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

weightup avatar image weightup commented ·

We have also tried ensuring that we do not fire another request until the previous request has completed. This did not make any improvement.

0 Likes 0 ·
weightup avatar image weightup commented ·

We have now tested on a Fire HD 8 and the requests work successfully. The same code on the 7inch Fire (5th Generation), the requests do not work.

0 Likes 0 ·
Levon@Amazon avatar image Levon@Amazon ♦ commented ·

Hi there,

Thanks for posting! Could you please provide a code snippet that you use to make those http calls, and also a sample JSON data that you send. Thanks!

0 Likes 0 ·
weightup avatar image weightup Levon@Amazon ♦ commented ·

Is it possible to send that to you privately?

0 Likes 0 ·
Levon@Amazon avatar image Levon@Amazon ♦ weightup commented ·

Yes, please login to your Dev Portal account and send us a 'Contact Us' message. If you want to include files, please upload them first to your cloud storage, and send us URLs to those files. You may also include a URL to this forum thread for context. Thank you!

0 Likes 0 ·
Levon@Amazon avatar image Levon@Amazon ♦ commented ·

Hi weightup,

Would you be able to send us a snippet of code that you use to make those http post through okhttp, and also a sample JSON data that you send, as we haven't received those yet. Thanks!

0 Likes 0 ·
Levon@Amazon avatar image
Levon@Amazon answered

Hi weightup,

I'm not sure whether you sent the requested info. If so, could you please indicate the Case ID, so I could look that up? Also, please send us your device serial number (DSN). Thanks!

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

weightup avatar image weightup commented ·

We have narrowed down the issue at hand. The issue is that network calls fail while Bluetooth LE is in use and receiving notifications. The issue still only occurs on the Fire 7. It occurs on over 50 Fire 7s. We do not have a Fire 7 that it does not occur on. The HTTP requests do not ever leave the tablet - the server shows no signs of ever receiving the request and setting up a proxy shows that the request never gets sent.

We have built a small app that just makes the same request 50 times. It works 100% of the time unless we are using Bluetooth in a separate app, in which case it fails.

Once the calls start failing, they continue to fail until the app is closed and re-launched.

0 Likes 0 ·
Levon@Amazon avatar image
Levon@Amazon answered

Hi weightup,

Thanks for additional info.

1) Could you please provide the timing parameters of your BLE device, such as connection interval (e.g Conn_Interval_Min and Conn_Interval_Max), and your expected data rate of BLE transfer. We want to know how your BLE transfers are occupying BLE connection interval time window.

2) It seems you have made some analysis for why you think BLE and HTTP can not work at the same time, so if possible, could you please give some more details on your reasoning: do all HTTP requests succeed 100% when Bluetooth is off; other reasons?

3) Could you enable Bluetooth HCI logs with the following steps:

3.1) Go to Settings->Device Options->Click the "Serial Number" several times, this enables "Developer Options".

3.2) Go to the "Developer Options", find the "Enable Bluetooth HCI snoop log" and enable it.

3.3) Reproduce this issue

3.4) Connect the device to a Linux host, and run "adb pull /sdcard/btsnoop_hci.log" to get the btsnoop_hci.log, and send to us[1].

Also, if possible, could you provide the app you use and let our QA team to test it internally, so we can get any necessary logs.

[1] To send us any logs or screenshots, please upload them to your cloud storage, then login to your Dev Portal account, create a "Contact Us" case and provide URL(s) to those files, and a link to this forum post for context. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.