Chapter 5. Obexsender

Obexsender is one of the built-in applications in Access Server. It is dedicated to Bluetooth proximity marketing, content distribution, location based services, and much more. Access Server plus Obexsender provide the user with a ready platform to start content distribution including all the necessary Bluetooth functions from discovering the devices to transmitting the content. The user needs to only focus on what, when, and to whom to send the content - rest is taken care of by Access Server and Obexsender.

The figure below illustrates a simplified Obexsender network:

Figure 5-1. Simplified Obexsender network

5.1. Key Features

5.2. Use Cases

This chapter describes some possible Obexsender use cases.

5.2.1. Content Push

This is the standard functionality in Obexsender. In content push mode, Obexsender is scanning for devices and pushing it to clients who belong to the target group (not opted out by filtering).

Figure 5-2. Obexsender Use Case: Content Push

5.2.2. Content Pull

Obexsender can also be configured into a content pull mode. In this mode, the transaction is initiated by the user. The user can send any file to the server or alternatively a file containing some specific string such as "MP3" or "NOKIA N73". The server parses the received file and as a response pushes a corresponding file to the user if such exists.

Figure 5-3. Obexsender Use Case: Content Pull

5.3. Configuration

This chapter contains instructions from the most basic Obexsender configuration to the more advanced use cases.

5.3.1. Getting Started

The easiest and fastest way to configure Obexsender is through the WWW setup. To do this, your Access Server must be connected to the same network as your PC or, alternatively, you can also use a direct Ethernet cross cable or a Bluetooth PAN connection (see Section 3.2.5 for instructions on how to enable PAN). By default, Access Server uses DHCP, so if you connect it to your LAN, it must support DHCP as well.

  1. Once you have successfully connected Access Server, start the "WRAPFinder" software. WRAPFinder lists all the Access servers in the same network as your PC.

    If Access Server does not show immediately, you may need to push the Rescan button a couple of times.

    Figure 5-4. WRAPFinder

  2. Next, select the correct Access Server and press the Connect button in the WRAPFinder user interface. An internet browser window opens with the Access Server IP address in the address bar.

    Figure 5-5. Access Server WWW Setup

  3. Click the Setup link. A login screen is opened. Enter a correct user name and password.

    Figure 5-6. WWW Setup Main Page

  4. After a successful login, you get access to the WWW setup main page.

Note: At this point, you should check your access server software version. Obexsender works only with software version 2.2.0 and newer. At the bottom of the screen you should see a line saying:


Access Server, S/N 0511170051 (wrap-2-2) -  Copyright © Bluegiga Technologies Inc, 2001-2006
        

If the version is older than "wrap-2-2", you must first update your Access Server. Latest software releases and instructions can be found from www.bluegiga.com/techforum/

5.3.2. Updating Obexsender

If you have software version 2.2.0 in your Access server, you need to update Obexsender to the latest version. It offers many new, useful and necessary features that include:

  • Retry delay, scan delay and reply delay

  • Dump delay

  • Possibility to save incoming files, i.e. remote requests

  • Watchdog support

  • Regexp and Unicode support

  • Other minor bug fixes and improvements

The rest of the manual concentrates on the latest Obexsender, but it also covers all the features offered by previous Obexsender. The main menu of latest (at the time of writing) Obexsender is shown in Figure 5-7

Figure 5-7. Latest Obexsender Main Menu

5.3.3. Ensuring Obexsender is Enabled

By default, the Obexsender application is enabled, so as a first task you should of course enable it if. This is quite simply done from the following page in the WWW setup (Figure 5-8): Access Server - Setup - Applications - Default bootup applications

Obexsender is enabled after a reboot. However, if you have not completed rest of the configuration, do not reboot Access Server yet.

Figure 5-8. Default Boot-up Applications

Note: For Obexsender to start at all, you must define at least one file to be pushed to remote devices. You can do this in:

Access Server - Setup - Applications - ObexSender settings - Edit configuration file

For more information, see Section 5.3.6, chapter "Send these files in this order".

5.3.4. Basic Obexsender Configuration

configuration. As a first step please go the to the WWW setup page in SetupApplicationsObexsender settings.

On this page (Figure 5-7) you can configure the basic Obexsender settings. See Section B.4.3 for default values and detailed descriptions of the settings.

5.3.5. Uploading Files

You can easily upload new content (files) for Obexsender by selecting Upload a new file in the Obexsender main menu. All you need to do is browse for the file you want to upload and click Upload. You will see a confirmation note, for example "File /usr/local/obexsender/Bike.jpg uploaded" .

At the moment, you can only upload to /usr/local/obexsender directory using WWW setup. If you would like to upload to another directory, you must use secure FTP to accomplish that. (Normal FTP is disabled by default in Access Server for security reasons). For example WinSCP, available from http://www.winscp.org, is a good application that for secure FTP file transmissions.

5.3.6. Advanced Obexsender Configuration

Specifying the content (files) to be sent by ObexSender is done by editing the /etc/obexsender.conf file. The file also contains all configurable ObexSender settings (the settings covered earlier and some advanced settings).

In this section, we will only go through the settings that can not be configured using the WWW interface.

Note: Lines beginning with the hash character "#" are comments and ObexSender will ignore them.

Advanced Configuration Directives

baseband

Specify which iWRAPs are used for sending/inquiry. By default all basebands in this Access Server are in use.

Syntax: baseband <ip> <port> [password]

Example:

baseband 127.0.0.1 10101
ignore

Don't send to these Bluetooth devices. The default setting ignore 00:07:80: is recommended. It disables sending files to other Bluegiga Access Servers.

Syntax: ignore <bdaddr-prefix>

Example:

ignore 00:07:80:
tester

Always send to these devices when found (60s interval). Other timeout settings are ignored with these devices.

Syntax: tester <bdaddr>

Example:

tester 00:07:80:80:00:bf
scandir

Obexserver's directory (for remote requests). This is the directory which ObexSender searches for remote requests. It should match the directory configured for Obexserver (/tmp/obex/ in default configuration.

Syntax: scandir <directory>

Example:

scandir /tmp/obex
file

Specify full pathname(s) of file(s) to be sent, possibly at given time. If there are no files specified, ObexSender does not do inquiry. The files specified are sent in listed order.

Syntax: file <filename> [timestamp]

Example for sending tp1.gif first, then tp2.gif:


 file /usr/local/obexsender/tp1.gif
 file /usr/local/obexsender/tp2.gif
            

Timestamp can be specified as Weekday (Mon/Tue/Wed/Thu/Fri/Sat/Sun), Starthour-Endhour or WeekdayStarthour-Endhour:

Example for sending image.jpg on Fridays, image2.jpg every day between 8am and 2pm and image3 only on Tuesdays between 8am and 2pm:


 file /usr/local/obexsender/image1.jpg Fri
 file /usr/local/obexsender/image2.jpg 8-14
 file /usr/local/obexsender/image2.jpg Tue8-14
            
reply

This feature allows you to request specific content from ObexSender. Basic operation is that you send a file with needed information to Access Server and you will receive a corresponding file in return.

The keyword specified is matched for "<content of file from user> + <bd-ad-dr-es-ss>". Keyword is extended regular expression (regex) and case-non-sensitive.

Syntax: reply <keyword> <filename>

Example for replying with pic.gif if a GIF image is sent to Access Server (in fact this matches for the string "GIF" found in the image headers; you could use "VCF" for vCards, "JFIF" for JPEG images and so on):

reply GIF /usr/local/obexsender/pic.gif

Example for replying only to a certain device (its Bluetooth address is already known), ignoring file content (pic.gif is sent back after device sends anything to Access Server):

reply 00:07:80:80:00:bf /usr/local/obexsender/pic.gif
delnomatch

This setting applies if you're using REPLY-feature of ObexSender and you send a file to Access Server to receive specific content. Now, if the file you sent doesn't match to ObexSender configuration, the file will be deleted if this settings is set to "Yes". Otherwise the file is saved. Matching files are always deleted. Disable this if you have some other program doing ObjP/FTP. By default, this is enabled.

Syntax: delnomatch Yes|No

Example of disabling the functionality:

delnomatch No

verbose

Determines the verbosity level of ObexSender logging. The Level can be from 0 to 4, defined by the count of lines with uncommented term verbose. Level 0 means that there will be minimal logging and level 4 that there will be maximum amount of logging.

Warning

Full verbose logging (4) should be used only for debugging purposes, since it creates a lot of logs and the flash memory can be filled rather quickly.

Syntax: verbose

Example of setting maximum level of ObexSender logging:


verbose
verbose
verbose
verbose

dumpfile

You can choose to save the information about already served devices, so you can form a so-called "block list". If this block list is saved in flash memory, it will be preserved even if Access Server is rebooted. This basically ensures that remote devices don't receive the same content even if Access Server is rebooted.

Syntax: dumpfile <filename>

Example of dumpfile in default location:

dumpfile /usr/local/obexsender/ignore.dump

dumpdelay

Determines how often (in seconds) a dump file is updated. "0" disables this feature. We recommend to use a rather big value, for example 15min = 900s.

Warning

Using a small value here can physically burn the flash memory over time.

Syntax: dumpdelay <seconds>

Example of setting dumpdelay with recommended value:

dumpdelay 900

broadcast

This settings tells ObexSender to broadcast already served devices to other ObexSenders (specified using unicast IP address, broadcast IP address or interface name).

Syntax: broadcast <unicast-ip>|<broadcast-ip>|<interface>

Example of broadcasting to all ObexSender in the same network with the default interface (nap):

broadcast nap

5.3.7. How to Store Files Sent to Access Server

By default, all files sent over Object Push to Access Server are stored to the /tmp/obex folder and deleted after they have been processed. It is however possible to save the files to another directory. The following procedure shows how to automatically copy these files to an example folder /usr/local/remote_request. (NOTE: you must first create this folder!):

  1. Create a copier script /usr/local/bin/copier. You can do it for example in the WWW setup -> Advanced settings -> Edit other configuration files and typing here /usr/local/bin/copier. Put the following script into the file:

    
#!/bin/sh
    # to be called from obexsender: --fork /usr/local/bin/copier
    # This directory must exist:
    SAVEDIR="/usr/local/remote_request"
    /bin/cp "$1" "${SAVEDIR}/$3`/bin/date "+%s"`-`echo $1 | /usr/bin/cut -f 2 -d-`"
              

  2. Make the script executable by giving command chmod a+rx /usr/local/bin/copier at the command line interface.

  3. Edit /etc/bluetooth.conf and append to the end of the file the following line (below the line is in two parts, combine these in the configuration file):

    
SET BLUETOOTH LISTEN 3 "/usr/sbin/obexserver --bdaddr $b --prefix $b-$P-
    --fork /usr/local/bin/copier" 110
              

  4. Save changes and restart Access Server.

Now all incoming files are copied to the /usr/local/remote_request directory. The format of the files is bdaddr-btserverport-timestamp-filename.ext.

5.4. Monitoring Obexsender

Obexsender creates log about its operation to a specified log file. By default, no log file is specified, so you should do this first with instructions provided in Section 5.3.4.

When you choose View log in the Obexsender menu, you can only see the summary of Obexsender action, i.e how many successes, failures and retries have occurred. When you select the date or Total in the summary view, you will see more details. You will see to which Bluetooth address the content was sent and if the transmission was a failure or success, or if transmission will be retried later. See some example logging in the figure below:

Figure 5-9. Detailed Obexsender Log View

If you want to see even more details about how Obexsender is performing, you can increase the verbosity level of logging. See Section 5.3.6, chapter "Be verbose (0-4)". Full verbose logging is usually needed in problem solving only.

5.5. Troubleshooting and Known Issues

Troubleshooting:

Known issues: