Menapia - ASS integration¶
This documents how the Menapia Drone dock system is integrated with the AURORA Science System. Menapia have two docks, controlled independently by their edge system the "MEC". The MEC contains a router, computer and power supplies, from which Menapia have their own subnet and can have their own seperate internet ect. All details on this side of the system are managed by Menapia.
The ASS provides the following physical connections to the MEC: - 230 VAC - 12 VDC - RJ45 port connected to the main ASS network switch.
Menapia can manage their own power in the MEC, the ASS is also able to toggle both the AC and DC outputs. The MEC should be prepared to tolerate unexpected AC outages.
The network configuration between the ASS and the Menapia system is now configured. All MEC devices are reachable on the subnet 192.168.168.xx. The address of their main router is xxxx, their main computer is 192.168.168.xx, and their MQTT server is accessible at 192.168.168.231:1883.
It will be possible to allow Menapia to access the external internet through this connection, but this is not set up yet and requires expert help from Michael. Alternatively they could have a seperate direct connection to the AURORA starlink, or use their own internet connection in Iceland - need to decide on the best approach here.
Communication¶
Communication between the ASS and the MEC using MQTT. MQTT broker: 192.168.168.231:1883 Usr: edgepower Pwd: Jago0906 All of MEC devices are on 192.168.168.X
Power management¶
The MEC has the following power modes:
Tier 1 - Unrestricted Tier 2 - MEC controlled, heating limited to 5C, normal flight ops. Tier 3 - Standby, MEC controlled, no flights launched. -10C target. Tier 4 - Forced standby, AC power to MEC controlled / turned off by ASS. MEC uses 12VDC for critical systems and comms. Tier 5 - Fully off. AC and DC controlled/ turned off by ASS. Docks can land flights on UPS battery. No heating. Docks at risk in low temps, and eventually the UPS battery will run out. Requires 45 s warning to shutdown internal PC.
The ASS requests a particular power mode based on balancing power consumption and generation with science requirements (this logic is still to be designed). The ASS continuously sends an MQTT message with the requested power tier for each drone. The message is sent once every 10 s. The MEC should look for this message and respond as soon as possible by updating it's power tier if when ever there are changes. If the MEC does not recieve a communication from the ASS for more than 30 s (indicating a loss of connection), the MEC should default to power tier 4 until the reason for the communication failure can be identified.
The python script that sends the MQTT messages from the ASS to the MEC is menapia_mqtt.py This script should be run by a system service (to set up) so it is always running automatically. menapia_mqtt.sh can be called by a system service to run the python script and output printed text to log file: "/home/aurora/scripts/logs/menapia_mqtt.log"
Updating the requested power tier¶
The python script works by reading the text file "tier.txt" every 10 s before it sends the MQTT message. "tier.txt" is a simple text file containing two integers e.g. '1 2' which describe the power tier corresponding to Dock 1 and Dock 2 repectively. The python script prints the time of any tier change to the log file - but only when it changes (not every 10s), if the text file hasn't changed it continues to send the MQTT message, but does not print any output to the log file if it's successful (unless verbose is requested).
To change the power tier, the tier.txt file can be updated by running the script update_power_tier.sh followed by the requested tier for each dock
e.g. to update the power tier of both docks to 4, run:
bash ./update_power_tier.sh 4 4
This command can then by called by automated power management routines.
update_power_tier.sh creates a "tier.txt.tmp" file before moving it to "tier.txt" which will hopefully avoid conflicts with the menapia_mqtt.py script
reading the tier.txt file whilst it is being written to.