NCAR / aircraft_ipm

EOL/RAF code support for the North Atlantic Industries (NAI) Intelligent Power Monitor (Model iPM)
Apache License 2.0
0 stars 0 forks source link

Model iPM - Intelligent Power Monitor control software

EOL/RAF code to control the NAI iPM and send UDP packets to nidas. Main program can be forked by nidas dsm process or run standalone.

Running the code

This code can be run four different ways: from nidas, or from the command line with a menu, specifying an address and command, or free running as would be called from nidas.

From nidas

To run from nidas, use the ipm.xml file in this directory as a template to add the iPM to the project xml files. Download and install this software to the DSM where the iPM is mounted, eg git clone this repo, "scons", and "scons install". Then when dsm_server is started, it will launch this code, initialize the iPM and send commands as configured in the XML.

From the command line

To run from the command line, login to the DSM where the iPM is mounted, and enter one of the following command line patterns:

"ipm_ctrl -m -r -b -n -0 <addr, procqueries, port> -p " will loop over command as specified in procqueries at the rates specified in measurerate and recordperiod

"ipm_ctrl -b -p -i" to run in interactive mode and print a menu.

"ipm_ctrl -b -p -i -a

-c " to send a single command to given address

Building the software

"scons" will build ipm_ctrl

Developmemnt

Running with the emulator

To run with the emulator,

"python3 emulate.py"

and append -e to the above command. The emulator responds more slowly than the iPM. The -e increases the timeout period.

Unit tests

This software uses googletest for unit testing.

"scons tests" will build the tests. "tests/g_test" will run the tests.

Deployment

To deploy the code via a dpkg, run "./build_dpkg"