tim-balloon / TIMflight

Flight MCP repo
0 stars 0 forks source link

Rename mcp Iridium Pilot hostnames to have more meaning #31

Open evanmayer opened 1 year ago

evanmayer commented 1 year ago

Task

We need to improve how IP address resolution is done for sending data to Iridium Pilot in order to make the code more maintainable and readable.

Acceptance

mcp/communications/pilot.c:71 calls initBITsender(), defined in ./common/bitserver.c. bitserver.c:340 calls gethostbyname() on strings from the array pilot_target_names, defined in blast_config/command_list.c:53. This function relies on the /etc/hosts file mapping these hostnames to IP addresses. If the /etc/hosts file is wrong, or there are no hosts on the network at those addresses (e.g. they are disconnected), mcp segfaults. The names hardcoded into the array are Lord of the Rings characters and highbay. Cool, but these names should be changed to more closely represent the intended receivers of the data.

  1. Make a copy of an old flight computer's /etc/hosts file and attach it to this issue for posterity. We will use the IP addresses later to confirm for CSBF which IPs we will reserve for TIM usage, so the routing table from the balloon network to the outside world can be set up appropriately.
  2. Interview Ian or a former BLAST team member to find out what the options really should be in practical terms. Ice high bay? Palestine remote operations center? What about the other two?
  3. Change pilot_target_names to reflect the actual recipients.
  4. Change /etc/hosts to match in your development environment and confirm that hostname resolution still works. Build and run mcp and attach relevant lines of logging output that show hostname resolution succeeding.
evanmayer commented 1 year ago

Blast-TNG ARK-2150L Flight Computer 2

/etc/hosts:

127.0.0.1   localhost
127.0.1.1   fc3.blast   fc3
192.168.1.3 fc1.blast   fc1
192.168.1.4 fc2.blast   fc2
#192.168.1.5    fc3.blast   fc3
#192.168.1.10   uei1
192.168.1.7     xsc0
192.168.1.8     xsc1

192.168.40.51   roach1
192.168.40.52   roach2
192.168.40.53   roach3
192.168.40.54   roach4
192.168.40.55   roach5

192.168.40.71   roach1-udp
192.168.40.72   roach2-udp
192.168.40.73   roach3-udp
192.168.40.74   roach4-udp
192.168.40.75   roach5-udp

192.168.40.4    roach-udp-dest

192.168.40.61   pi1
192.168.40.62   pi2
#192.168.1.62   pi2
192.168.40.63   pi3
192.168.40.64   pi4
192.168.40.65   pi5

192.168.40.101  cc1

# These are the cryo labjacks
192.168.1.110   labjack1
192.168.1.111   labjack2
# These are the outer frame labjacks
192.168.1.112   labjack3
192.168.1.113   labjack4
192.168.1.114   labjack5

# This is the PSS labjack
192.168.1.115   labjack6
192.168.1.116   labjack7
# highbay labjack
192.168.1.117   labjack8
192.168.1.118   labjack9
192.168.1.119   labjack10
192.168.1.120   labjack11

192.168.1.222   gollum
67.239.76.163   smeagol
128.100.52.93   galadriel
192.168.1.223   highbay

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

N.B.: Ian and I are fairly sure we changed the IPs of gollum and highbay for in-lab checkout of the old flight computer when we received it. 192.168.1.XXX addresses are typical addresses reserved for us to use within the gondola network.

evanmayer commented 1 year ago

Per Ian:

gollum = CSBF OCC PC 1 (Palestine) smeagol = CSBF OCC PC 2 (Palestine) galadriel = Toronto pilot receiver highbay = Highbay computer

From these, we derive some requirements for receipt of Iridium Pilot telemetry for our mission:

  1. Two computers stationed at Palestine Operations Command Center for redundancy - e.g. two laptops
  2. One computer at another institution with a public static IP - Iridium Pilot sends data to it (offsite redundancy in case OCC loses power)
  3. One hostname reserved for the common use case of a PC on the ground in the highbay connected to the gondola network for testing and development