• AVR Freaks

Hot!RN4020 not working with Samsung Android 10

Author
da66en
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2005/04/11 12:18:34
  • Status: offline
2020/02/25 08:00:02 (permalink)
0

RN4020 not working with Samsung Android 10

I am having a problem using the RN4020 with Samsung devices running Android 10. The same Samsung device running Android 9 works. I don't think it's a problem with Samsung or my code, for reasons described below. I am using MLDP. I recreated this in 1.23 and 1.33 RN4020 firmware.
 
The symptom is the RN4020 seems to get in a half state where it doesn't think it's connected, but Android does. The connect LED on the RN4020 is not lit, but the 'Connected' state from the 'D' command on the RN4020 says it is connected, the RN4020 is receiving data from the Android, but data sent from the RN4020 is not received by the Android.
 
The RN4020 does seem to warn me that something bad has happened, because when the Android 10 device connects I get these unitiated messages from the RN4020 and it exists MLDP mode (I have to toggle the MLDP pin to go back into MLDP mode):
  ConnParam:0006,0000,01F4
  ConnParam:001C,0000,01F4
 
Microchip does not document what those values mean. But I usually only seem them when the other device has disconnected from the RN4020.
 
I was able to recreate this in a native Java Android App that I developed, as well as a Cordova framework Android App that I developed. It's of interest to note that the MLDP Terminal app that Microchip developed doesn't work on my Android 10 Samsung devices (scanning doesn't find any RN4020s) but it does work in Android 9 Samsung devices.
Here is the result of the 'D' command when it has this weird faulty connection to Android 10:
  BTA=001EC01D0E9A
  Name=MYDEV
  Connected=741788980023,1
  Bonded=no
  Server Service=80000000
  Features=3A10CC00
  TxPower=4
 
Notice that the 'Connected' says it is connected. Android 10 says it is connected. But the connect LED is not lit. I can receive data from the Android but Android does not receive the data from the RN4020.

Here is the result of the 'D' command when it's connected to Android 9:
  BTA=001EC01D0E9A
  Name=MYDEV
  Connected=60C90CDE3511,1
  Bonded=no
  Server Service=80000000
  Features=3A10CC00
  TxPower=4
#1

8 Replies Related Threads

    Do_S
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/10/12 02:44:13
    • Location: 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/11 07:18:40 (permalink)
    0
    Hi,
    thanks for the Post.
    I'm hanging with the same Problem. Do you have any solution or hint in the meanwhile?
     
    Thanks a lot!
    #2
    joeyd999
    Starting Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/05/27 08:05:43
    • Location: 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/12 06:00:02 (permalink)
    5 (2)
    Workaround:
     
    In the SR command, turn on "Server Only", 0x00002000.
     
    I've confirmed this works seamlessly, as long as you are not using the RN4020 as a client.
    #3
    da66en
    Starting Member
    • Total Posts : 71
    • Reward points : 0
    • Joined: 2005/04/11 12:18:34
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/17 14:55:52 (permalink)
    0
    The SR command to set 'server only' worked for me, too.
     
    I am hoping Microchip can provide a solution that can be applied at the app level.
    #4
    Do_S
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/10/12 02:44:13
    • Location: 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/18 02:39:13 (permalink)
    0
    Thx, it works!
    #5
    JPortici
    Super Member
    • Total Posts : 1114
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/18 02:50:41 (permalink)
    1 (1)
    Probably not unrelated, as android 10 changed how permissions work, again: in order for BLE to work, in many devices including the S10 you need not only to give the new permissions (FINE_LOCATION alongside with COARSE_LOCATION) but to keep location enabled on the device as well
     
    We had issues with some customers that wouldn't be able to find our BLE units after updating to Android 10, it turned out that those customer didn't keep Location (and GPS) active at all times, as i, the developer, and all the tester and probably everybody that i know do, but only when they had to use maps or waze or whatever.
    Which is strange. I mean, who on earth would think that Location (or GPS, as it is called in most phones i've ever used) is directly related to the functioning of bluetooth?
    Facepalm to google, also for not putting this change in bold characters in the documentation.
     
    #6
    joeyd999
    Starting Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/05/27 08:05:43
    • Location: 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/03/18 03:46:31 (permalink)
    5 (2)
    AFAICT, these issues are unrelated.
     
    With the RN4020 client/server mode, Android 10 (only on Samsung devices) seems to choke midway through the negotiation process, leaving the connection in a strange intermediate state:  Android thinks it's connected, but the RN4020 never presents the "Connected" message. It does present a "ConnParam:" message, though, so they are talking.  In this state, no data traverses the link.
     
    I believe the problem lies in negotiating services provide by Android during the link process.  Setting the RN4020 to server-only seems to preempt this part of the negotiation and avoids the problem.
    post edited by joeyd999 - 2020/03/18 03:47:41
    #7
    dvseneco
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/05/15 00:15:07 (permalink)
    0
    Thanks for posting this information, very useful! I have had the exact same issue reported with a Samsung Galaxy A50 and a Samsung Galaxy S10e.
     
    Fortunately the workaround to set the "Server only" bit works. Thanks da66en and joeyd999!!
    #8
    joeyd999
    Starting Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/05/27 08:05:43
    • Location: 0
    • Status: offline
    Re: RN4020 not working with Samsung Android 10 2020/06/01 10:00:02 (permalink)
    4 (1)
    I received an update for my Note 9 today.
     
    Bluetooth with the RN4020 now seems to work properly again.
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5