Lsb-server: Difference between revisions

From University of Washington - Ubicomp Research Page
Jump to navigationJump to search
No edit summary
 
 
Line 37: Line 37:
</pre>
</pre>
</ul>
</ul>
</ul>
== lsb.ini ==
<ul>
lsb.ini specifies which serial port the LSB is attached to, the serial port settings, the <b>schedule</b>, and other miscellaneous options.
The schedule is set of sampling rates for each sensor, in number of samples per ten seconds. Setting a sensor to 0 samples per ten seconds causes the sensor to turn off. Each sensor has its own maximum sampling rate. The LSB will reject any schedule it cannot meet and return the best schedule it can handle.
The available options you can set in msb.ini are:
{| class="wikitable" style="text-align:center"
!! | Option || Description
|-
| SERIAL_DEVICE || Specifies the serial port the LSB is attached to. This should be /dev/ttyS2 on the MSP.
|-
| BAUD_RATE || The baud rate the LSB communicates at. This should be 921600.
|-
| HARDWARE_FLOW_CONTROL || If set to 1, enables hardware flow control. This should be <b>not</b> be enabled, as there is no hardware support for it.
|-
| SOFTWARE_FLOW_CONTROL || If set to 1, enables software flow control. This should <b>not</b> be set.
|-
| UART1_BAUD_RATE || Sets the baud rate of the pass-through UART on the LSB. Used only when another serial device is attached to the LSB, such as a GPS module.
|-
| UART1_CFGDATA_FILENAME || When set, lsb-server reads this file and sends the contents to the pass-through UART on the LSB. Used only when another serial device is attached to the LSB, such as a GPS module. Commonly this is used to send initialization commands to a GPS module or other serial device.
|-
| SCHEDULE_INTERRUPT_COUNT || The number of timer interrupts per ten seconds on the LSB. This is effectively the upper sampling rate of every sensor. This is usually set to maximum allowed value, 5120.
|-
| SCHEDULE_GYRO || The number of gyroscope samples per ten seconds. This is usually set to 640.
|-
| SCHEDULE_MAGNETOMETER || The number of magnetometer samples per ten seconds. This is usually set to 320.
|-
| SCHEDULE_POWER || The bit field of power-saving options. This is reserved for future use, and should not be set.
|-
| IPC_PUBLISH_STREAM || If set to 1, publishes sensor data over IPC. Despite the name, this is not actually a byte stream, but individual sensor messages. Not normally set.
|-
| SHM_PUBLISH_STREAM || If set to 1, publishes the sensor data stream over shared memory. The format of the data is identical to the LSB protocol. This should be set to 1 if using [[Logger|logger]].
|-
| SHM_PUBLISH_STREAM_SIRF_GPS || If set to 1, publishes the data sent to the pass-through UART over shared memory. This should be set to 1 if using [[Logger|logger]] and have another serial device connected to the LSB.
|-
| PACKET_INTERVAL_IN_MS || Time interval between IPC publications. This should be set to 100 or smaller if using IPC.
|-
| GPS_ENABLE || If set to 1, drives the GPS enable line high (pin 6 of P2).
|-
| USB_ENABLE || If set to 1, enables +5v on the USB port.
|}
</ul>
</ul>

Latest revision as of 22:48, 15 August 2007

lsb-server

The lsb-server is a program which interfaces with the LSB via the serial port and handles transmission of the sensor data over IPC and other shared memory mechanisms. Unlike msb-server, it cannot write UWAR files directly.

usage

    Typical Usage

      lsb-server -ini lsb.ini
      

      where lsb.ini will typically contain:

      SERIAL_DEVICE                   /dev/ttyS2
      BAUD_RATE                       921600
      HARDWARE_FLOW_CONTROL           0
      SCHEDULE_INTERRUPT_COUNT        5120
      SCHEDULE_GYRO                   640
      SCHEDULE_MAGNETOMETER          	320
      IPC_PUBLISH_STREAM              0
      SHM_PUBLISH_STREAM              1
      

    Available Commands

      In addition the lsb-server also supports the following switch commands:
      -sync-rtc   Set the system time with the RTC on the LSB (LSB RTC --> System Time)
      -show-rtc   Retrieve the RTC time from the LSB
      -set-to-rtc Set the LSB RTC with the time specified in the following format: year-month-day hour:min:seconds (e.g. 2007-1-1 2:32:01)
      -use-rtc
      

lsb.ini

    lsb.ini specifies which serial port the LSB is attached to, the serial port settings, the schedule, and other miscellaneous options. The schedule is set of sampling rates for each sensor, in number of samples per ten seconds. Setting a sensor to 0 samples per ten seconds causes the sensor to turn off. Each sensor has its own maximum sampling rate. The LSB will reject any schedule it cannot meet and return the best schedule it can handle. The available options you can set in msb.ini are:
    Option Description
    SERIAL_DEVICE Specifies the serial port the LSB is attached to. This should be /dev/ttyS2 on the MSP.
    BAUD_RATE The baud rate the LSB communicates at. This should be 921600.
    HARDWARE_FLOW_CONTROL If set to 1, enables hardware flow control. This should be not be enabled, as there is no hardware support for it.
    SOFTWARE_FLOW_CONTROL If set to 1, enables software flow control. This should not be set.
    UART1_BAUD_RATE Sets the baud rate of the pass-through UART on the LSB. Used only when another serial device is attached to the LSB, such as a GPS module.
    UART1_CFGDATA_FILENAME When set, lsb-server reads this file and sends the contents to the pass-through UART on the LSB. Used only when another serial device is attached to the LSB, such as a GPS module. Commonly this is used to send initialization commands to a GPS module or other serial device.
    SCHEDULE_INTERRUPT_COUNT The number of timer interrupts per ten seconds on the LSB. This is effectively the upper sampling rate of every sensor. This is usually set to maximum allowed value, 5120.
    SCHEDULE_GYRO The number of gyroscope samples per ten seconds. This is usually set to 640.
    SCHEDULE_MAGNETOMETER The number of magnetometer samples per ten seconds. This is usually set to 320.
    SCHEDULE_POWER The bit field of power-saving options. This is reserved for future use, and should not be set.
    IPC_PUBLISH_STREAM If set to 1, publishes sensor data over IPC. Despite the name, this is not actually a byte stream, but individual sensor messages. Not normally set.
    SHM_PUBLISH_STREAM If set to 1, publishes the sensor data stream over shared memory. The format of the data is identical to the LSB protocol. This should be set to 1 if using logger.
    SHM_PUBLISH_STREAM_SIRF_GPS If set to 1, publishes the data sent to the pass-through UART over shared memory. This should be set to 1 if using logger and have another serial device connected to the LSB.
    PACKET_INTERVAL_IN_MS Time interval between IPC publications. This should be set to 100 or smaller if using IPC.
    GPS_ENABLE If set to 1, drives the GPS enable line high (pin 6 of P2).
    USB_ENABLE If set to 1, enables +5v on the USB port.