RN 42 Bluetooth

This module provides a very simple way to replace a serial cable connection with a Bluetooth Serial Port Profile (SPP) connection.

As well has having a good set of features accessible via an AT-style command set, one great feature is that out of the box, it is configured to be a serial port host listening for an incoming serial port request. This means that immediately, without any configuration, you can pair the RN42 with a Bluetooth enabled computer, and have a 115200-8-N-1 serial connection

/media/uploads/simon/_scaled_rn42bluetooth.jpg /media/uploads/chris/rn42.png

Hello World!

ยป Import this program

00001 #include "mbed.h"
00002 
00003 Serial rn42(p9,p10);
00004 DigitalOut myled(LED1);
00005 
00006 int main() {
00007 
00008     rn42.baud(115200);
00009 
00010     // echo back characters, toggle the LED
00011     while (1) {
00012         if (rn42.readable()) {
00013             rn42.putc(rn42.getc());
00014             myled = !myled;
00015         }
00016     }
00017 }

Connectivity

RN42 Pinmbed Pin
1 - GNDGND
11 - VDDVout
12 - GNDGND
13 - RXp9
14 - TXp10
28 - GNDGND
29 - GNDGND

Tech Specs

  • Single 3.3v supply
  • Good power consumption figure (typical)
  • 26uA in standby
  • 25mA - Idle Connection
  • 40mA - Active connection
  • Simple interface for serial cable replacement
  • Power, Ground, Tx, Rx
  • Defaults :
  • SPP, 115,200-8-N-1
  • Bluetooth passkey "1234"

RN42 Breakout board




2 related questions:


40 comments:

30 Mar 2011

The RN41 or RN42 by it self is not easy to setup, because the internal application of Roving Networks has very poor performance and based on old 2007 firmware of CSR BlueCore4-Ext. I am also specialist in wireless bluetooth of CSR product.

So: If you want simple solution then I have product with simple control for Bluetooth. I am developed for RN42 and RN41 internal C application, which run on BlueCore4-Ext and it simplify the whole process. It based on the new 2009 firmware, where many bugs of Bluetooth was fixed. I am in process to develop simple PCBs. What I mean: You just need to send data to UART and enable one pin for data transmission. For incoming data you do not need to press anything, whatever Bluetooth receive it come to UART directly. There are others few pins: For pairing, baudrate setup and reset, as also indicator.

Regards, Stas

30 Mar 2011

Hi,

is this comparable to the bluesmirf module from sparkfun. I've been "fighting" with it, for some time, but i can not get any serial communication. Although the blue-tooth pairing works, and i can get in de command mode.

greets,

Marcel

30 Mar 2011

Hi Marcel,

I never used Bluesmirf could you describe it operation please?

Kind Regards, Stas

30 Mar 2011

Also it is possible to create some other requirements for this product ,just let me know what are you need and I can say if it is possible to add to my design.

Kind Regards, Stas

31 Mar 2011

In my solution you do not need to send any AT commands and the total buffer for data transmission is 512 bytes. I am interesting to see what user will prefare the AT solution or simple UART communication solution. Also I am sure the throughput in my solution is much better than in AT. Please vote what you prefer! :)))

02 Apr 2011

The PCB for my Bluetooth project is ready. Now I am in process of order the PCBs.

The 3D view of PCB is below:

/media/uploads/electronix79/rn41_project_pcb_3d.gif

And the 2D is below:

/media/uploads/electronix79/rn41_project_pcb.gif

03 Apr 2011

Ooh, cool. Let me know if you're planning on selling those :)

03 Apr 2011

I will! :) Regards, Stas

05 May 2011

Hi Matthew,

Just receive today 1000 PCB. Hope soon start selling.

/media/uploads/electronix79/i.jpg /media/uploads/electronix79/ii.jpg

For some one who looking just PCB the price will be just 3 pounds. :)

Regards, Stas

07 May 2011

Great :) When you're ready I'll take 4. It might be worth mentioning this on the arduino forums as well, a few people there use the RN modules.

Matt

13 Jun 2011

I am looking for 2 to 3 beta tester before anounce the final products. My bluetooth products will also support firmware upgrades. If you are interesting to be beta tester please contact with me. Thanks.

28 Jun 2011

HI,

Are you still looking for beta-testers? I'm interested! gr,

Marcel

28 Jun 2011

Hi Marcel, Thank you for your interest. Check your PM and contact with me by email.

Many things was happen from the last post.

It seem RN42 is not the cheapest Bluetooth module so this project is extend to support some other Bluetooth modules with exactly the same functionalities which applied on RN41 and RN42.

The RN42 will not be used any more only the RN41 which cover up to 100m.

Instead of RN42 for 10 to 20m coverage I found cheaper solution which will work exactly as RN42.

So one more new PCB was constracted.

And new specification was set for all modules.

Most important the module is now with name BX10 and it support both modes: Slave and Master.

Look at the below image.

The price for this new Bluetooth module is estimated to be under 17pound as final cost, which mean unbitable solution comparing to competitors.

As it will be sold in that price including presoldered breakout board.

/media/uploads/electronix79/project_bx10_new.gif

29 Jun 2011

Hi Anastasios,

Do let me know if you're planning on just offering an RN41 compatible breakout board at any point.

Cheers,

Matt

29 Jun 2011

Hi Matthew,

The firmware is now under reconstraction, so not yet final product. I am estimate August - September the first realease. The RN41 with our firmware and breakout PCB will be estimated to cost 20 to 22 pounds as final price and it will be constracted in limited quantities until price reduced and depand will be higher for them.

Usually the Bluetooth Class2 modules for 10 to 20m in most case are prefered and for this reason BX10 will be the our main focus.

Kind Regards, Stas

29 Jun 2011

Hi Matthew again,

Do you mean plain breakout board for RN41 and RN42? Yes it available for 3 pound each final cost. For 100pcs the price is 2,20 each. I will accept only PayPal payment. If you or any one interesting send me email and I will inform the process.

Kind Regards, Stas

15 Jul 2011

Hello,

Good news, The first part of test finished. And here is the demo, please visit this website for youtube video http://www.uelectronix.com/products.html

Here is the schematic: /media/uploads/electronix79/bx100_mbed.gif

Here are all supported AT commands at the momment:

Quote:

AT For test it. Return OK

AT+PIN=1234 Set password 1234

AT+BRc Set Baud Rate 1200

AT+BRd Set Baud Rate 2400

AT+BRe Set Baud Rate 4800

AT+BR1 Set Baud Rate 9600

AT+BR2 Set Baud Rate 19200

AT+BR3 Set Baud Rate 38400

AT+BR4 Set Baud Rate 57600

AT+BR5 Set Baud Rate 115200

AT+BR6 Set Baud Rate 230400

AT+BR7 Set Baud Rate 460800

AT+BR8 Set Baud Rate 921600

AT+INQ Start SPP Inquire process in order to detect other Bluetooth devices and their RSSI signal if available

AT+SIN Stop Inquire process which can run up to 60seconds. This command will be executed only if Inquire is in process

AT+ADR Show the personal/local Bluetooth address

AT+RSSI? Get RSSI of connected Bluetooth Slave device. This command will be executed only if it connect to Bluetooth Slave device and it is in ConnectedAT state

AT+DIS Disconnect from connected Bluetooth Slave device. This command will be executed only if it connect to Bluetooth Slave device and it is in ConnectedAT state

AT+CON=000000000000,x Connect to the xth Bluetooth device on the list which created after Inquire process. The AT+INQ should be executed before this command

AT+CON=000000000000,1 Connect to the 1st Bluetooth device on the list which created after Inquire process. The AT+INQ should be executed before this command

AT+CON=000000000000,0 Connect to the previous connected Bluetooth device

AT+GBS Get bluetooth state: Initialising, Ready, Inquiring, Connecting, ConnectedAT (Control state), Disconnecting.

AT+RNR Remote Name Read (if Connected). This is Bluetooth friendly name of remote device

AT+LNR Local Name Read. This is Bluetooth friendly name of local module.

AT+DAA Delete All Authenticated Devices from the Paired device list.

15 Jul 2011

// Date: 14/July/2011
// Bluetooth module BX100 in Master mode for mbed v1.01
// by electronix79

#include "mbed.h"

Serial pc(USBTX,USBRX);
Serial target(p9,p10);

DigitalOut led1(LED1), led4(LED4);
DigitalInOut btRESET(p11), btBaudRate(p12),  btDisconnect(p13), btMODE(p14), btSDP_SPP_Pair(p15);
InterruptIn bnSDP_SPP_Pair(p16), bnDisconnect(p17);

void pcRx_interrupt()
{
    if (pc.readable())
    {
        target.putc(pc.getc());
        led1 = !led1;
    }
    return;
}

void targetRx_interrupt()
{
    if (target.readable())
    {
        pc.putc(target.getc());
        led4 = !led4;
    }
    return;
}

void RunSDP_SPP_Pair()
{
    btSDP_SPP_Pair = 1;
    wait_ms(10);
    btSDP_SPP_Pair = 0;
}

void RunDisconnect()
{
    btDisconnect = 1;
    wait_ms(10);
    btDisconnect = 0;
}

int main()
{
    btRESET.mode(PullUp);           // If Low then RESET the module
    btBaudRate.mode(PullUp);        // Set Baud Rate to 115200bps
    btDisconnect.mode(PullDown);    // Set low, if High then required event will happen (this is control input)
    btMODE.mode(PullUp);            // Set high for Master mode, low for Slave
    btSDP_SPP_Pair.mode(PullDown);  // Set low, if High then required event will happen (this is control input)

    btRESET.output();               // Set all below 5 pins as outputs
    btBaudRate.output();
    btDisconnect.output();
    btMODE.output();
    btSDP_SPP_Pair.output();
    
    btRESET = 0;                    // Keep module in RESET state
    btBaudRate = 1;                 // Set Baud Rate to 115200bps
    btDisconnect = 0;               // No event at the moment
    btMODE = 1;                     // Bluetooth will run in Master mode
    btSDP_SPP_Pair = 0;             // No event at the moment

    bnSDP_SPP_Pair.mode(PullUp);    // External button for trigger the Interrupt event for RunSDP_SPP_Pair()
    bnDisconnect.mode(PullUp);      // External button for trigger the Interrupt event for RunDisconnect()
    
    bnSDP_SPP_Pair.fall(&RunSDP_SPP_Pair);  // attach the address of the BTrunSDP_SPP_Pair function to the falling edge
    bnDisconnect.fall(&RunDisconnect);      // attach the address of the BTrunDis function to the falling edge

    target.baud(115200);
    target.format(8, Serial::None, 1);      // Setup UART
    pc.baud(115200);
    pc.printf("\r\nBluetooth module BX100/BX10 in Master mode for mbed v1.01\r\n");
   
    pc.attach(&pcRx_interrupt, Serial::RxIrq);
    target.attach(&targetRx_interrupt, Serial::RxIrq);

    wait(1.0);                      // Wait 1 sec
    btRESET = 1;                    // Remove Reset from Bluetooth

    while(true)
    {

    }
    
    return 0;
}
26 Jul 2011

Hello,

After receiving few emails about how this Bluetooth modules works in Slave mode and if they can work with mobile phones, I decide to make the second video. Please visit this website and scroll down for all youtube videos http://www.uelectronix.com/products.html

Thanks, Stas

01 Aug 2011

Hello there,

I would like to hear if some of you want to create 2 Bluetooth connection through one module? I am thinking if this is need and I can do that then i will push all the available bluetooth modules on the market behind mine. So please left a comments if you would like to connect to 2 different Slave Bluetooth modules simulataneusly.

Regards, Stas

12 Aug 2011

Here is the BX10 the pinout is different from BX100 but the operation is exactly the same it just have smaller range 20m maximum. The schematic will follow as a datasheet as well.

/media/uploads/electronix79/bx10.jpg

Regards, Stas

01 Oct 2011

Back again from holidays,

The User Manual is published and BX10 is available for orders. Please download these PDFs for all required informations:

http://www.uelectronix.com/bx10.pdf

http://www.uelectronix.com/user_manual.pdf

Kind Regards, Stas

20 Nov 2011

Hi Stas,

Your passcode of "0000" did not work for me. However I tried "1234" and that seemed to work although I cannot see any COM port on /dev/tty* (OSx). In addition the connection fails after about 20 seconds and I get a "ATTENTION! Connection to Bluetooth device failed!" error from mbed. Can you recommend any debugging methods?

Regards.

20 Nov 2011

Dear Anand,

So lets start to answers question one by one. According to passcode it maybe was 1234 because our BX10 module was test before shipping so some of them maybe have changed PIN code, during test. So you can easyly change the PIN with proper AT command. like AT+PIN=0000 do not forget to send '\r' (0x0D) character at the end of each AT command. Another one option to return PIN code to default 0000 code is to set back to Factory setting. You can do that like: Set simultaneous to logic high the PIO4 and to logic low PIO5 during the power up and wait until PIO3 & PIO2 will start flashing normally. For normal operation always keep PIO4 in logic low state during power up!!!

So lets move now to second problem which you have. First I am Microsoft user and not OSx, and second I need to know all your steps which you done after connection and you get disconnect after 20sec. Could you also let me know what Bluetooth stack is used in OSx. When you make connetion with BX10 to PC then PC will create additional Serial Port, from which you can send and receive data between PC and BX10. If you cannot see additional Serial Port on Bluetooth stack of OSx then try this on Windows maybe OSx may have not standard SPP Profile support. Or maybe you done something else. You mention you get disconnect after 20sec without sending any data? I need more details what you done after connection and before receive disconnect.

Also from the information which you gives me it seems that you did not connect properly and for this reason you get disconnection. If your connection was success you will be informed by Bluetooth stack of OSx with which new serial port was created, at least in windows this informing occur, probably OSx should inform as well. So what I suggest you is to put BX10 to factory setting and try again.

Also you had order 2 modules, have you the same results with both of them?

Regards, Stas

20 Nov 2011

Hi Stas, Thanks for the response. The modules did work on windows just as described. I know OSx supports SPP. So I'd really like support for OSx. Also, can I get the modules without the breakout board?

Thanks again.

20 Nov 2011

Dear Anand,

So you say that in OSx you cannot connect in Master mode. So can you please try the slave mode. Try to discover the BX10 from OSx, just press on BX10 the discovery button as video show and connect to it from OSx which will play Master role. I want to know if at least in Slave is work or not as well. I need to read more about OSx Bluetooth stack because from your words it seems they have something different to SPP or require something additional to do. According to BX10 without breakboard you want it because it is convenient for you to make your PCB or you expect to have some better price? At the moment I do not offer without breakboard, but if this is for high demand then I will have to make new holder for BX10 where I can programm each as it is. For what amount we are talking? If this is for large amount then I have to contact Rayson and ask them if they can programm it and setup each module individually otherwise if they will reject, then I have to make that holder and program each by my self. Give time for that I will inform you when I am ready for this solution.

Kind Regards, Stas

30 Nov 2011

Dear Anand,

You can get the BX10 without breakout board with minimum order of 100 pcs. They will be programmed directly in Rayson with our firmware. For prices please contact directly to my email address.

Kind Regards, Stas

04 Dec 2011

Lets make the difference!

Have you ever thing to upgrade your Bluetooth module for example RN42, RN41 and etc, to other firmware such as BX10 and BX100 which provides Ultimate Electronix? If yes then read this special article! http://www.uelectronix.com/transform.html

Kind Regards, Stas

05 Dec 2011

Hello there,

Very Great News today!

After development of the proof of concept application on the Android mobile phone we make it works! Our Bluetooth module BX10 in Slave mode is work perfectly with Android mobile phones!

Kind Regards, Stas

09 Dec 2011

user P ANAND wrote:

Hi Stas, Thanks for the response. The modules did work on windows just as described. I know OSx supports SPP. So I'd really like support for OSx. Also, can I get the modules without the breakout board?

Thanks again.

Dear Anand,

Have you tried the http://code.google.com/p/bluecove/ BlueCove solution? On the PC we have worked results, so I think you should manage to work it in OSx. Please let me know about your attempt.

Kind Regards, Stas

08 Feb 2012

Hello again,

/media/uploads/electronix79/bx500.jpg

Our long waiting solution of Class1 Bluetooth module for long distance is coming soon. Comparing to RN41 which support maximum transmission power of +15dBm only, while our BX500 support up to +20dBm. Good news as well is the pin-to-pin compatibility between our BX10 (Class2) and BX500 (Class1) modules. The orders for BX500 modules will be open from next month hopefully. For more details please visit our website: http://www.uelectronix.com

Thanks, Stas

13 Feb 2012

Sparkfun also has several breakout boards to consider for the RN-41 and RN-42.

/media/uploads/4180_1/rn41.jpg
RN-41 Breakout Board

06 Mar 2012

Ultimate Electronix is proud to announce the new Firmware's v3.01 for BX10 & BX500. This Firmware's include additional 22 powerful AT commands. Now the total number of AT commands is 36, which gives huge flexibility to the developers. Please visit our website http://uelectronix.com for more details and the available Datasheets and AT command Manual. The order for both BX10 & BX500 is open from today.

Kind Regards, Stas

08 Mar 2012

Hello again, Just want to share our latest PCB version for BX500

/media/uploads/electronix79/bx500_v1_7_topview640.jpg /media/uploads/electronix79/bx500_v1_7_bottomview640.jpg

Kind Regards, Stas

30 Jun 2012

Ultimate Electronix is proud to announce the latest Firmware v3.14 for BX10 & BX500 and all compatible Bluetooth modules based on CSR BlueCore4-Ext MCU such as RN4x module and etc.

Also we reduced the price of our firmware security keys to less than a half for mass production! Please visit our website http://uelectronix.com for more details.

Kind Regards, Stas

17 Oct 2012

user P ANAND wrote:

Hi Stas, Thanks for the response. The modules did work on windows just as described. I know OSx supports SPP. So I'd really like support for OSx. Also, can I get the modules without the breakout board?

Thanks again.

Dear Anand,

We are proud to announce new firmware 3.20 which support now both RFCOMM and SPP connection, please read our data manual for more details http://www.uelectronix.com/files/pdf/user_manual.pdf. You mention that in OSx you cannot connect with the SPP Profile, probably because it only support RFCOMM and not also SPP. For this reason we add pure RFCOMM connection layer to our new firmware and now it is probably that you will have a big change to connect successfully to OSx. Please let me know if you want a URL for our latest BX firmware 3.20

Remember you must open RFCOMM COM port on OSx in order to receive connection from BX module in RFCOMM communication connection, because it is not an automatic any more like in SPP Profile.

Kind Regards, Stas

30 Jan 2013

What throughput are you getting out of these modules and mbed?

30 Jan 2013

user Matias Bevilacqua wrote:

What throughput are you getting out of these modules and mbed?

Hi Usul,

It is not about the module, but about the firmware approach. In most firmwares the throughput is limitted because there is a process of checking the characters in the buffer such as +++ and etc. In our firmware there is not any kind of this process because the switching between 'data' and 'control' mode is happen with seperate pins. The maximum throughput you can get from it if you utilize the RTC and CTS pins as well in our module and using the baudrate of 921600. Until now we do not have any complain about our firmware performance and compatibility by any customer and this is good way to the right product. We going slowly but stable ) You can try our firmware by contacting us through this website www.uelectronix.com

Kind Regards, Stas

13 Feb 2013

Ok so let me rephrase: "What throughput do you get with your firmware?"

13 Feb 2013

user Matias Bevilacqua wrote:

Ok so let me rephrase: "What throughput do you get with your firmware?"

Hi Matias,

I have not run any benchmark, so you can try our firmware and make comparison with other if you want ) By the way you should remember that the test environment should be the same and the data flow may not be a constant. Because the RFCOMM in our firmware implement asynchronous communication, but generally you get better speed rather in synchronous. Just use the RTS and CTS for utilize in maximum the Bluetooth channel. Hope this may help you. By the way do you have any benchmark for throughput from other Bluetooth modules? If yes could you post it here?

Kind Regards, Stas