Msb-server
From University of Washington - Ubicomp Research Page
Jump to navigationJump to search
msb-server
- msp/src/msb/msb-main.c
- linux download (xscale)
- linux download (x86)
- currently not available for windows
The msb-server is a program which interfaces with the MSB via the serial port and handles logging of uwar files and transmission of the sensor data over IPC and other shared memory mechanisms. msb-server was written by Dirk Hähnel of Intel Research Seattle.
usage
Typical Usage
msb-server -ini msb.ini
where msb.ini will typically contain:
#Desktops should use the USB device #SERIAL_DEVICE /dev/ttyUSB1 #the iMote2 uses ttyS0 only SERIAL_DEVICE /dev/ttyS0 BAUD_RATE 921600 HARDWARE_FLOW_CONTROL 0 SOFTWARE_FLOW_CONTROL 0 USE_RTC 1 SCHEDULE_INTERRUPT_COUNT 5120 SCHEDULE_MIC 8192 SCHEDULE_ACCELEROMETER 5120 SCHEDULE_AMB_LIGHT 2560 SCHEDULE_BAROMETER 71 SCHEDULE_DALS 30 SCHEDULE_HUMIDITY 10 SCHEDULE_POWER 0 MIC_GAIN 64 LOG_FILE test.uwar LOG_START 1
Available Commands
-
In addition the msb-server also supports the following switch commands:
-ipc-publish-data publish the converted data via IPC -ipc-publish-raw publish the raw sensor data via IPC -ipc-publish-stream stream serial data via ipc -shm-publish-stream stream serial data via shared memory -ipc-publish-mic publish microphone packets -sync-rtc -show-rtc -set-rtc -use-rtc -log specify a file to log data to, see -max-size and -max-time for log rotation settings -log-type specify the type of data to log: uwar serial data is stored as packets in a uwar file stream serial data is written directly to a file -max-size maximum size of the uwar file before rotating the log file (in kilobytes) -max-time maximum time between file rotations
example output
-
Typically the msb-server will output something similar to the following. Where the final recieved stats will continue until the program is terminated or an error occurs.
./msb-server -ini ./msb.ini -ipc-publish-data # INFO: ******************************** # INFO: *********** MSB ************ # INFO: ******************************** # INFO: read ini file ./msb.ini # INFO: initialize data structures # INFO: allocate data messages # INFO: IPC for Mobile Sensing Platform Toolkit (Ver. 1.0.0) # INFO: set device: # INFO: port = /dev/ttyUSB1 # INFO: baud = 921600 # INFO: params = 8N1 # INFO: send reset command # INFO: --------------------- # INFO: send cease command ... done # INFO: send rtc query command to MSB # INFO: current msb time = 2065-25-45 45:85:85! # INFO: change system time to RTC! # INFO: set system time failed! # INFO: send calibration query command to MSB # INFO: ---- calibration ---- # INFO: board nr = b # INFO: hardware version nr = 2 # INFO: major soft version = 1 # INFO: minor soft version = 1 # INFO: calibration word 1 = 48224 # INFO: calibration word 2 = 47962 # INFO: calibration word 3 = 28705 # INFO: calibration word 4 = 44956 # INFO: calibration val c1 = 24112 # INFO: calibration val c2 = 2140 # INFO: calibration val c3 = 702 # INFO: calibration val c4 = 448 # INFO: calibration val c5 = 749 # INFO: calibration val c6 = 26 # INFO: send schedule query command to MSB # INFO: --- USER REQUEST --- # INFO: ------ schedule ----- # INFO: interrupt count = 5120 # INFO: mic hz = 8192 # INFO: accelerometer hz = 512.0 # INFO: amb light hz = 256.0 # INFO: barometer hz = 7.1 # INFO: compass hz = 0.0 # INFO: dals hz = 3.0 # INFO: humidity hz = 1.0 # INFO: power = 0 # INFO: microphone gain = 255 # INFO: send schedule query command to MSB # INFO: --- NEW SETTINGS --- # INFO: ------ schedule ----- # INFO: interrupt count = 5120 # INFO: mic hz = 8192 # INFO: accelerometer hz = 512.0 # INFO: amb light hz = 256.0 # INFO: barometer hz = 7.1 # INFO: compass hz = 0.0 # INFO: dals hz = 3.0 # INFO: humidity hz = 1.0 # INFO: power = 0 # INFO: microphone gain = 255 # INFO: ------ schedule ----- # INFO: interrupt count = 5120 # INFO: mic hz = 8192 # INFO: accelerometer hz = 512.0 # INFO: amb light hz = 256.0 # INFO: barometer hz = 7.1 # INFO: compass hz = 0.0 # INFO: dals hz = 3.0 # INFO: humidity hz = 1.0 # INFO: power = 0 # INFO: microphone gain = 255 # INFO: ------- log ------- # INFO: open log-file file test-0002.uwar [test-0002.uwar] # INFO: write header to log file ... => 967903080 done # INFO: log-max-size: 4 Mbytes # INFO: log-max-time: 5.00 minutes # INFO: ------- start ------- # INFO: send init command to MSB # INFO: 2.40 kbits/sec (0 crc of 9 packets) # INFO: 234.95 kbits/sec (0 crc of 169 packets) # INFO: 221.89 kbits/sec (0 crc of 321 packets) # INFO: unknown packet type 0xb4 # INFO: 221.89 kbits/sec (0 crc of 473 packets) ...