TWiki
> Main
> MscapeMakerDocumentation >
WiFiBaseStations
WiFiBaseStations
The WiFiBaseStations sensor allows an mediascape to trigger events when the user moves into range of a WiFi base station or other WiFi enabled device. The most common usage for this object is to provide your mediascape with a fairly-course grain indoor positioning system.
This object does
not allow you to actually send or receive data with the WiFi basestations themselves, but simply to respond to their presence. To work with networked data use the
HTTP object, found under Tools.
Getting Started
This tutorial will explain how to use WiFiBaseStations as a rough location system.
- The first thing to do is put in place the WiFi base stations to use. If you are going to use the existing wireless infrastructure then this step is not required. Mobile devices can be used provided their WiFi cards can be set to ad-hoc mode.
We recommend using small cheap WiFi routers (if you shop around they can be found for £15-£20). It may be possible to power some of the smaller devices using a battery pack for greater portability and an easier set up. Not that these routers do
not need to be connected to the internet.
- Next, you'll need to survey the area to discover which base stations found, and especially to make sure any devices you have placed are up and running correctly.
Run the mediascape and it'll give you a list of all the WiFi base station SSIDs as they are found, along with their MAC addresses. This information is also saved into a text file inside the
_logger directory within the mediascape's content folder. Walk around your area until you are satisfied that you have seen all the devices you expected. Make a note of the locations where particular networks became available.
Next, we can create a mediascape that uses the
WiFi? base stations you have found.
Using the WiFiBaseStations object
- To add the object, Right-click on Sensors and select 'Add Wi Fi Base Stations'.
This object holds a list of WiFiBaseStation objects, each of which represents a single WiFi base station (or series of WiFi base stations with the same SSID). You can think of each WiFi base station as being equivalent to a Region on a map - except with WiFi being based around radio, the 'edges' of the region covered will be rather less distinct.
- To add a WiFiBaseStation object, right-click WiFiBaseStations and select 'Add Wi Fi Base Station'.
Each WiFiBaseStation object has a series of properties that define how they behave.
| Property Name |
Description |
| CombineBaseStations |
If true, multiple base stations with the same SSID will count as one |
| MAC |
The MAC address of the base station |
| SSID |
The SSID used by the base station |
| Threshold |
Signal strength required for the base station to count as in range |
This table will help you decide how to set up the properties on your WiFiBaseStation objects.
| Situation |
Suggestion |
| A single base station has a unique SSID |
Add a WiFiBaseStation object, fill in the SSID, leave MAC blank |
| Multiple overlapping base stations have the same SSID (e.g. a corporate WiFi network) |
Add a WiFiBaseStation object, fill in the SSID, leave MAC blank, set CombineBaseStations to true |
| Multiple base stations have the same SSID, but you want each base station to behave separately |
Add a WiFiBaseStation object, fill in the SSID, leave MAC blank, set CombineBaseStations to false |
| The base station to use doesn't have a SSID |
Add a WiFiBaseStation object, fill in the MAC address, leave the SSID blank |
| You don't know the SSIDs of base stations that the user may encounter |
Don't add a WiFiBaseStation object, use the OnFoundBaseStation and OnLostBaseStation events on the WiFiBaseStations object, which are triggered when any base station is found or lost repectively - see below |
Use the MAC addresses and SSIDs recorded using WiFiBaseStationHarvester to correctly fill in SSID and MAC address properties |
You can now use the WiFiBaseStation object's
OnFound? and
OnLeave? events to trigger behaviour when that base station is found or lost.
Changing the Range of a WiFiBaseStation
You can influence the range at which the events will be triggered by setting the Threshold property for the WiFiBaseStation. This is roughly equivalent to changing the size of a circular region, though the exact range in practice will depend on the power of the signal being broadcast and by environmental factors such as walls, and interference. It is a good idea to test this range in situ, bearing in mind that environmental factors can change the result on a daily basis.
The higher the Threshold is the smaller the range of the WiFiBaseStation will be. e.g. 'Excellent' will give a short range, and 'Very Low' will give the widest range, though the coverage may be rather sporadic.
Advanced
Using the WiFiBaseStations OnFoundBaseStation? and OnLostBaseStation? events
The WiFiBaseStations sensor object can be used to trigger events when any WiFi base stations are found or lost by the wireless driver. If you want to trigger events when a particular known base stations (e.g. you know the SSID or MAC address) are found or lost, you should add WiFiBaseStation objects as described above.
- To trigger events when any base station is found use the OnFoundBaseStation event. Use the SSID and MAC Parameters to find details of the base station.
- Conversely, use the OnLostBaseStation event to trigger events when base stations go out of range. Use the SSID and MAC Parameters to find details of the base station.
- The OnScan event is triggered when a scan is made at intervals specified by the ScanInterval property, though in practice can take longer than the allocated interval depending on factors such as the number of base stations in a given area. The associated parameter 'APsFound' returns a list of all access points found.
Latency
The WiFiBaseStation sensor ScanInterval property - i.e. the rate at which it scans - can be set in the Properties panel. Note that the minimum value is once every 3 seconds, though in some cases environmental factors may lead to the delay being greater. This is most likely to be an issue in areas highly populated with WiFi devices.