• AVR Freaks

Hot!RN4870/71 UART Transparent mode - How to get out of it?

Author
jkano
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2017/01/20 11:43:35
  • Location: Colombia
  • Status: offline
2017/02/14 12:40:43 (permalink)
0

RN4870/71 UART Transparent mode - How to get out of it?

Hi, 
 
I'm using a RN4871 bluetooth module to test BLE communication for a product we are making.
 
Our product is logging data and we need UART transparent service for transmitting a that file to a android tablet, for testing purposes I have the module connected to a PC over UART.
 
I set the service using the command "SS,C0" as the datasheet says and reboot the device to apply changes, but now, the module isn't responding to any command.
 
1. Send $$$ command to enter command mode: No response
2. Send $ command to get out of data mode: No response
3. Send any command: No response
 
I open the Microchip SmartData App for iOS and connect to the module (module send me the %CONNECT,1... string) and use the UART transparent data service to send data to module (module receives it) so I sent the '$$$' string using the App and the module response is CMD> so I assume is on command mode, but I send any command to it and it doesn't response.
 
I did a reboot but it restarts on same mode.
 
So, how I can get out from the UART transparent data mode?
 
Thanks
#1

16 Replies Related Threads

    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/06/20 18:46:33 (permalink)
    0
    There is no "$ command to get out of data mode". $$$ is the default string to enter command mode, and "---" is the default string to exit command mode (the module should respond with "END\r\n").
     
    I'm surprised that the module responded to $$$ via wireless transparent UART - remote command mode is a whole special thing requiring a bonded connection and some command codes to initiate it.
     
    I'm having a similar issue. I reset the module (responds correctly), send a few commands (correct responses received), and exit command mode (correct response received and data mode entered). The problem is that I cannot then get back into command mode again - $$$ produces no response.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #2
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/06/20 19:25:25 (permalink)
    3 (1)
    Do you have the required delay before and after sending "$$$" ?
     
    #3
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/06/20 19:29:43 (permalink)
    0
    AFAIK there is no "required delay" specified in the module's documentation. But I do wait for the "END\r\n" response from the module after sending "---" to exit command mode, and then my host MCU goes and does a bunch of other stuff before trying to get back into command mode again. Now that I think of it, I'm pretty sure I did try a huge additional delay, like 1s, before sending $$$ again, but it didn't help.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #4
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/07/06 22:36:28 (permalink)
    0
    Hello, have you solved your issue regarding escaping from transparent mode? If not please post a reply, and I'll send you some options. Regards, Mike
    #5
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/07/07 07:03:34 (permalink)
    0
    Thanks, Mike. Yes, the problem has been completely solved by changing to a Zentri AMS001 module. I invested hundreds of hours in the RN487x including lengthy correspondence with Microchip, but had to reluctantly conclude that it is not robust enough to base my products on. The Zentri module works perfectly and its documentation is superb.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #6
    hbr
    Starting Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2016/12/20 03:14:39
    • Location: 0
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 03:15:53 (permalink)
    3 (1)
    Hi,
    there must be a time of 100ms after the first $ and the follwing $$.
    So if you use a terminal program with only line input...or you are fast in typing...
     
     
    #7
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 06:14:15 (permalink)
    0
    hbr
    Hi,
    there must be a time of 100ms after the first $ and the follwing $$.
    So if you use a terminal program with only line input...or you are fast in typing...



    Where is this documented?

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #8
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 06:19:46 (permalink)
    3 (1)
    Hi see, User Guide for RN4870, I'll paste it below.It's para 1.3,
     
    The RN4870/71 operates in two modes: Data mode (default) and Command mode. When RN4870/71 is connected to another BLE device and is in Data mode, the RN4870/71 acts as a data pipe: any serial data sent into RN4870/71 UART is transferred to the connected peer device via Transparent UART Bluetooth service. When data is received from the peer device over the air via Transparent UART connection, this data outputs directly to UART. For configuration or control operation, or both, set the RN4870/71 into Command mode. In Command mode, all UART data is treated as ASCII commands sent to the module's UART interface. As illustrated in Figure 1-1, the RN4870/71 can enter and exit Command and Data mode using ASCII command over UART or over configurable PIO. To enter Command mode from Data mode, type $$$ character sequence after 100 ms delay before the first $. A CMD> prompt is sent to UART to notify the external host of the start of the Command mode. The Data mode escape character can change from $ to another character using S$ command. To return to Data mode, enter command --- at the command prompt. The END message displays indicating the end of command console session. In addition to using ASCII Command mode escape character and the command --- to enter/exit Command mode, it is possible to configure a PIO to do the same. This method is more suitable for applications where there is a need for the host MCU to enter and exit the Command mode
    #9
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 10:56:16 (permalink)
    3 (1)
    Right, it says:
     
    "To enter Command mode from Data mode, type $$$ character sequence after 100 ms delay before the first $."
     
    It does not say "there must be a time of 100ms after the first $ and the following $$", as you asserted.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #10
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 11:14:37 (permalink)
    0
    Sorry, I did not read your post properly. I'll read this again. Apologies. Give me a few minutes.
    #11
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 11:31:11 (permalink)
    0
    I want to help. I apologise about the above. 
     
    It may not be a transparent UART issue.
    Here’s a few things I found. I don’t know if these have been set up by you, so they may, or may not be relevant. Forgive me for going back to the beginning. I wanted to check a couple things. I know you were asking about transparent UART, but I wanted to ask you about your original question. Once you get back to me on that, the issue may still be there, or it may be resolved.
    1. Are you unable to get a command prompt? I think that was the original problem?  Is that still the case? If that is the situation, here are a couple things that can cause that;
      1. Low Power Mode. Some changes will disable your return to command mode? For instance if you enable low power mode, that changes the clock from 16MBits to 32Khz, which in turn disables the UART connection. So, if you want to enable low power mode, you need to use Pin 26 (P3_3) to switch the high speed clock back on, and hence the UART interface.
      2. Have you amended the bitmap of features. Table 2-5 in the User Manual, page 22. See “No Prompt” entry, second one in table.
      3. Try entering  ---  that should bring you out of data mode, into command mode.
      4. Next question, if none of the above work, are you still using a terminal emulator on your PC?  What one are you using? E.g. Tera Term or another? This may sound obvious, but I missed this a couple times. Are you still using the default terminal/com port settings? I know that I accidentally pressed the wrong button once or twice, and could not get access, exactly as you describe. 
    #12
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 11:59:22 (permalink)
    4.5 (2)
    Hi Mike,
     
    I am not the original poster, that would be "jkano". It appears he was unable to get into command mode under some circumstances. My own experience with the RN4870 and 4871 is that the bugs are many and unpredictable. They will, after having worked fine for a while, lose their MAC address, becoming bricked until firmware is reinstalled. Some of them would execute the SN command when entering command mode via $$$, but not when using "Fast Mode" to change mode via hardware. Some would enter command mode and execute a bunch of commands just fine, then exit to UART mode via "---", but be unable to re-enter command mode thereafter. These and many other bugs and flaky behaviors led me to abandon the part in favor of the other manufacturer's I mentioned previously. I have over forty years of professional product development experience, and this part has just never felt stable to me. The Microchip support guys admitted to me that they only ever test it with the eval board, connected to a PC terminal program via USB. They have not even bothered to build up a board to test it with a PIC host under real-world conditions, so they don't see the issues. This would lead one to think that the problems are timing-related, but I tried slowing down many things, including pauses between commands and even the rise/fall times of the UART signals, to no avail. At this point I'm very happy to be done with these parts and am having zero issues with the one I'm using now.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #13
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 21:41:18 (permalink)
    0
    Thanks. I am new to Microchip technology.
    I have not worked on this technology for 30 years. I experienced a few problems, similar to those you mention. I thought it was me, i.e. I thought I was doing things wrong. To be honest, some of the issues could have been my fault. I don't know yet.
    I did try their support with one issue, but they did not seem that knowledgeable. I thought that I had been allocated a less experienced person, as I don't have a mega project. So, I thought nothing bad about the experience.
    I am going to persevere with Microchip a bit more.
    I noted your comments about Zentri AMS001. 
    Regards
    Mike
     
     
    #14
    JuliaDee
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 21:52:33 (permalink)
    3 (1)
    I'm generally very loyal to Microchip and have (apart from some ICD3/USB issues) always enjoyed working with PIC MCUs. This line of bluetooth products was acquired lock stock and barrel from another vendor, though, and it's not up to the standards I've come to expect.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #15
    Mike Mckean
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/07/02 00:09:57
    • Location: London, UK
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2017/08/08 21:56:34 (permalink)
    0
    Thanks. I feel a bit better. I'll continue with what I am doing, at least for now. Apologies for sending you message straight back. But, I appreciated the way you handled my responses.
    Thanks
    Mike
     
    #16
    kpapr1
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2016/01/11 02:44:38
    • Location: 0
    • Status: offline
    Re: RN4870/71 UART Transparent mode - How to get out of it? 2019/09/01 08:01:04 (permalink)
    0
    $$$ is NOT a command (or at least it's not handled as one) and therefore shouldn't be followed by a carriage return (\r). It took me a couple of hours to find out. Poor documentation...
     
    #17
    Jump to:
    © 2019 APG vNext Commercial Version 4.5