# Notes for Amy K. on ubuntu shoreside machine setup with modem # author: Caileigh Fitzgerald # data: 5/27/19 Setting up shoreside ubuntu machine: ==================================== - Connect to the internet via wifi or ethernet (I think ethernet would be ideal) - Bring up a terminal by pressing 'ctrl+alt+T' - run, $ ping 8.8.8.8 # This is googles DNS server - it's always up # If connected to the internet, you should see something like this: # # PING 8.8.8.8 (8.8.8.8): 56 data bytes # 64 bytes from 8.8.8.8: icmp_seq=0 ttl=56 time=12.004 ms # 64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=12.988 ms # 64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=11.721 ms # ^C # --- 8.8.8.8 ping statistics --- # 3 packets transmitted, 3 packets received, 0.0% packet loss # round-trip min/avg/max/stddev = 11.721/12.238/12.988/0.543 ms # # If not connected you'll see something like this: # # PING 8.8.8.8 (8.8.8.8): 56 data bytes # ping: sendto: No route to host # ping: sendto: No route to host # Request timeout for icmp_seq 0 # ping: sendto: No route to host # Request timeout for icmp_seq 1 # ping: sendto: No route to host # Request timeout for icmp_seq 2 # ^C # --- 8.8.8.8 ping statistics --- # 4 packets transmitted, 0 packets received, 100.0% packet loss - To make sure the laptop doesnt turn off when idle for a while, run these commands in the terminal $ gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'nothing' # This just means that when plugged into the wall, the laptop won't sleep when the lid is closed $ sudo reboot now # puts the changes into effect # To "undo" this later, run # $ gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend' - To test this run the script test-sleep.sh $ source /test-sleep.sh # This will just print time stamps forever # once you run this, close the lid of the laptop, wait a moment for the machine to sleep and then open it. If the timestamps have continued un-interrupted the setting change worked, otherwise the setting change didn't work Python code to send acoustic payload as email attachment ======================================================== Flow chart for mail going to the buoy from shoreside # # made with http://stable.ascii-flow.appspot.com/ # # +-----------------+ # | | # | email_acomms.py | # | | # +-----------------+ # | | +----------+ # | | | + # | | | no new mail that # | | | matches filters # creates instance of +-------------------+ v | # | | | | +---+-----------+-----------------------------+ # | +------------>+ email_sniffer.py +------>+ checking for incoming emails from shoreside | # | | | +---------------+-----------------------------+ # | +-------------------+ | # | | # | + # | found mail # | +---------------+ that matched filters # | | | + # +--------------->+ gwb_modem.py +<-------------------------+ # | | # +-------+-------+ # | # v # +----------------+---------------+ # | combines frames to one payload | # +----------------+---------------+ # | # v # +--------------+----------------+ # | transmits data acoustically | # | (to buoy or Vehicle in field)| # +-------------------------------+ # Flow chart for mail going to shoreside from buoy # # made with http://stable.ascii-flow.appspot.com/ # # +-----------------+ # | | # | email_acomms+py | # | | +--+ none <-+ # +------+-+--------+ | | # | | | | # + + v | # creates instance of +-------------------+ +---------------+-------+ # | | | | | check for data from | # | +------------>+ email_sniffer.py +---------->| the modem to package | # | | | +----------+------------+ # | +-------------------+ | # | | # | +---------------+ v # | | | payload data from # +------------->+ gwb_modem.py + +--------> gwb modem ready to # | | | send to shoreside # +-------+-------+ | + # | | | # +---------------v----------------+ | | # | combines frames to one payload | | +-----------v-------------+ # +---------------+----------------+ | |packages data to be sent | # | | |over email | # +---------------------+ +-------------------------+ # | # | # | # +-----> can transmit over # freewave radio? # + + # | | # +----+ | | +-----+ # | no +----+ +----+ yes | # +--+-+ +--+--+ # | | # | | # | | # +--------------v------+ +-------v-------------+ # | Iridium modem | | freewave radio | # |---------------------| |---------------------| # | sends package | | sends package | # | created by email | | created by email | # | sniffer to shoreside| | sniffer to shoreside| # +----------+---+------+ +-------+-------------+ # | | # | | # +---------v-----------------v---------+ # | shoreside receives data and sends | # | email created by the email sniffer | # | on the buoy to the outbound address | # +-------------------------------------+ setup modem on shoreside ubuntu machine: ======================================== - First, find the serial port for the modem - connect the modem over serial to one of the ports on the ubuntu machine - bring up a terminal by pressing 'ctrl+alt+T' $ ls /dev/ >> before.txt # now unplug the modem $ ls /dev/ >> after.txt $ diff before.txt after.txt # this will list the serial port for the modem # < ttyUSB0 # should output something like that # in this case the serial port would be '/dev/ttyUSB0' $ rm before.txt after.txt - inside email_acomms.py - if the serial port is not coming up as /dev/ttyUSB0 - change line, modem.connect_serial(port='/dev/ttyUSB0', baudrate=19200) - to this, modem.connect_serial(port='/dev/ttyOTHER_PORT', baudrate=19200) - At this point the python script knows which port to send and recieve data from for the modem. 1. Send a test email to the modem to check that it can receieve mail from the network 2. Forward the recieved test email to modem on buoy 3. Forward that test email from the buoy to the modem on the shoreside to make sure they are connected