Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 Roving Networks Bluetooth™ Product User Manual This manual contains the programming guide and command set for the complete family of Roving Networks Bluetooth products. All Roving Networks modules, super modules, serial adapters and USB dongle (RN-USB-X) share the same command set. Any commands specific to a given product will be highlighted as they appear in this document.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 1 Introduction ...............................................................................................................................................3 1.1 Making a Connection ........................................................................................................................3 2 Modes of Operation ..................................................................................................
Advanced User Manual www.rovingnetworks.com 1 rn-bluetooth-um Version 4.77 11/21/2009 Introduction This document contains the software command set and advanced configuration settings for Roving Networks Bluetooth devices. The document covers FireFly and BluePort serial adapters, all Bluetooth modules, and the FirePlug USB dongle. Commands and settings that are specific to a single product or product family will be identified as such in the document.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 dollar signs) from either the remote Bluetooth connection or the local serial port connection. You must enter command mode within 60 seconds (configurable by setting the config timer). NOTE: Only one client can make connection to FireFly slave at a time. As a master, it is possible to make multiple connections from FireFly, but only in a point-to-point, serialized fashion.
Advanced User Manual www.rovingnetworks.com 3.1 rn-bluetooth-um Version 4.77 11/21/2009 Command Mode vs. Data mode Upon power up the device will be in data mode. To enter command mode, send the characters “$$$” through the serial port or from the remote Bluetooth connection. The device will respond with “CMD”. To exit command mode, send “---”. The device will respond with “END”. While in command mode, the device will accept ASCII bytes as commands.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 It is often useful to be able to perform configuration remotely over a Bluetooth connection. To do this, connect to the device over Bluetooth, and using your terminal emulator, perform the same steps as you would for local configuration above. When finished configuring, be sure to either reset the device, or Send the “--“command, which will exit configuration mode and allow data to pass normally.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 Baud Rate select - used to configure 9600 or software selected (default=115K ) baudrate. If the switch is OFF, the stored baudrate setting will be used. When the switch is in the ON position, the baudrate will be set to 9600 regardless of the software setting.
Advanced User Manual www.rovingnetworks.com 4 rn-bluetooth-um Version 4.77 11/21/2009 Command Reference All commands are either one or two characters and can be upper or lower case. Arguments for commands are delimited by a comma. Commands take decimal input except where noted. Text data, such as Bluetooth name, and pin code, are case sensitive. Commands fall into five general categories: SET COMMANDS GET COMMANDS CHANGE COMMANDS ACTION COMMANDS GPIO COMMANDS 1.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 SC,001F SD,0123 SE,<1,0> Encryption 1 to enable, 0 to disable. SF,1 Set Factory Defaults. SI, - Inquiry Scan Window. Sets amount of time device spends enabling inquiry scan (discoverability). Minimum value is 0x0012, corresponding to about 1% duty cycle. Inquiry interval is fixed at 0x800, so time spent in inquiry is 0x12/0x100 by default.
Advanced User Manual www.rovingnetworks.com SP, rn-bluetooth-um Version 4.77 11/21/2009 Security pin code, 20 character maximum. Each time the device success pairs, the BT address will be saved. Up to eight addresses can be stored on a first in first out bases. To erase all stored pairings, reset the passkey command. You can use the same value that is already set.
Advanced User Manual www.rovingnetworks.com SU, rn-bluetooth-um Version 4.77 11/21/2009 Baudrate, {1200, 2400, 4800, 9600, 19.2, 28.8, 38.4, 57.6, 115K, 230K, 460K, 921K }, only the first 2 characters are needed. Example: SU,57 SW, sets the baudrate to 57600 baud. Enable low power SNIFF mode. Default is 0000=disabled. SNIFF mode allows extreme low power operation. Device goes into a deep sleep, and wakes up every 625us * to send/receive chars.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 made up of two one byte intervals. The first interval is the ON period and the second the OFF period. Both are in seconds. The maximum value is 20 seconds for either of the periods. Default is 0000 always actively waiting for a connection. Example: S|,0120 4.1 // creates a 5% duty cycle ON for one second and OFF for 20. GET Commands D Display basic settings.
Advanced User Manual www.rovingnetworks.com 4.3 rn-bluetooth-um Version 4.77 11/21/2009 ACTION Commands $$$ Enter command mode Characters are passed as data until this exact sequence is seen. If any bytes are seen before or after the $$$ characters in a 1 second window, command mode will not be entered and these bytes will be passed on to other side. NOTE: The device will only enter command mode if it is within the configuration timer window (60 seconds from power up by default).
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 of 9 devices will be returned. As devices are found, they are displayed in the format below: ,, 00A053000123,MySerialPort,72010C IN
Advanced User Manual www.rovingnetworks.com 4.4 rn-bluetooth-um Version 4.77 11/21/2009 Z Enters low power deep sleep mode (<2ma) when NOT connected. Can only be exited by power cycling the device or toggling the RESET pin on the module (causing a HARD reset). For more on managing power see section 5. & Returns the value of the DIP switches on Serial adapters and USB-X dongle, or value of GPIO 3,4,6,7 on other modules.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 NOTE: GPIO2 and 5 are driven by the embedded software as outputs, they can be disabled using the direction command, (to save power, for example) and used as inputs. If set to outputs the software will override any user values. SETTING GPIO 8-9-10-11 S*, = MASK[11..8] VALUE[11..8] For the upper 4 GPIO, a single word controls the mask and values, and only the lower 4 bits of each byte are used.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 specific intervals, and sleeps in very low power mode (around 2ma) otherwise. The power savings can be quite dramatic. To enable it, use the “SW,“ command. Example interval timers: 0x0020 = 20ms. (32 decimal * .625 = 20). 0x0050 = 50ms, 0x00A0 = 100ms, 0x0190 = ¼ second, 0x0320 = ½ second, 0x0640 = 1 second. Sniff mode only pertains to an active connection.
Advanced User Manual www.rovingnetworks.com 5.5 rn-bluetooth-um Version 4.77 11/21/2009 Lowering Transmit Power All Roving Networks Bluetooth modules and adapters adhere to the Bluetooth (1.1, 1.2, and 2.0/2.1) specifications for power control. Both the RN-21 and RN-41 radios are Class 1 capable. The power output of the radio is automatically controlled by the baseband. Depending on the operation mode (inquiry scan, page scan, connected) the power is adjusted.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 The default profile is Serial Port Profile (SPP). The firmware also supports the DUN profile in both master and slave modes. To change the profile, use the “S~,” command.
Advanced User Manual www.rovingnetworks.com 7 Design Concerns 7.1 Hardware Signals rn-bluetooth-um Version 4.77 11/21/2009 1. RESET circuit. RN-41 contains a 1k pullup to VCC, the polarity of reset on the RN41 is ACTIVE LOW. RN21/22 contain a 1k pulldown, and the reset polarity is ACTIVE HIGH. A power on reset circuit with delay is OPTIONAL on the reset pin of the module. It should only be required if the input power supply has a very slow ramp, or tends to bounce or have instability on power up.
Advanced User Manual www.rovingnetworks.com 7.3 rn-bluetooth-um Version 4.77 11/21/2009 LED Status . MODE Configuring Startup/Config Timer Discoverable/Inquiring/Idle Connected GREEN LED blink rate 10 times per second 2 times per second Once per second Solid ON The YELLOW LED blinks when data is transferred on either the RX or TX pins of the DB9 serial port. It is a physical monitor of the actual voltage, and is not driven by software in the module. 7.
Advanced User Manual www.rovingnetworks.com 8 rn-bluetooth-um Version 4.77 11/21/2009 Common Problems and Questions My Bluetooth client can see the FireFly and its serial service, but I can’t connect: This is most likely caused by a security setting on your client. FireFly does support authentication by default if the client requires it (using default pincode of “1234”,) but for ease of use, you may want to turn security off on your client.
Advanced User Manual www.rovingnetworks.com 9 rn-bluetooth-um Version 4.77 11/21/2009 Discovery and Connection Example of a Master Discovery/Connection Sequence From power up and no connection: 1) Perform an Inquiry to obtain BT_Address (unless it is already known). Sent : $$$ Reply:CMD // Places Radio in Command Mode Sent : I,30 // Looks forBluetooth devices Reply:00A096112233,1F00Inquiry Done
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 10 Serial Adapter Configuration 10.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 10.2 Dip Switch Settings 1 – RESTORE FACTORY DEFAULTS- Set this switch ON, power up unit, and toggle the switch from ON to OFF 3 times to return the unit to factory settings. 2 - AUTO DISCOVERY – In slave mode, sets a special class of device which is used by a remote master to auto connect. If Switch 3 also SET, the device performs a search, stores, and connects to a remote slave which has this switch 2 set.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 Appendix A: Bluetooth Evaluation Board The Roving Networks Bluetooth Evaluation board has several interfaces for configuration and programming. These are listed below in the table. The board is powered by and external 5VDC power plug or through pin 9 in the DB9 connector.
Advanced User Manual www.rovingnetworks.com Signal Name Board PWR Board GND RS-232 SERIAL-CN1 Pin 1 - DCD Pin 2 - TX Pin 3 - RX Pin 4 - DTR Pin 5 - GND Pin 6 - DSR Pin 7 - RTS Pin 8 - CTS Pin 9 - RING rn-bluetooth-um Version 4.77 11/21/2009 Connector PIN # I/O Direction P1 P1 1 2 Power IN (5.0 -9.0 Vdc) <—> 2 3 4 5 6 7 8 9 Not used OUT IN Not used <—> Not used OUT→ * (active low) IN← * (active low) PWR →IN (4.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 Using the Serial 3.3V TTL signals on the evaluation board The RS232 driver chip must be removed by de-soldering it from the board when connecting to J1 signals. The RS232 chip is the large IC next to the power connector. See below. 809 University Avenue • Los Gatos, CA 95032 • Tel (408) 395-6539 • info@RovingNetworks.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 ACTION COMMANDS + C C,
CF CFR CT, F,1 L I,Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.
Advanced User Manual www.rovingnetworks.com rn-bluetooth-um Version 4.77 11/21/2009 Appendix D: Firmware Revision History Date Version 10/6/2006 10/6/2006 4.11 4.31 7/1/2008 4.71 3/7/2009 8/10/2009 4.74 4.77 Initial production release version on BC04 modules supports 2.0 Changed behavior of PIO7/ DIP Switch 4, forces 9600 baud if set, regardless of baud rate set in firmware. New Bluetooth stack with 2.