• AVR Freaks

Hot!RN4870 - UART hangs up while everything else is working

Page: 12 > Showing page 1 of 2
Author
extronic
Starting Member
  • Total Posts : 33
  • Reward points : 0
  • Joined: 2018/09/06 00:10:53
  • Location: 0
  • Status: offline
2018/12/11 04:46:52 (permalink)
0

RN4870 - UART hangs up while everything else is working

Hello
 
We're developing IoT devices with RN4870. All of them were updated to 1.30 software version. I observe a software bug in the module. Have a look on the screenshot:
 
 
 
During this experiment, I type $$$ C K,1 to initiate a connection and then to disconnect. Module is configured to perform automatic reboot after disconnecting with SR,0080 command. From time to time, without any clearly seen reason, UART in the module hangs up and in the result it does not respond with TryingCRLF but only Tr, Tryin, etc. But!!! The module is still operative. I can issue more commands, module executes them and I can open transparent UART mode and send data to other RN4870. As you see, at the moment pointed with blue arrow, I issued K,1 to break the connection and the module performed action correctly, but no AOK CMD> was responded.
 
 
post edited by extronic - 2018/12/11 04:51:30

Attached Image(s)

#1

21 Replies Related Threads

    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/11 04:55:17 (permalink)
    0
    I can't insert more images to one post
     
    Another problem:

    Attached Image(s)

    #2
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/11 05:14:08 (permalink)
    0
    The module should respond with STREAM OPEN but it hung up at STRE. I typed $$$ and it should respond with 5 characters of CMD>_ but I got five following sharacters of STREAM OPEN flag!

    Attached Image(s)

    #3
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/11 05:15:57 (permalink)
    0
    Then I wanted to check all module parameters, do I typed D. Module responded with rest of STREAM OPEN, then it gave CMD> which should had been given before, and then the result of D command. But the result is also cut.

    Attached Image(s)

    #4
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/11 05:17:36 (permalink)
    0
    It looks like there is a circular buffer in RN4870's UART functions and head or tail pointers are wrong.

    Attached Image(s)

    #5
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/11 05:21:19 (permalink)
    0
    Any ideas to solve this problem? Factory reset is not a solution - already tried.
     
    This problem is very annoying especially when connecting with other module. The connection is established but I can't communicate with a module so I need to break a connection, reboot and try again. It wastes a lot of time.
    #6
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/13 00:28:05 (permalink)
    0
    Another part of investigation. I performed factory reset and tried again
     
    I've written a simple script to connect and disconnect another module automatically. Module is already bonded to second one and it's configuration is SR,0040 to run script after reboot. Try this:
    @PW_ON
    C
    @CONN
    K,1
    @DISCON
    C
    Here's the result. After 5th trial the module's UART hung up. 

     
    After the hang up, module's Tx Indicator pin is always low. 
    post edited by extronic - 2018/12/13 00:40:55

    Attached Image(s)

    #7
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/18 06:52:15 (permalink)
    0
    Have anyone experienced same problems?
    #8
    xjag
    Senior Member
    • Total Posts : 135
    • Reward points : 0
    • Joined: 2007/07/11 04:56:36
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/18 07:10:49 (permalink)
    0
    I have problems with the UART. The flow control hangs up. The RTS of the RN4871 remains permanently high. I reported the problem a long time ago. Until today it was not solved.
    #9
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/21 00:21:11 (permalink)
    0
    xjag, what baud rate do you use?
     
    I've noticed that this problem occurs more frequently when baud rate i 9600. When 115200 the module works more stable, but still not 100% reliable.
     
    I turned on hardware flow control (SR,8000) as you mentioned. I wired CTS pin to ground and attached probe to RTS. When a hangup occurs, pin RTS goes high for some time, then it becomes low but UART does not output any data until reboot.
     
    I think that RTS pin should bo connected to MCU as a 'hang up indicator' :D when it's high MCU has to perform hard reset :D 
     
     
    post edited by extronic - 2018/12/21 00:25:18
    #10
    xjag
    Senior Member
    • Total Posts : 135
    • Reward points : 0
    • Joined: 2007/07/11 04:56:36
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/21 01:34:13 (permalink)
    0
    I use the default baud rate of 115200 Bd. I came across the problem two years ago and reported it to the FAE. It was the firmware 1.18.2 in that time. I read the release notes of newer firmware versions - no action. I tried newer firmware versions - the same failure. I reported it again later and described the problem in the Support Ticket System. Until today there was no answer, no hint, no help and above all no bugfix. I looked in the forum from time to time to see if others have the same problem. That seems to be the case now, after all. For me it was easy to reproduce it by using the F-command, scanning and stopping several times.
     
    #11
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/21 01:59:47 (permalink)
    0
    Have you invented any workaround? Do you use these modules in serial production? I'm actually working on three prototypes that will talk to each other with bluetooth and RN4870 meets all our requirements but reliability of this module is questionable. 
    #12
    xjag
    Senior Member
    • Total Posts : 135
    • Reward points : 0
    • Joined: 2007/07/11 04:56:36
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2018/12/21 02:16:55 (permalink)
    0
    Yes we use it in serial production. I observe the RTS signal and if it hangs for some time I do a hardware reset and initialization. It just takes confidence in reliability. Currently there are problems in the field, from time to time, that our device is not available. It can not be scanned then. It then has to be restarted to be reachable again. Sometimes it is enough to wait for half an hour, for whatever reason.
    #13
    ncherkasov
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/05/05 23:29:30
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/12 09:38:35 (permalink)
    0
    Eh,
    I have the sam eproblem - the unit is horribly unreliable! Out of 20 units I have, 2 failed to work, 2 reset to MAC 00000..000 on factor reset (I reset possibly 5). I have not implemeted RTS so have to reset the unit every 30 seconds to be sure it works somewhat reasonably...
    #14
    extronic
    Starting Member
    • Total Posts : 33
    • Reward points : 0
    • Joined: 2018/09/06 00:10:53
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/14 00:53:28 (permalink)
    0
    I strongly advise you to look for Bluetooth module from other vendor if you are still at prototyping phase of your product. Otherwise you may lose lots of money after receiving first production batch and then you'll be forced to change RN4870 to something that is working correctly.
    #15
    ncherkasov
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/05/05 23:29:30
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/14 07:23:43 (permalink)
    0
    Thanks. Have you found an alternative - I like RN4870 because of its simple no-programming approach. Could you suggest anything as small that works at least?
    #16
    MicroCNC
    Senior Member
    • Total Posts : 132
    • Reward points : 0
    • Joined: 2012/11/13 10:55:22
    • Location: Planet Earth
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/14 08:47:39 (permalink)
    0
    I HAVE PROBLEM TOO. It works with discovery app fine but I lose connection randomly. I have the REST connected to ground still problem. Does anyone know what is going on?.
     
    Thanks
    #17
    scrungy
    Senior Member
    • Total Posts : 134
    • Reward points : 0
    • Joined: 2016/02/02 09:56:54
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/14 09:08:22 (permalink)
    0
    That kind of behavior is why we gave up on the RN4020.  That and many other communication issues, like it just forgetting it's configuration randomly, and stacking up status reports and when the buffer fills up internally, just 
    jamming them into the serial channel.  Screwed up the code big time.
    I don't think this module line firmware is any good, especially with the MDP serial protocol.
     
    #18
    scrungy
    Senior Member
    • Total Posts : 134
    • Reward points : 0
    • Joined: 2016/02/02 09:56:54
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/14 09:10:48 (permalink)
    0
    The RN4020 is even worse.  It loses it's configuration randomly, spits garbage into the serial stream and so forth.
     
     
    #19
    JJay
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2012/09/07 07:41:08
    • Location: 0
    • Status: offline
    Re: RN4870 - UART hangs up while everything else is working 2019/05/31 11:40:34 (permalink)
    0
    I'm working with the RN4871 and expect to use Flow Control.  I had issues so I've updated to v1.30 firmware.  Even so, I've found that enabling flow control on the RN4871 via SR,8000\r seems to prevent ANY further commands from executing until I reset the device.  I was attempting to use the command R,1\r but the module NEVER responds to anything after a call to SR,8000\r.  It doesn't matter if my host processor uses flow control or not.  However, my host does control the RESET pin.  So, I bounce RESET for 50ms.  On boot after this reset, flow control with the RN4871 now works.
     
    Per the Users Guide, the "Sx,,,," commands are not supposed to take affect until after rebooting the device, however, this does NOT seem to be true.
     
    What I've learned:
    1. Using the SR,xxxx\r command seems to hang the unit and a manual reboot (via RESET pin or power bounce) is required.
    2. Resetting factory defaults using SF,1\r restores operation WITHOUT flow control, so my host processor must act accordingly.
    3. Not all S commands require a reboot to take affect or change operational characteristics.  Trial and error is needed to figure this out.  However, a reboot after you configure it is a good idea.
    4. ALL S commands are supposed to respond with something (AOK, CMD> , etc).  You must always wait for ALL these response characters before attempting to send the next command to the RN4871.  I don't know how variable each response time is, but responding too soon seems to cause problems.
    5. These modules default to 115200 baud, using anything different requires first using 115200 to configure a new baud rate, then changing the host to use that new baud rate.  Why bother with changing it?
     
    Things I'm still watching:
    1. On power on, I set factory defaults of the RN4871 and reconfigure it.  This is due to a legacy methods from other modules in the family and previous developers.
    1.1 This shouldn't be required, but for consistent operation is it a good idea?
    1.2 My boot sequence with reconfiguration does NOT use flow control and works, even though the last 'saved' configuration had flow control turned on????  Not sure how this is working.
     
    Also note, I'm using Transparent UART for virtual serial port operations.  Not all terminal emulators are the same and may cause apparent loss of characters/bytes, but that could be the terminal apps fault, or a Windows fault, and may not be caused by the RN4871.  Make sure you wait for all commands to completely finish before sending the next command.
     
    Perhaps this info can help somebody.
     
    Regards,
    J
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5