ukyuav / BC5-datalogger

Records data off of MCC DAQ and VectorNav INS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BC6-datalogger

Records data off of MCC DAQ and VectorNav INS

Purpose

Created for use on the BLUECAT VI (BC6) unmanned aerial platform at the University of Kentucky. This is intended for use of the Raspberry Pi 3b+. With some modification to the functionality of the GPIO it could be used on other linux machines. It requires an I2C bus, 3.3V power, and GPIO on the device to support all features.

Prerequisites

Hardware

This may work with similar models, but has not been tested with anything but the above hardware.

Software

The following software is automatically included and built alongside the datalogger.

All other required software is documented in the install.sh file. When launched this file will automatically download all of the necessary software prerequisites for the features of the BC6. See the section below: Initial Setup for installation information.

Scripts

Below is a list of scripts and their functions

  • ./get_data.sh
    • Runs the full datalogging software including logging from the vectornav and uldaq as well as printing to the LCD screen.
  • ./install.sh
    • Script to run upon first installation. Should be ran while connected to the internet so that the script can install the required packages.
  • ./extract_all.sh
    • After running "./get_data.sh", raw binary files will be produced in the output directory. "./extract_all.sh" takes a path and run number and converts those binaries toa csv.

Initial Setup

Software install and build

For simplicity, all of the required software libraries are installed and built automatically by running the script:

./install.sh

This will take some time and should only be done once.

Setting up to launch on bootup

The reboot script can be setup by running 'crontab -e' and entering the following line: @reboot cd home/pi/BC5-datalogger && sudo bash ./get_data.sh > home/pi/cronlog0 2>&1 Ensure the folder that you cd to in this command is the correct name! If you download the source zip rather than clone from github, the folder name will be home/pi/BC5-datalogger-master instead (note the branch suffix).

Setting up USB drive

A USB drive is advisable for high data-rate storage. This is a good place to write the raw data while logging. Additionally, the current launch script "./get_data.sh" looks for the configuration file in a USB drive mounted to "/media/sda1".

In order to accomplish this and be able to launch the script on bootup, we need to be able to auto-mount the USB drive. This can be done by following a guide to editing the "/etc/fstab" file here.

First, get the UUID by running sudo blkid and copying the UUID corresponding to the USB drive. Then, make a permanent spot for the USB to mount by running sudo mkdir /media/sda1. Finally, edit the file at /etc/fstab with sudo nano /etc/fstab (or your favorite text editor) and append a line with this format: UUID=<uuid-of-your-drive> <mount-point> <file-system-type> <mount-option> <dump> <pass>

Your fstab line should look like this, with a different UUID:

UUID=eb67c479-962f-4bcc-b3fe-cefaf908f01e  /media/sda1  vfat  defaults,nofail  0  2

Make sure the USB drive has the rpi3b.yml config file on it. The program will not launch if this file is not found. For these changes to have effect, reboot the Pi with sudo reboot now

Full Launch Process

  1. Connect the BC6 system to power. The Raspberry Pi should then begin booting up.
  2. Wait 20 seconds
  3. If connected properly, the LCD should start displaying log messages from the datalogger. This will tell you the status of the logger.
  4. Potential LCD messages. a. "Press button to begin logging.": The system is fully connected and is ready to begin logging upon button press. b. "No DAQ device is detected": The DAQ device is not plugged in or is unresponsive. c. "Awaiting GPS Fix": The Vectornav is still waiting on GPS signal to be acquired to gain the proper GPS fix. Await the fix or move to a more open area. d. "Output directory will not work for sampling.": There are more than 99 log files in current directory and needs to be cleared or archived. e. "Sampling completed.": The sampling has successfully completed and the program has terminated. Please await this message before shutting down the Pi to avoid corruption. f. Other: There are various possible errors with the DAQ that often means invalid configuration. Consult the DAQ manual for permitted configurations.
  5. Once the LCD reads "Press button to begin logging." then you can press the button on the side of the plane labelled "Pi" and that will launch the datalogger program.
  6. Upon landing the plane, press the same button once more and await the message "Sampling completed." before shutting down.

Important Resources

About

Records data off of MCC DAQ and VectorNav INS


Languages

Language:C++ 67.4%Language:C 25.0%Language:Python 5.1%Language:HTML 1.1%Language:CMake 0.5%Language:Makefile 0.4%Language:Shell 0.3%Language:M4 0.3%Language:Starlark 0.0%Language:CSS 0.0%