How can I send data through RN4020 to RN4020 board?

1 post / 0 new
Nikijiang
Nikijiang's picture
How can I send data through RN4020 to RN4020 board?

I am pretty new to bluetooth programming and learning as I go. Currently I am using a STM32 F3 Discovery board to get ADC values from sensors and send them to a GUI on a PC. I have soldered in a RN4020 (http://www.kynix.com/Parts/2704992/RN4020-V%2FRM.html) chip and have another RN4020 PICtail board connected to my computer through USB and I can connect to it's com port.The RN4020 has a built-in high performance PCB antenna optimally tuned for long range, typically over 100 meters.  The compact size, 11.5 x 19.5 x 2.5mm, enables ease of integration in size-constrained applications.  The RN4020 can be used with any low cost microcontroller for intelligent Bluetooth Low Energy applications.  It is fully-certified, has the complete Bluetooth stack on-board the module, and is controlled via a simple ASCII UART interface, making it a true drop-in solution that is easy to use, and easy to prototype, greatly speeding time to market.    I can connect both the RN4020 chips together and send my data however the problem is that I would like to keep sending this data indefinitely but currently, I can only keep the chips active for about 5 minutes before they lose connections. All the LEDs turn off and on and I need to reestablish the connection again. I establish the connection by inputing the ascii commands through putty and putting it into MLDP mode as shown in the user guide "connecting two RN4020 together" example, then I can see the all my data coming through in the putty terminal. I am sending a string of characters through UART from the MCU that looks like this "7, 9, 123, 1234, 1234, 1234, 1234, 1234, 1234" where each of the numbers between commas is a ADC reading. I have slowed down the real time clock in the MCU to 2 Hz  and it seems like I can send more data over time. This might have something to do with one of the chips going to sleep as when I am just using the putty terminal, sometimes there will be no input coming in but the green LED will be active and when I touch my keyboard to send a character, the data will resume sending. So I was wondering if there is something I am not taking into account with bluetooth in general or if I am simply overloading the RN4020. Any suggestions or resources would be helpful, Thanks.