| Access Server: User's and Developer's Guide | ||
|---|---|---|
| <<< Previous | Next >>> | |
This chapter describes the basic features of a Bluegiga Access Server. This includes information on using Access Server as a Bluetooth LAN/PAN Access Point or a Bluetooth Serial Port Cable Replacer, using the Web Server, ObexSender, and WRAP Package Management System. The various ways of uploading content for browsing and/or downloading are also included, as well as getting familiar with the utility applications.
Using the features described in this chapter does not require Access Server Software Development Kit to be installed.
Note: The default username is root and the default password is buffy.
Note: Most of the configuration files are in Linux text file format, where the lines end with a single Line Feed (LF, "\n") character. Some applications will not work if the configuration file format is changed to MS-DOS format (this happens, for example, if you transfer the files to Windows for editing with Notepad), where the lines end with both Carriage Return and Line Feed (CR+LF, "\r\n") characters.
The Access Server network interfaces are described in Table 3-1.
Table 3-1. Access Server Network Interfaces
| Interface | Description |
|---|---|
| nap | Dynamic virtual Ethernet ("cable") device. This is the device having an IP address. All the programs should use this device instead of eth0. |
| eth0 | Real Ethernet device, which is dynamically linked to the nap device. Do not use this device, use nap instead. |
| wlan0 | Wi-Fi device. In the client mode (default), this device has its own IP address. In the access point mode, it is dynamically linked to the nap device (the default interface). |
| wifi0 | Virtual control device for wlan0. Do not use this device. |
| gn | Virtual device for PAN-GN connections. |
| bnep# | These devices are used for incoming and outgoing PAN connections. These devices are created, deleted and linked (to nap or gn) dynamically. |
| ppp# | These devices are used for incoming and outgoing LAP connections. These devices are created and deleted dynamically. By default, data coming from ppp# is masqueraded to the nap device. |
The iWRAP servers (one server in Access Server 2291, three in Access Server 2293) are automatically started at power-up. By default, the Object Push and File Transfer Profiles are activated. The iWRAP servers can be accessed and controlled (by applications or even interactively with a telnet client) through the iWRAP interface, described in Chapter 7. Currently, there can be up to 14 simultaneous Bluetooth connections between a single master iWRAP server and up to seven simultaneous slaves.
The access to iWRAP can be password protected. The default password is buffy, but it can be set off or changed with the setup application (see Section 2.4). The password is case sensitive. The password must be typed in as the first command after the server has replied with "READY."
This profile is not automatically started at boot. The default settings can be changed with the setup application (see section Section 2.4), or runtime with the iWRAP interface (see Chapter 7).
Access Server can also act as a LAN Access Client, but in this case it must be controlled manually using iWRAP commands, as described in Chapter 7.
Note: Since Bluetooth specification 1.2, LAN Access Profile has been deprecated.
This profile is not automatically started at boot. The default settings can be changed with the setup application (see section Section 2.4).
The Serial Port Profile is used to replace an RS-232 serial cable between two devices with a Bluetooth connection. The physical setup is shown in Figure 3-1.
State A) in the figure is the starting situation with a serial cable connecting the devices. This cable is to be replaced with a Bluetooth connection.
In state B) the long serial connection is replaced with a Bluetooth Serial Port Profile connection between the two Access Server devices. These Access Server devices are then locally connected to the user devices with (short) serial cables. The cable between user device A and Access Server device A must be a cross-over cable. The cable between user device B and Access Server device B must be similar (direct or cross-over) to the one used in state A).
If RTS/CTS handshaking is used to ensure correct data transfer, the serial cables must have these pins connected. Notice that this handshaking is "local": it takes place between the user device and Access Server. No handshaking between user device A and user device B on the other end of the Bluetooth connection is provided.
If RTS/CTS handshaking is not used, CTS must be connected to DTR.
DCD, DTR, and DSR signals are not supported. This also means that user devices A and B will not be able to tell whether or not the Bluetooth connection is up.
When the physical setup is ready, you can create the Bluetooth connection. By default, the Serial Port Profile is started up at boot with the default settings. That is, listening in DevB mode, at 115200 bps, 8 data bits, no parity, 1 stop bit, and RTS/CTS enabled. To change these settings, use the setup application or the WWW Setup interface, as described in Section 2.4.
Note: To enable Serial Port Profile, navigate to Setup → Applications → Default startup applications in the WWW Setup interface, and switch serialport application to off.
Enabling can also be done from command prompt with command chkconfig serialport on.
Access Server has two OBEX profiles, Object Push Profile (ObjP) and File Transfer Profile (FTP). You can use these profiles to transfer files between different Access Servers and other devices supporting ObjP or FTP.
Incoming ObjP and FTP connections are handled by forwarding the call to obexserver program, which handles both profiles. By default the working directory is /tmp/obex. FTP users have full read and write access to that directory. When Access Server starts up, the default contact card is copied from /etc/default.vcf to that directory.
In ObjP mode, obexserver will prefix received files with sender's Bluetooth address and iWRAP port number. In case of a duplicate filename, a counter is also appended to filename.
The --fork parameter in obexserver understands following meta characters:
Table 3-2. obexserver's metas
| Meta | Description |
|---|---|
| $$ | Character '$' |
| $r | Configured root directory |
| $p | Configured prefix |
| $b | Remote's Bluetooth address |
| $t | Temporary file name, with directory |
| $T | Real file name, without prefix and directory |
| $f | Real file name, with prefix and directory |
| $F | Real file name, with prefix, but without directory |
| $d | Current UNIX timestamp |
If the --fork'ed program returns non-zero errorlevel, the received file will be deleted.
Three simple utilities, obexput, obexget and obexsender-put are provided. They can be used to send and retrieve files to and from another Bluetooth device using ObjP or FTP.
Usage:
obexput [parameters] bdaddr channel file(s) |
obexget [parameters] bdaddr channel file(s) |
obexsender-put parameters |
Enter any of these commands without parameters to get a short help for using the command.
Note: You can use friendly name instead of Bluetooth address as the "bdaddr" parameter and keyword "OBJP" or "FTP" as the "channel" parameter for automatic device and service discovery.
For obexput and obexget, a non-zero return value indicates an error. The reason for this error is printed to standard output.
Tip: You can use obexput easily from iWRAP (see Chapter 7) with following syntax:
CALL bdaddr OBJP FORK \"/usr/bin/obexput - 1 filename\"Value - as bdaddr and 1 as channel tells obexput that it is launched by the iWRAP server, and that data connection is bound to standard input and output.
Originally obexsender-put was a helper application for ObexSender. It can also be used by other programs. It calls the given Bluetooth device, calculates a device hash value and then sends one or more files to it using ObjP. obexsender-put takes following parameters:
Table 3-3. Parameters for obexsender-put
| Parameter | Description |
|---|---|
| --configfile name | Use "name" as config file. |
| --bdaddr bd | Call to "bd" and send files specified in config file. |
| --iwraphostname host | Use iWRAP in host. Defaults to "localhost". |
| --iwrapport port | Use iWRAP in port. Defaults to "10101". |
| --iwrappassword pass | Use iWRAP password. Defaults to empty. |
| --verbose level | Specify debug verbosity level. Defaults to "0". Logging is written to standard output. |
| --hash bd | Calculate and show hash value by calling to "bd", don't send anything. |
| --uuid uuids | Use specified UUIDs. Defaults to "OBEXOBJECTPUSH,OBEXFILETRANSFER". |
Config file specifies filenames and hash values for them. First there has to be one or more "regex" lines, followed by one or more "file" or "exec" lines, followed by an empty line. There can be multiple instances of these tuples. Syntax is:
regex <match1> regex <match2> file <fakename1> </path/to/file1> file <fakename2> </path/to/file2> exec </path/to/command1> exec </path/to/command2> regex <match3> file <fakename3> </path/to/file3> ... |
Parameter "match" is a regex of hash. If it matches calculated hash, the file(s) in this tuple will be sent. See lottery example in SDK for more information about exec.
Example of config file:
regex Nokia.9500 file hello.jpg /mnt/usb/communicator.jpg regex . file hello.jpg /mnt/usb/unknown.jpg |
The return value is:
Table 3-4. Errorlevels from obexsender-put
| Value | Description |
|---|---|
| 0 | OK, files sent without errors. |
| 1 | Error in parameters. |
| 2 | Fatal error. Reboot! |
| 3 | No files sent. Operation should be retried. |
| 4 | No files sent. Remote refused to received, do not retry. |
| 5 | OK, no files matched the hash, nothing sent. |
| 6 | Error, file not found from disk. |
| 7 | Error, remote device does not support specified UUID(s). |
There is also another ObexSender helper application called obexsender-inquiry. It can be used to inquiry for nearby Bluetooth devices. It's usage and return values are similar to obexsender-put command. All results are written to standard output.
Usage:
obexsender-inquiry parameters |
Table 3-5. Parameters for obexsender-inquiry
| Parameter | Description |
|---|---|
| --pair-only | List all paired devices and exit. |
| --inquiry | Inquiry and exit. |
| --ready-check | Check if iWRAP is ready or not. |
| --iwraphostname host | Use iWRAP in host. Defaults to "localhost". |
| --iwrapport port | Use iWRAP in port. Defaults to "10101". |
| --iwrappassword pass | Use iWRAP password. Defaults to empty. |
| --verbose level | Specify debug verbosity level. Defaults to "0". Logging is written to standard output. |
Access Server has support for all PAN profile modes: Personal Area Network User (PANU), Network Access Point (NAP) and Generic Networking (GN). Accepting incoming PAN connections to any of these modes is disabled by default for security reasons.
Access Server can be configured to accept incoming PAN connections and the default settings can be changed by using the setup application (see section Section 2.4).
The Network Access Point mode is the most useful PAN profile mode. You can enable it by sending the enable-pan.wpk file (available on-line at https://www.bluegiga.com/as/current/enable-pan.wpk) to Access Server by using the Bluetooth Object Push profile. Alternatively, you can copy the file to the root of a USB memory dongle and insert the dongle to Access Server's USB port.
The device creating the PAN connection decides upon the modes to be used. Access Server automatically handles incoming connections. Access Server can also act as a PAN client, but in this case it must be controlled manually by using the iWRAP interface, described in Chapter 7.
The transmit power of Access Server is configurable. By default, class 1 (100 meter range) settings are used. The settings can be changed down to "class 2" (10 meter range) settings with the btclass 2 command, or even lower with the btclass 3 command. Class 1 settings can be restored with the btclass 1 command. You can find these command also in Setup → Advanced settings → Bluetooth commands menu in the WWW Setup interface.
After btclass # is given, it is recommended to reboot Access Server once to restart ObexSender and other applications connected to the iWRAP server(s).
Note: It is recommended to stop all applications using Bluetooth before issuing btclass command.
You can send iWRAP commands from the command line by using the btcli application. See Section 7.4 for more information.
It is also possible to control the first iWRAP server (at port 10101) through RS-232 with the serialbluetooth application.
Usage:
serialbluetooth [options] |
To see the command options, enter the serialbluetooth --help command.
Basically, serialbluetooth takes commands from a serial port and forwards them to the iWRAP server. All the commands available through iWRAP are also available through serial port.
There are two exceptions:
After making an outgoing RFCOMM data call, all input from the serial port is forwarded to the data socket, not to the control socket. To close the data socket, you have to write +++ with a 200ms pause before each character. It is not possible to have two concurrent RFCOMM calls.
All incoming RFCOMM calls are answered automatically. Again, to close the data socket, write +++ as with the outgoing call.
Access Server functionality can be extended by using GSM/GPRS, Wi-Fi and GPS Compact Flash cards. The supported Compact Flash cards are listed in Appendix D.
The operating system automatically identifies the Compact Flash GPRS card when it is inserted. Access Server can use the GPRS card to connect to the GPRS network, or to act as an SMS gateway to send and receive SMS messages.
You can enable the GPRS mode and configure its settings, such as the SIM card's PIN code, by using the setup application or its WWW interface. For more information, see Section 2.4 and documentation for Setup → Network settings → Enable GPRS interface in Appendix B.
GPRS, when enabled, is by default only turned on when needed. If Access Server can access the Internet (or any desired address) by using the default interface nap, it does not activate and use the GPRS (ppp0) interface.
The simplest way to test the GPRS interface is to configure the default interface nap to use dynamic network configuration (the default) and enable GPRS through the setup application, then to disconnect the Ethernet cable, reboot the device with the management console enabled. After the boot, ping an IP address in the Internet, such as 194.100.31.45 (bluegiga.com).
The first five or so packets are lost, but after that the GPRS connection should be up. To enable the interface automatically, just enter ping -c 20 ip-in-internet to /etc/rc.d/rc.local.
Note: If you also want to use the Ethernet connection, you must remove it from the default interface (nap) bridge and configure its network settings individually using the setup application while keeping the default interface network settings in their default (dynamic) state.
Using WRAP SMS Gateway Server is documented in Section 3.5.3.
If needed for some special use, the Compact Flash GPRS card can also be accessed directly from /dev/ttyS0, a device file which exists if the GPRS card is successfully initialized.
The operating system automatically identifies the Compact Flash GPS card when it is inserted. At that time, the device file /dev/ttyS0 is created and the GPS card can be accessed by using that device with the serial port settings the GPS card uses.
The supported Compact Flash cards are listed in Appendix D.
Access Server supports Prism II/III based CF Wi-Fi cards. The supported Compact Flash cards are listed in Appendix D.
By default, Access Server notices when a supported Wi-Fi card is inserted and tries to use it in the client mode, without encryption. So, if there is an open Wi-Fi Access Point in range, Access Server will automatically connect to it.
To configure Wi-Fi to the Access Point mode, or to change other Wi-Fi settings, use the setup application or its WWW interface at Setup → Network settings → Wi-Fi.
Note: Older Compact Flash cards with firmware version 1.4.2 do not work in the Access Point mode. Instead, you will see an error message in the system log (/var/log/messages, viewable at Setup → Advanced → System Information → Show system log file).
A standard set of command line wireless utilities is provided to fine-tune your Wi-Fi configuration:
iwconfig
iwlist
iwpriv
For more information on these utilities, see: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
Access Server's persistent memory storage can be extended by using an USB memory dongle or a Compact Flash memory card. These are also used by the Access Server Remote Management System (see Section 3.5.5) - each time a dongle or memory card is inserted, it is automatically mounted, and scanned for management packets, which are processed and unmounted.
To use the USB dongle or Compact Flash memory card for your own applications, the memory must be mounted manually by using command:
[root@wrap /]$ mount -t vfat device /mnt/usb
|
The device parameter is a path to the USB dongle or Compact Flash memory card filesystem device. For the first dongle inserted after a reboot, it is /dev/sda1 if the dongle is partitioned (which often is the case), or /dev/sda if the dongle has no partition table. The first Compact Flash memory card is typically at /dev/hda1, correspondingly. If you have used several dongles after reboot, new device file names are created: /dev/sdb1 for the second one, /dev/sdc1 for the third one, and so on. In the case of memory cards, naming is similar, that is, the second one gets device file name /dev/hdb1.
Note: Always remember to unmount the memory dongle or memory card with command:
[root@wrap /]$ umount /mnt/usb
The filesystem in USB dongle can get corrupted if you have a power failure while you are writing data to it. Utility called fsck.vfat is included to fix the problem. There's no harm running it on a clean filesystem. If you are using init scripts (/etc/rc.d/rc.local) to automatically mount the USB dongle on boot time, it is recommended to run fsck.vfat before mounting.
[root@wrap /]$ fsck.vfat -a device
[root@wrap /]$ mount -t vfat device /mnt/usb
|
Access Server server applications are started automatically at system power-up or when an iWRAP server or the Internet services daemon needs them. The servers and their purposes are described in Table 3-7.
Table 3-7. Access Server Servers
| Server | Description |
|---|---|
| bluetooth | Access Server iWRAP Server, which is described in detail in Chapter 7. |
| connector | Access Server Connector, service which automatically opens and maintains connections to specified Bluetooth devices. Configurable using the setup application and its WWW interface. |
| finder | WRAP Finder Service. |
| obexsender | WRAP ObexSender server. |
| smsgw | WRAP SMS gateway server, which is described in detail in Section 3.5.3. Notice that this server is disabled by default. Use the setup application or the chkconfig smsgw on command to enable it. |
| watchdog | WRAP user level watchdog. |
| wpkgd | WRAP remote management system daemon. |
| crond | A daemon to execute scheduled commands. This server is configurable through the /var/spool/cron/crontabs/root file or the crontab command in the same way as any Linux crond. |
| ftpd | Internet File Transfer Protocol Server. You can configure this server with the setup application. Notice that this server is disabled by default. Use the WWW interface of the setup application or the chkconfig ftpd on command to enable it. |
| udhcpd | This server is a DHCP daemon for providing automatic network configuration for clients in the network. Notice that, by default, this server is only enabled for the gn interface, used by Bluetooth PAN Generic Networking profile. |
| udhcpcd | DHCP client daemon for automatic network configuration. |
| inetd | Internet services daemon. Notice that this server is disabled by default. Use the setup application or the chkconfig inetd on command to enable it. |
| httpd | Web server, which is described in detail in Section 3.5.7. |
| pppd | Point to Point Protocol daemon. iWRAP server uses this server. This server can be used manually over the user serial port (/dev/ttyAT1). |
| snmpd | SNMP daemon. This server is available as a separate installation packet. |
| sshd | SSH daemon. |
| syslogd | System logging daemon. This server can be configured by using the setup application. |
| telnetd | Telnet protocol server. Notice that this server is disabled by default. Use the setup application or the chkconfig telnetd on command to enable it. |
| zcip | Zero configuration networking service. |
| ntpd | Network Time Protocol (NTP) daemon. |
The Finder service is a small service, which listens for UDP broadcast queries from Access Server Finder applications and responses to those queries with identification information (IP address, model, serial number, etc.) about Access Server.
The finder command can be used to query Finder service information from Access Servers in the network. With no parameters, finder sends the query using the broadcast address of the default interface (nap). Broadcasting to networks of other interfaces can be done with --interface parameter, such as the zero configuration interface nap:9in the following example:
[root@wrap root]$ finder --interface nap:9
Access Server 2291 (S/N: 0402110112) (build: 3.1)
- Hostname: wrap.localdomain
- IP: 169.254.30.233 (nap:9), 192.168.161.1 (gn)
- Ethernet MAC: 00:07:80:00:03:ed
- iWRAP: 10101 00:07:80:80:0b:c3 bt1.2 (W0402110112_1)
Access Server 2291 (S/N: 0606221029) (build: 3.1)
- Hostname: wrap.localdomain
- IP: 169.254.36.138 (nap:9), 192.168.161.1 (gn)
- Ethernet MAC: 00:07:80:00:0d:44
- iWRAP: 10101 00:07:80:80:0b:c4 bt1.2 (W0606221029_1)
[root@wrap root]$
|
With parameter --send finder will send info once to a specified host, for example to inform that device has booted.
For information about the finder protocol, see Chapter 9.
The ObexSender application is automatically started in Access Server. Its purpose is to receive business cards (vCards), images, or other files, and analyze their content and send files back selecting them based on configured keywords found.
ObexSender can also make an inquiry for bluetooth devices, and automatically send one or more files to all new devices found.
ObexSender can be configured with the setup application or by editing the /etc/obexsender.conf file (see Section 2.4).
For detailed instructions on using ObexSender, see Chapter 5.
WRAP SMS Gateway Server supports Nokia 20, Nokia 30, or Wavecom WMOD2 compatible GSM terminals and the supported GSM/GPRS Compact Flash cards for sending and receiving SMS messages. By default, the Compact Flash card is used. The PIN code query of the SIM card at power-up must be disabled.
WRAP SMS Gateway Server is disabled by default. To enable it, use the setup application's WWW interface, as described in section Section 2.4. Enabling is done at Setup → Applications → Default startup applications → smsgw.
WRAP SMS Gateway Server can be configured to use a modem connected to the user serial port with the setup application or its WWW interface by changing the setting at Setup → Applications → SMS gateway settings → Modem device to /dev/ttyAT1 from the default /dev/ttyS0.
Note: If you are using the user serial port, ensure you have Bluetooth Serial Port Profile disabled, as they share the same physical user serial port.
Note: To use Nokia terminals, the device must be connected to the user serial port when the server starts up. Also, the terminal must be configured to operate in RS-232/AT command. Nokia terminals are configured with the N20 or N30 Configurator application.
For further information on using smsgw, see the makesms example in Section 6.3.1.
WRAP User Level Watchdog daemon listens on UDP port 4266 for "id timeout" messages. "id" is an ASCII string, without spaces. If "timeout" equals to 0 (zero), the "id" is removed from the list of processes to wait. If "timeout" is greater than 0 (zero), the "id" is added or updated.
When there is no message for "id" received within the "timeout" seconds, the user level watchdog dies and the kernel watchdog reboots Access Server.
The watchdog command can be used to send messages to the watchdog daemon. This is done through command watchdog id timeout. For example, watchdog test 5.
Access Server contains simple tools that provide means for full and secure remote management of the device.
The basic remote management can be performed using the WWW Setup interface, SSH command line access, and SCP and SFTP file transfer protocols.
In addition to those, Access Server contains WRAP Remote Management System for transferring management packets over different media to Access Server and automatically sending response packets back.
The management packets (*.wpk) are automatically processed when they are transferred to the autoinstall directory in Access Server (/tmp/obex by default, but configurable with the setup application or WWW interface at Setup → Applications → wpkgd settings). The easiest way to transfer a management packet to this directory is to upload it from WWW Setup at Setup → Advanced settings → Upload a software update.
A management action is performed using the following procedure:
A customer system prepares the management packet (*.wpk).
The management packet is delivered to Access Server, to the packaging daemon's directory. You can currently use Bluetooth, SCP, SFTP and plain FTP to do this. The packet can also be transmitted using a USB memory dongle, Compact Flash memory card or through the WWW Setup interface.
The Access Server packaging daemon processes the management packet, possibly generating a reply packet.
(Optional) The reply packet is delivered to the customer system.
The package name must be of format name.wpk, where "name" can be user defined.
Package must be a tar archive that is compressed with gzip (such as files named *.tar.gz or *.tgz).
The package must contain a package information file called wpkg.pif in the package root (the file contents are described later), otherwise the built-in defaults for wpkg.pif are used.
All other files, if any exist, should be data files, scripts or executables required for the management operation.
The management packet information file (wpkg.pif) consists of tags and their data, described here:
%wpkg-version: 2
Contains information for version checking. 2 is currently the only supported version. It is also the default value.
%wpkg-prepare: [command line[s]]
One or more commands (all commands are lines until the next tag is interpreted as a command line) to execute. Commands may contain parameters, redirections and job control as well.
The built-in default value for this is /usr/bin/dpkg -i *.deb || echo ERROR: Installation failed.. This enables the special case of creating .wpk packets from .deb packets simply with tar czf foo.wpk foo.deb. (wpkg.pif is not needed in this special case).
%wpkg-reply: method
This value indicates where the generated reply packet is sent. By default, it is sent to where it came from. Possible values are:
default
file:///path/filename
scp://remote:file
objp://bdaddr/
none
%wpkg-format: type
This value indicates what kind of a reply packet will be generated. Possible values are:
ascii (this is the default value, everything echoed by the prepare-section will be sent).
tgz (all files in the current directory will be sent).
vcf (same as ascii, but assume it is a vCard).
vmg (same as ascii, but assume it is a vMessage).
vnt (same as ascii, but assume it is a vNote).
vcs (same as ascii, but assume it is a vCalendar).
html (same as ascii, but assume it is HTML).
%wpkg-auth: auth
Optional authentication string required by wpkgd.
See below for the simplest example of wpkg.pif:
%wpkg-version: 2
%wpkg-prepare:
echo Hello world
|
This will generate a reply packet containing text "Hello world". You can generate the wpk file simply by giving the command tar czf hello.wpk wpkg.pif.
See below for a more complex example of wpkg.pif:
%wpkg-version: 2
%wpkg-prepare:
FOO=`pwd`
cd /
tar xzf ${FOO}/files.tar.gz
echo Done.
|
This example will extract files from the included files.tar.gz file. You can generate the wpk file with command tar czf update.wpk wpkg.pif files.tar.gz.
In this example, we build a simple packet that can be used with a Bluetooth enabled phone to retrieve the IP address of an Access Server. File wpkg.pif reads:
%wpkg-version: 2
%wpkg-format: vcf
%wpkg-prepare:
ipaddr() {
echo `ifconfig nap | grep "inet addr" | awk -F [:] \
\\{print\\$2\\} | awk \\{print\\$1\\}`
}
serialno() {
echo `wrapid | grep Hardware | awk \\{print\\$5\\}`
}
echo -e "BEGIN:VCARD\r"
echo -e "VERSION:2.1\r"
echo -e "N:`serialno`\r"
echo -e "TEL:`ipaddr`\r"
echo -e "URL:`hostname`\r"
echo -e "END:VCARD\r"
|
This example will send the reply back as a vCard (contact card). Please note that you have to include all required vCard formatting by yourself. You can generate the wpk file simply giving the command tar czf ipquery.wpk wpkg.pif.
To use this example, send the file ipquery.wpk to the inbox of your Bluetooth phone. Check that you have Bluetooth enabled in the phone. Then, from the phone's inbox, send the file ipquery.wpk over Bluetooth to Access Server.
See below for beep example of wpkg.pif:
%wpkg-version: 2
%wpkg-reply: none
%wpkg-prepare:
echo A > /dev/led
sleep 1
echo a > /dev/led
|
When an USB memory dongle or Compact Flash memory card is inserted, Access Server automatically tries to mount it using VFAT filesystem. If the mount is successful, Access Server scans the root directory for *.wpk files. If one is found, the WRAP Remote Management System daemon processes it. Optional reply packets are saved back to the root directory (unless otherwise stated in the %wpkg-reply tag).
To list installed software components use command wpkgd -l. To uninstall an installed component use wpkgd -e [component]. See wpkgd command without parameters for more information.
If you enable the FTP server, users can use it to log in anonymously to the /tmp/obex directory with download access or as root with password buffy to the root directory with full access. The password and other settings can be changed on Access Server with the setup application or by editing the /etc/ftpd.conf file (see Section 2.4).
Note: Do not enable FTP because it is insecure. Use SSH (SCP or SFTP) instead. A commonly used client with a graphical user interface is, for example, WinSCP (http://winscp.net/).
The integrated web server in Access Server supports HTTP/1.0 methods GET and POST, and has light user authentication capabilities. The content can be either static or dynamic - the WWW server is CGI/1.1 compatible.
The web server is always running and the content (http://wrap-ip-address/) is located in the /var/www/html/ directory in Access Server's file system.
The web server is configured to protect the WWW Setup interface with a username and password. The default username and password can be changed as instructed in Section 2.4. For further information about using the web server for your own applications, see the web examples in Section 6.3.1.
A separate software update package is available from Bluegiga Techforum (https://www.bluegiga.com/techforum/). This update adds the Net-SNMP suite of applications to Access Server. The current Net-SNMP implementation for Access Server is limited and will be extended in the future. However, it can be used to poll the basic status of Access Server.
Configuration details can be found and altered in configuration file /etc/snmp/snmpd.conf, which is accessible as described in Section 2.4.
For more information about the Net-SNMP suite, see http://net-snmp.sourceforge.net/
A separate software update package is available from Bluegiga Techforum (https://www.bluegiga.com/techforum/). This update adds the OpenVPN™, a full-featured SSL VPN solution, to Access Server.
For detailed instructions on using OpenVPN with Access Server, see Section 10.4.
For more information about the OpenVPN™, see http://openvpn.net/.
By default, users can use SSH to log in (or SCP and SFTP to transfer files) as user root with password buffy. The password can be changed on Access Server by using command passwd or with the setup application.
If you enable telnet, users can log in over telnet as user root with password buffy. The password can be changed on Access Server using the command passwd or with the setup application.
Note: Do not enable telnet because it is insecure. Use SSH instead.
The ntpd service uses the standard Network Time Protocol (NTP) to keep Access Server system time automatically in sync using a random selection of eight public stratum 2 (NTP secondary) time servers. The service is also configured to answer NTP requests from other devices.
The NTP server configuration can be altered by editing its configuration file /etc/ntpd.conf.
Access Server is basically a small Linux system. Whether logged in from the management console or with SSH, your shell session starts as the root user in the root directory. After that, you have the option to use most of the standard Linux utilities, briefly listed and described in Table 3-8. Most of the commands have a small built-in usage help that can be seen by executing the command with the -h or --help parameter.
Table 3-8. Access Server Utilities
| Application | Description |
|---|---|
| adduser | This command add user to the system. |
| arping | This command pings hosts by ARP requests/replies. |
| awk | Pattern scanning and processing language. |
| btclass | WRAP baseband module control script (sets basebands power class). |
| basename | Strip directory and suffix from file names. |
| bash | Bourne-Again SHell. |
| btcli | WRAP iWRAP Server Command Line Interface utility. |
| btproxy | WRAP iWRAP Proxy for Access Servers (test revision). |
| bunzip2 | Decompress bzip2-compressed files. |
| bzcat | Decompress bzip2-compressed files to stdout. |
| cardctl | Monitor and control the state of PCMCIA sockets. |
| cat | Concatenate files and print on the standard output. |
| chat | Automated conversational script with a modem. |
| chgrp | Change group ownership. |
| chkconfig | Updates and queries runlevel information for system services. |
| chmod | Change file access permissions. |
| chown | Change file owner and group. |
| chroot | Run command or interactive shell with special root directory. |
| clear | Clear the terminal screen. |
| cmp | Compare two files. |
| cp | Copy files and directories. |
| cpio | Copy files to and from archives. |
| crontab | Maintain crontab files for individual users. |
| cut | Remove sections from each line of files. |
| date | Print or set the system date and time. Notice that the date command does not store the date into the battery powered real time clock. Use the hwclock application instead. |
| dd | Convert and copy a file. |
| deluser | Delete a user from the system. |
| df | Report file system disk space usage. |
| dfu | WRAP baseband module firmware upgrade tool. |
| dialup | WRAP iWRAP helper application. |
| dirname | Strip non-directory suffix from file name. |
| dmesg | Prints or controls the kernel ring buffer. |
| dpkg | A medium-level package manager for (.deb) packages. |
| dpkg-deb | Debian package archive (.deb) manipulation tool. |
| du | Estimate file space usage. |
| dump_cis | Retrieves and parses the Card Information Structures for inserted PCMCIA devices, or optionally, parses CIS information from a file. |
| dun | WRAP iWRAP helper application. |
| egrep | Print lines matching a pattern. |
| encode_keychange | Produce the KeyChange string for SNMPv3. |
| env | Run a command in a modified environment. |
| expr | Evaluate expressions. |
| false | Do nothing, unsuccessfully. |
| fgrep | Print lines matching pattern. |
| find | Search for files in a directory hierarchy. |
| free | Display the amount of free and used memory in the system. |
| ftp | Internet file transfer program. |
| gdbserver | Remote server for GDB debugger. Available in a separate software package. |
| getty | Opens a tty, prompts for a login name, then invokes /bin/login. |
| grep | Print lines matching a pattern. |
| gunzip | Expand gzip compressed files. |
| gzip | Compress files into gzip format. |
| head | Output the first part of files. |
| hexdump | A filter which displays the specified files, or the standard input, if no files are specified, in a user specified format. |
| hostid | Print out a unique 32-bit identifier for the machine (not yet implemented). |
| hostname | Show or set the system's host name. |
| hwclock | Query and set the hardware clock. |
| id | Print information for username or current user. |
| ide_info | IDE device information. |
| ifconfig | Configure a network interface. |
| ifport | Select the transceiver type for a network interface. |
| ifuser | Checks to see if any of the listed hosts or network addresses are routed through the specified interface. |
| insmod | Loads the specified kernel modules into the kernel. |
| ip | TCP/IP interface configuration and routing utility. |
| iptables, ip6tables | IP packet filter administration. |
| kill | Terminate a program. |
| killall | Kill processes by name. |
| ln | Make links between files. |
| logger | Make entries into the system log. |
| login | Sign on. |
| ls | List directory contents. |
| lsmod | List loaded modules. |
| md5sum | Compute and check MD5 message digest. |
| mkdir | Make directories. |
| mknod | Make block or character special files. |
| mktemp | Make a temporary file name (unique). |
| modprobe | High level handling of loadable modules. |
| more | File perusal filter for crt viewing. |
| mount | Mount a file system. |
| mv | Move (rename) files. |
| net-snmp-config | Net-SNMP tool. |
| nslookup | Queries the nameserver for IP address of given host. |
| ntpd | Network Time Protocol NTP daemon. |
| obexbrowser | The WRAP obexbrowser. A command line OBEX client interface. |
| obexget | The WRAP OBEX tool for retrieving a file from a remote device with ObjP/FTP support. |
| obexput | The WRAP OBEX tool for sending a file to a remote device with ObjP/FTP support. |
| pack_cis | Convert a text description of a PCMCIA Card Information Structure (CIS) to its packed binary representation. |
| passwd | Update a user's authentication token(s). |
| picocom | Minimal dumb-terminal emulation program. Available in a separate software package. |
| pidof | Find a process ID of a running program. |
| ping, ping6 | Send ICMP ECHO_REQUEST packets to network hosts. |
| ps | Report process status. |
| pwd | Print the name of the current/working directory. |
| rb, rx, rz, sb, sx, sz | Xmodem, Ymodem, Zmodem file receive and send. |
| rdate | Get and possibly set the system date and time from a remote HOST. |
| reboot | Reboot the system. |
| renice | Alter the priority of running processes. |
| reset | Resets the screen. |
| rm | Remove files or directories. |
| rmdir | Remove empty directories. |
| rmmod | Unload loadable modules. |
| route | Show / manipulate the IP routing table. |
| scp | Secure copy (remote file copy program). |
| scsi_info | SCSI device description tool. |
| sed | A Stream EDitor. |
| setup | The WRAP Setup Application. See Section 2.4. |
| sftp | Secure file transfer program. |
| sleep | Delay for a specified amount of time. |
| snmp* | Set of standard SNMP command line applications. |
| sort | Sort lines of text files. |
| ssh, slogin | OpenSSH SSH client (remote login program). |
| ssh-keygen | SSH authentication key generation, management and conversion. |
| strace | Utility to trace system calls and signals. Available in a separate software package. |
| strings | Display printable strings in binary file. |
| stty | Change and print terminal line settings. |
| su | Run a shell with substitute user and group IDs. |
| sulogin | Single-user login. |
| supportinfo | Output collectively all the system status and configuration information. |
| sync | Flush filesystem buffers. |
| tail | Output the last part of files. |
| tar | Tar archiving utility. |
| tcpdump | Utility for dumping traffic on a network. Available in a separate software package. |
| telnet | User interface to the TELNET protocol. |
| test | Check file types and compare values. |
| time | Run command and display its resource usage information when finished. |
| top | Provides a view to processor activity in real time. |
| touch | Change file timestamps. |
| tr | Translate or delete characters. |
| traceroute | Trace the route that IP packets take on their way to the host. |
| true | Do nothing, successfully. |
| tty | Print the file name of the terminal connected to standard input. |
| uartmode | WRAP Uartmode: Change the mode of the user serial port (DTE or DCE). |
| umount | Unmount file systems. |
| uname | Print system information. |
| uniq | Remove duplicate lines from sorted lines. |
| unzip | List, test, and extract compressed files in a ZIP archive. |
| uptime | Tell how long the system has been running. |
| usleep | Sleep some number of microseconds. |
| uudecode | Decode a file create by uuencode. |
| uuencode | Encode a binary file. |
| wc | Print the number of bytes, words, and lines in files. |
| vi | A text editor. |
| wget | A utility to retrieve files from the World Wide Web. |
| wrapfinder | Finds other Access Servers in the network. |
| wrapid | Access Server identification program. Shows build and hardware configuration information. |
| which | Shows the full path of (shell) commands. |
| whoami | Prints the user name associated with the current effective user id. |
| zcat | Expand gzip compressed files to the standard output. |
| zcip | Zero Configuration Networking application. |
| xargs | Build and execute command lines from the standard input. |
The system clock is read from the battery operated real time clock during boot. The time between the system time and the real time clock is automatically synchronized when the system is rebooted using the reboot command. Synchronizing can also be done using the hwclock --systohc --utc command. Give command hwclock --help for more information about the hwclock utility.
The default time zone in Access Server is UTC. You can change it by installing correct tzdata*wpk management packet, available from Bluegiga Techforum or Access Server Software Development Kit CD-ROM.
Access Server can be re-installed with the latest software version. The latest software updates and instructions are available at https://www.bluegiga.com/techforum/.
Most of the software updates are delivered as a wpk file.
The easiest way to install the latest software version is:
Start Access Server.
Copy the wpk file or files to an empty USB memory dongle.
Insert the dongle in Access Server
One or several LEDs will turn on, and after 10-60 seconds they will all turn off.
Remove the dongle and reboot Access Server.
You have now successfully upgraded Access Server.
See Section 3.5.5 for detailed descriptions of other options and how to create your own wpk files.
| <<< Previous | Home | Next >>> |
| Getting Started with Access Server | SPP-over-IP |