what is the modulation scheme of IEEE 802.11 beacon frame? - wifi

What is the modulation scheme of IEEE 802.11 beacon frame, is it fixed to BPSK?
Since a station knows the modulation scheme that is supported by the AP via beacon frame, I think beacon frame must use a fixed modulation scheme otherwise the station does not know how to demodulation the signal.

Kind of. The AP must transmit beacons frames that can be "understood" by all stations desiring to associate it with it. In other words, the AP must use beacons that can be understood by the lowest common denominator. For example, a 802.11b and 802.11b/g has to beacon at 1mbps with CCK where as a 802.11g (g-only) can beacon at 6mbps using OFDM, etc, etc.

Related

AltBeacon txPower field in beacon

What is the purpose of the txPower in a Beacon? According to this, How to set Transmitting Speed vs Scanning Speeds for Altbeacon Library, the maximum transmission power is already set by default.
Then what is the meaning of the txPower that can be set when sending the beacon and what are the possible values for it?
The txPower field sets one of the bytes in the over the air beacon advertisement. It indicates what a receiving device should expect the signal strength in RSSI to be when the beacon transmitter is one meter away.
A receiving device can then compare the txPower value to the actual measured signal strength and if it is stronger, that means the beacon is closer than one meter. If it is weaker then the beacon is farther than one meter. These two values (actual signal strength vs txPower) can be plugged in to a formula to get a rough distance estimate.
The reason this is a configurable field in the advertisement is twofold:
Not all transmitters have the same output power, so for best results the value should be set on a per device basis. (In practice this is rarely done.)
Obstructions and reflections of the radio signal can impact the expected signal strength at the receiver. For example, a beacon is installed under a counter or in a cabinet. For this reason, measuring the signal after installation (calibration) is recommended for best results.
The default txPower field for the iPhone 4s (the first phone supporting iBeacon for both reception and transmission.) was -59 dBm. This is fairly typical of mobile phones built since then and dedicated transmitters at the full power allowed by regulatory agencies. But variations of 5dB on specific device models are not uncommon.
Read more in my blog post here: http://www.davidgyoungtech.com/2020/05/15/how-far-can-you-go

Can we detect non-iBeacon beacons on iOS?

I and my team are working on a beacon that we need to talk to an app on the user's iPhone. Since we need the app to detect the beacon and execute code to talk to our API even when killed, we cannot use CoreBluetooth and need to operate as a beacon.
We're attempting to make a custom beacon on a BCM20737S BLE module. Is it possible to have this custom beacon talk to an app on an iPhone as a beacon? (CoreLocation framework)
Thanks!
As long as your packet is broadcasting a packet with the iBeacon protocol, then corelocation can detect it and your app will wake based on detection of this signal. An iBeacon protocol packet is a 25 byte payload set as the manufacturer data field in the BLE advertisement.
The company ID is 2 bytes (0x004C)
The type is 1 byte (0x02)
Data Length is 1 byte (0x015)
Proximity UUID is a 16 byte Hex String
Major is 2 bytes uint16_t
Minor is 2 bytes uint16_t
Measured Power is 1 byte int8_t
This stack thread might be of some use to you.
What is the iBeacon Bluetooth Profile
But essentially corelocation is only configured for ibeacons, if you want to transmit a different protocol packet youre going to need to use CoreBluetooth on iOS, then once you receive the packet, translate it somehow for use with your app.
The CoreLocation framework will only detect iBeacons, which means beacons that meet the iBeacon byte format. You can certainly build your own, and while it does not have to be an official Apple certified iBeacon, but it does have to match the byte pattern. This pattern is widely available on the internet, even if you do not sign up for Apple's certification program that earns you the right to see the spec.
Be careful, however, that you make no changes to rhe byte pattern. Some vendors have built beacon transmissions that tack extra bytes on to the end to send the battery level. While these transmissions are detected, they are detected much more slowly because the header has a different length field, which does not match the hardware filter used for rapid detection in the background.
If you want to customize your beacon format, you must use CoreBluetooth for detections. I have written some open source iOS beacon tools that help do this, using the open source AltBeacon and Eddystone-UID formats as examples. While detections in the background are slower as you say, you can make your beacon transmit both an iBeacon signal (to wake up your app quickly) and a custom beacon signal (to send whatever custom fields you want) to be detected as soon as it is awoken. This way you get fast detection even if you define your own custom beacon format.

What are the uses of beacons?

If probe response packets announces the capabilities of a network,
then what is the purpose of Beacon frames in wireless 802.11 ?
Among other things, beacons allow a device to passively scan all channels for available Access Points so that a list may be presented to a user showing signal strength. They also allow a device to detect if there is another Access Point on the same network and presumably on a different channel with a better signal.

Reading iBeacon measuredPower in iOS

According to the ibeacon protocol "measuredPower" is supposed to be sent by every ibeacon in its advertising packet as the last value after uuid, major & minor values. However, the iOS corelocation service does not have any method which returns this "measuredPower". Also, if we reconfigure an ibeacon and change its txPower then the beacon should ideally advertise a different "measuredPower". Do all beacons do this? And how do we fetch the measuredPower of a beacon in iOS/corelocation.
Directly, it's not possible on iOS. The closest you have is the RSSI on CLBeacon. Given a known distance, you should be able to calculate the signal power.

How to limit the advertising range of a beacon?

Is it possible to limit the ranging of the beacon, so that only devices within a certain close range(or proximity) can identify and connect to the beacon? Lets say for example the devices outside 0.5 meter zone shouldn't be able to see or connect to the beacon. I am using a iOS device as a beacon. In the Apple's CoreLocation API, there is a method called peripheralDataWithMeasuredPower in the CLBeaconRegion class which says:
peripheralDataWithMeasuredPower:
Retrieves data that can be used to advertise the current device as a beacon.
(NSMutableDictionary *)peripheralDataWithMeasuredPower:(NSNumber *)measuredPower
Parameters:
measuredPower:
The received signal strength indicator (RSSI) value (measured in decibels) for the device. This value represents the measured strength of the beacon from one meter away and is used during ranging. Specify nil to use the default value for the device.
Can this be used to limit the range of beacon? If yes, I am unable to understand how to decide the value to set for measurePower parameter? What are they trying to say by ...value represents the measured strength of the beacon from one meter away..?
Please forgive if this is a very basic question. I've recently started iOS development and will appreciate your help. Thanks.
Unfortunately, there is no easy way to adjust the range of an iBeacon without special hardware.
The power field that you mention is simply a calibration value transmitted by an iBeacon. It doesn't affect the actual physical radio range of the iBeacon. If the transmitter can be seen by an iPhone 50 meters away, altering the power field value will not change this at all. The only thing it does is change is the calibration constant which is an input to the distance estimation algorithm (used for the accuracy and proximity fields) inside the iOS software. Altering the power field will affect the estimated distance returned by the API, but it won't change the actual distance at which the iBeacon is first detected.
Altering the transmit power of a standard bluetooth iBeacon is practically impossible. In theory you can use metal shielding to construct a "faraday cage" around the transmitter to mute its power, but my experience is that it isn't very effective and it is highly susceptible to tiny imperfections in the shielding. If you want to change the transmit power you have to have somebody build you custom hardware.
The software alternative is to use the ranging API to track an iBeacon while it is visible, and only perform an action when the estimated distance is close enough, say 0.5 meters as you suggest. This works great -- only in the foreground.
If you require actually waking up your app in the background at a close range, this won't work. The best you can do is have the monitoring API wake up your app when the iBeacon is first detected, and then send a notification to the user and start ranging. If the user elects to bring the app to the foreground (at 50 meters) you can keep monitoring and then perform your desired action at 0.5 meters. If the user does not elect to bring the app to the foreground, iOS will only give you about 5 seconds of time to continue ranging before it suspends your app. It is very unlikely that the distance will change from 50 meters to 0.5 meters in this time.
With most BLE chips I've investigated, there are usually at least four settings for transmission power level that can be used to limit the advertising range.
The Texas Instruments CC2541 (as used in their SensorTag development device) and CC2540 have +4, 0, -6, and -23 as their power level options. However, changing that in the SensorTag does require a recompile of the firmware. As-is, the provided firmware mentions the power level in only one place, but that is just a value that is broadcasted to inform any central listener how loud the beacon is—so that the central device can better calculate an estimated range based on received signal strength (RSSI). An additional line must be added to the firmware to actually change the transmission power. For example:
HCI_EXT_SetTxPowerCmd( HCI_EXT_TX_POWER_0_DBM );
Based on this, there should be two places on an iOS device where you can set the power level: one that just informs the listeners what the level is, and one where the BLE chip's true transmission power is actually changed. However, expect these values to be restricted to only a few enumerated choices which may or may not meet your real-world range needs.
(The SensorTag's -23 setting would probably do well for a 0.5 meter detection range. But if you want the SensorTag to always be advertising, it will require an additional firmware change.)
Have you looked to see if the proximity property was helpful? From the apple docs:
CLProximity
Constants that reflect the relative distance to a beacon.
typedef {
CLProximityUnknown,
CLProximityImmediate,
CLProximityNear,
CLProximityFar
} CLProximity;
I would also experiment trying to combine the the proximity with accuracy and rssi.
It's gonna vary from beacon to beacon. If you use beacons from Radius Networks, they have a transmit power setting that lets you essentially limit the ability of the beacon radio to broadcast to long ranges. I don't know if other brands have it, but most do not from what I've seen.

Resources