Intro

  • Flash Pi with Lite version

  • Place SSH file in root of SD card

# Mac/Linux create empty ssh file

touch /Volumes/boot/ssh
  • Place wpa_supplicant.conf in root of SD card

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
     ssid="[ENTER_YOUR_SSID_HERE]"
     psk="[ENTER_YOUR_PASSWORD_HERE]"
     key_mgmt=WPA-PSK
}
  • Boot Pi and locate it on the network

    • You can generally find Pi Zero's IP by looking in your router admin

  • SSH into Pi Zero and update/upgrade:

sudo apt update && sudo apt upgrade

Enable Serial Communication with GSM Hat

  • Select Interfacing Options

  • Select Serial Port

  • Select No for login shell access over serial port

  • Select Yes for serial part hardware to be enabled

  • Exit raspi-config and reboot

Communication with GSM Hat

Let's confirm communication with the Waveshare GSM Hat. Place the hat on Pi Zero. Install the piccom library

Make sure to have a SIM card installed and activate. You can purchase from hologram.io

Let's test serial communication

To end picocom session execute CTRL-A followed by CTRL-X

Issue the following AT commands to bring the module up on the network:

Using the Hologram IoT network let's set the APN:

Establish the wireless connection:

The follow command allows you to check your network IP:

Sending SMS with AT Commands

Now type in your message and to end the message and send use CTRL-Z and press enter. This will terminate and send the message.

Python and DroneKit

Pi Zero should already have Python installed. You can verify this by issuing the following command:

In my case I have Python 2.7.16, which is sufficient to run DroneKit. Before installing Python we need to install a few dependencies:

Now you should be able to install DroneKit:

Send SMS with Python

The script below will send an SMS message the to designated recipient. Be sure to change the phone number in the script. To communicate with the GSM over serial be sure to install the serial port module.

DroneKit Scripts

The following script is for testing basic communication with your autopilot hardware running PX4. In my case I'm using Pixfalcon with Pi Zero connected to the micro USB port.

The following script combines the AT SMS commands with GPS from DroneKit to send a Google Maps link to the designated phone number.

Work in progress below to stream UDP to QGC....

Last updated

Was this helpful?