Skip to content

Deploying Code

Bennett-Petzold edited this page Oct 22, 2022 · 9 revisions

Quick Reference

  • Static IP: 192.168.2.6
  • User: sw8
  • Target IP: 192.168.2.5

1: Setting Laptop Environment

Based on ROS connection method

  • Set a static Ethernet IP of 192.168.2.X
  • Set the netmask
    • Option 1: 255.255.255.0 subnet mask
    • Option 2: [ip address]/24 CIDR
  • Attach to target single board computer via Ethernet
    • We use a network switch for multiple connections
      • Creates a local network

2: Gradle Deploy

  • Prerequisite: Task 1
  • Get a copy of ".sw8_ssh_identity"
    • Put it in the "app" directory
    • Ask the software lead for the file
  • Use the deploy task
    • Go to the project root
    • Open in command processor (cmd/bash/zsh/etc)
    • Linux/MacOS: ./gradlew deploy
    • Windows: ./gradlew.bat deploy

3: Direct SSH Access

  • Prerequisite: Task 1
  • The target address is 192.168.2.5
  • Use SSH utility
    • Linux/MacOS: use ssh directly
      • ssh sw8@192.168.2.5
      • For graphics: ssh -x sw8@192.168.2.5
    • Windows: use terminal emulator
      • e.g. MobaXTerm
      • User: sw8
      • Host: 192.168.2.5
      • Port: 22
  • Ask for password
  • Optional: add "sw8_ssh_identity" to your ssh agent
    • Password not needed if an identity file is provided
    • Ask the software lead for the file

4: Running Code

  • Prerequisite: Task 3
  • Enter the ~/java directory
    • cd ~/java
  • Run app-all.jar
    • java -jar app-all.jar
    • Include flags after the java run
      • java -jar app-all.jar [flags]
      • e.g. java -jar app-all.jar --help

5: tmux

TODO

6: Debugging

  • Can't connect to target device
    • Make sure user is sw8
      • sw8s is wrong
      • Check password
    • Confirm laptop settings
      • Check against [Task 1](# 1: Setting Laptop Environment)
    • Try ping 192.168.2.5
    • Try a network scan
      • sudo rfkill wlan (IMPORTANT)
        • Disconnects from local WiFi
      • sudo nmap -sn 192.168.2.0/24
        • Scan that doesn't test ports
      • sudo nmap 192.168.2.0/24
        • Scan that tests ports
        • Use if ping/fast scan succeeds but connection fails
    • Confirm next step with leadership
      • Likely power cycling the Pi
  • The test phase failed
    • You failed the tests
    • Fix your code or fix the tests
  • Can't run java/deployed app
    • Test if java is on the system
    • Check default java version
      • java --version
      • If not Java 11, replace with Java 11
Clone this wiki locally