General Debugging Tools


man(ual)

A program to print the manual for other programs.

Basic usage is man PROG, where PROG is the program you are interested in. Most programs on UNIX systems have a man page. If a program does not produce a man page, check that it is installed and in a known location with which PROG. man PROG and PROG -h are the two ways to learn more about programs you're using from the command line. Use them liberally with the programs below, in order to develop towards mastery.

ping

A tool to test the connection to an address over the internet. By default, every second it sends a message to and waits for a reply from the provided address.

Basic usage is ping ADDR, where ADDR is the address you are trying to talk to. For logging purposes, you can give it arguments to display the time the message was sent; for example, on OS X the argument is --apple-time.

dmesg

A tool to print system errors.

Useful to confirm if services are having errors, such as configuration errors. Note, this displays system-wide error messages.

ifconfig

A tool to examine all of a computer's network interface connections.

Useful to confirm that interfaces are up and have the settings you'd expect after doing the default setup.

iwconfig

A tool to examine a computer's wi-fi connections. A wi-fi connection has a name (for example, wlan0), and a bunch of variables. Two good indicators of health are transmission power and access point. Transmission power, (Tx-Power), is literally a measure of wi-fi card power output, but it indicates that wi-fi is actually on and attempting to work. A defined access point (Access Point), literally means that the computer has a location for the router, but it indicates that it has successfully authenticated with that router.

nmap

A tool to examine IP addresses that are available to connect to. Note, only use this tool in the lab network. nmap can be used maliciously and using it elsewhere will make you look suspicious.

Usage: nmap ADDR[/N]

Where ADDR is the lowest address in the range you're interested in, and N is an optional number of bits to NOT vary, starting from the front (by default N=32, i.e. try exactly one address). Examples:

  • nmap 0.0.0.0/0 scans 2^32 addresses.
  • nmap 192.168.5.1 and nmap 192.168.5.1/32 both scan the same single address
  • nmap 192.168.5.0/24 and nmap 192.168.5.0/16 are your most plausible use cases for lab debugging, varying just the last two sections. See the network page for guidance on what IPs to expect various machines to be at.

Specific Issues and Steps to Fix


Can't connect to front seat

'Usual debugging'

Usually, just doing these steps is enough. The steps are the goal.

  1. Confirm that you are on the lab network (wifi is kayak-local-5ghz or kayak-local-2ghz)
  2. Confirm that the robot is on
  3. Confirm that the robot has sufficient power
  4. Confirm that the vehicle's antennae are plugged in
  5. Confirm that lab antenna is plugged in (by light switches)
  6. Are you trying the right IP? It should be 192.168.ABC.1, where ABC is the robot number, numbered alphabetically (so A vehicle is 1, B vehicle is 2, ...).

'Unusual debugging'

Something unusual is wrong; your goal is to get onto the vehicle by any tortured route that you can to identify and fix the problem. The files you're looking for are /etc/networks/interface and /etc/dhcp/dhcpd.conf, and they should be comapred to the default configuration.

  1. Try both the vehicle's IP (192.168.ABC.1) and gateway (192.168.1.17X).
  2. Plug an ethernet cable from your computer directly into the M300 computer and retry those addresses
  3. If that fails, turn off wifi and try nmap to determine an address, and use that.
  4. If that fails, use wire shark on your computer to watch the ethernet. Restart the M300 and watch the handshake, and then extract the IP from those messages.
  5. If that fails, plug in a mouse, keyboard, and screen to the M300.
  6. If that fails, email Mike Benjamin.

Can connect to front seat, but not the back seat

''Restarting Raspberry Pis is unusually effective at debugging, even compared to other computers. Don't forget to wait ~45 seconds after connecting a new M300/PABLO pair to connect them.'

  1. Confirm that the Raspberry Pi in the PABLO is on, using the indicator lights.
  2. Log into the front seat; check the /var/lib/dhcpd/dhcpd.leases file to see what actual network IP most recently issued was. Try that with ping and then ssh.
  3. If that fails, bring down the dhcp service (sudo dhcp stop), delete that leases file, and bring the dhcp service back up (sudo dhcp start). Confirm that this works. It may also be necessary to restart the M300, which can be accomplished by sudo reboot.
  4. If that fails, use the nmap tool to try and identify the actual IP of the PABLO.
  5. If that fails, check the /etc/dhcp/dhcpd.conf and /etc/networks/interface on the M300, and compare them against default configuration.
  6. If that fails, try plugging ethernet from your laptop directly into the PABLO. Use nmap to discover its IP and attempt to ssh in that way.
  7. If that fails, reflash the Raspberry Pi. If the contents of the current PABLO are important and so that isn't a good solution, email Mike Benjamin.

Back seat is not on 192.168.ABC.100

This is advice for when you have a positive confirmation that the back seat is at some other IP, say, 192.168.ABC.101. If you only have negative confirmation that the usual IP works, see above.

Check the /etc/dhcp/dhcpd.conf file to see what range of IPs it expects to give out. It may be configured to range from 192.168.ABC.100 to 192.168.ABC.105, for example. Set it to range from 100 to 100, instead.

Launched vehicle script, vehicle not appearing on shoreside

  • Check that the [mission].moos configuration file contains the correct IP of the shoreside computer.

Launched vehicle script, vehicle appearing on shoreside but emitting connectivity errors.

  • Check that the [mission].moos configuration file contains the correct IP of the front seat (M200_IP). Some files have this set by the existing command line arguments (that specify your vehicle,) but many do not.