Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SNIFF mode in HC-05 bluetooth module

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
Hi,
I want to use the sniff mode in HC-05 bluetooth module. But couldn't understand the parameters from the the datasheet.
Here is the AT command list **broken link removed**

In that , page number 14, (21. Set/ Inquire—SHIFF energy parameter)
I want to set the sniff mode to reduce power consumption, but the parameters are confusing...
In bluetooth module RN-41, I used the sniff interval, it is having only one parameter to be passed. But here there are 4 parameters. How can I set sniff interval to 1/4 th of a second? The documentation in the datasheet is not so clear..... Also there is no explanation....:sad:
 


Hi Sir,
I checked all those. But there is not even a single example for sniff mode selection.
The parameters for sinff more are max time, min time, retry time, timeout
I am confused with these.
How can I set to a retry intervel of 1/4 second using this?
In RN41 bluetooth module, they explained everything in detail. I can easily activate sniff mode in that using a single parameter.
But I am confused with this max time, min time, retry time and timeout parameters.
 

The first three links provide information on:

Enter SNIFF Mode:

AT+ENSNIFF=<addr>

Exit SNIFF Mode:

AT+EXSNIFF=<addr>

Set/Query SNIFF Parameters:

AT+SNIFF=<tmax>,<tmin>,<retry>,<timeout>

AT+SNIFF?

tmax, tmin, retry, timeout - Default is 0000=disabled

Reference: Third Party Software Documentation, specific settings may not apply to your device.
4.1.1 Inquiry(Discovery) and Page(Connection)Windows

There are 2 timers that can be used to lower the idle Slave mode power of the radio. When not connected, the
Radio is active for a percentage of time listening to see if any other device wants to Discovery (inquire) or
Connect (page). The amount of time the radio is on is called the window, and the rate at which the process cycles
is called the interval. The interval is fixed at 0x800 (1.28seconds) with Sniff disabled, and 2.56 seconds with Sniff
enabled. The window can be adjusted. The default window is 0x200 (320 ms) or 25% duty cycle.

By lowering the window value, power can be saved at the expense of possibly missing an inquiry or page. Since
the host usually retries automatically many times, the only downside is a delay in discovery or connection time.

The minimum window for inquiry or page is 0x0012 (11.25ms). corresponding to about a 1% duty cycle.

Thus, average power can be reduced from >20ma to <5ma in standard mode, and <3ma in Sniff mode.

It is also possible (and desirable for security reasons) to completely disable inquiry. Once a host has found and
installed a device, inquiry is not needed, only page is used to make a connection.

To disable inquiry and still allow connections, set the Inquiry timer to 0 with “SI,0000”.

4.1.2 SNIFF mode

Sniff mode is another power conservation method utilized by Bluetooth. By default, Sniff mode is disabled, and
the radio is active continuously when connected (about 25-30ma) . In Sniff mode, the radio wakes up at 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,<hex word>“ 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. When a connection is made, both master and slave must
support Sniff mode, and agree to the Sniff window, otherwise the radio will stay in full active on mode.

Note: the maximum allowed Sniff interval is about 20 seconds = 0x7FFF sniff word setting.

**broken link removed**





BLUETOOTH MASTER/SLAVE COMMUNICATIONS AND SNIFF/SNIFF SUB-RATING MODES

**broken link removed**

BigDog
 
Hi,
The third party software documentation you provided is the one which I used with RN-41 bluetooth module. There, only one parameter was there for controlling sinff interval. But in the HC_05 module, there is 4 parameters (tmax, tmin, retry, timeout), but I couldn't get understand which one exactly control the sniff interval.
 
I've search the NET and couldn't any specific examples using the HC-05 module, it looks like you'll need to do some detective work along with some trial and error.

The documents which I provided the links in my last reply seem to described the various parameters fairly well, although you might need to translate names of these parameters to those used by the HC-05 modules AT command set, specifically the AT+SNIFF=<tmax>,<tmin>,<retry>,<timeout> and its four parameters.

You mentioned the RN-41 Bluetooth module has a SNIFF configuration command with only one parameter, the posted quote seems to suggest there are several "set" values, like the interval and only the window can be adjusted on the RN-41.

You might also see if any other Bluetooth modules have a similar AT command set as they might provide some insight into properly configuring the SNIFF mode.

BigDog
 
Okay sir, I will try a trial and error also. Because my primary aim is to reduce the current because I am planning to make a battery operated device which doesn't need high data rate and fast response. So I think now I can check the current consumption for each trial values and finally I could decide it.
I am using the HC_05 bluetooth just because it is cheap and I could obtain it from china in bulk quantity for cheap rate. But the RN_41 seems to be little expensive..
 

Actually I just found this white paper with a good description of these parameters:

To enter the sniff mode, master and slave negotiate a sniff
interval, Tsniff and a sniff window, Twin. A slave node
will thus listen to the piconet at regular intervals (Tsniff)
for a short period (Twin). Figure 3 shows the current
consumption using a Tsniff of 1.5 seconds and a Twin equal
to 200 ms. The average consumption is around 9 mA. The
energy consumption will remain low as long as Tsniff is large
compared to Twin.
The sniff mode, using the Ttimeout parameter, allows a node
with enough data to be transmitted to be completely active
during several consecutive Tsniff slots in order to reduce the
data latency. During this period the consumption will be
similar to the consumption during the active mode.

**broken link removed**

I'll keep my eyes open for a SNIFF mode example using a Bluetooth module with similar AT command set.

Like the following BlueGiga Bluetooth Command Set:

SET BT SNIFF {min} {max} {attempt} {timeout}

Example Setting:

SET BT SNIFF 40 20 1 8

BigDog

- - - Updated - - -

Another good description.

Reference: BTM404 Long Range Bluetooth™ Serial Module, Section: 8.1 Low Power Modes using Sniff, Page: 15

BigDog
 
Hallo,
vinodstanur have you solve your problem?
I'm trying to use the sniff mode on my HC-05 module but it doesn't work.

I sent this AT command "AT+SNIFF=40,20,1,8\r\n", with OK reply, but it doesn't work. The bluetooth module consumes 45 mA yet.

Can you tell me where I wrong?

Thanks

Alessio
 

Hallo,
vinodstanur have you solve your problem?
I'm trying to use the sniff mode on my HC-05 module but it doesn't work.

I sent this AT command "AT+SNIFF=40,20,1,8\r\n", with OK reply, but it doesn't work. The bluetooth module consumes 45 mA yet.

Can you tell me where I wrong?

Thanks

Alessio

After few trial and error I found the way to reduce the current to an average of 2 to 3mA when it is not communicating for around 5 seconds but connected or not connected.
For this u have to reduce the Query duration and the Call duration in the IPSCAN command, as below:

AT+IPSCAN=1024,1,1024,1\r\n
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top