Introduction
The Monarch Go Pi HAT is a cellular connectivity add-on card for SBC boards that have a Raspberry Pi HAT-compatible connector. Fitted with Sequans Monarch Go (or Monarch Go GPS) LTE Cat-M1 modem, this HAT board also facilitates expansion via Click boards using a compact onboard Click Shuttle connector. Noteworthy is that an integrated onboard USB-UART bridge interface allows this LTE HAT to also be used with other platforms.
Version
Date | Version | Revision |
---|---|---|
18 June 20 | 01 | Initial Release |
Prerequisites - Before starting this Getting Started Guide, you will need to register your Monarch Go Modem with the Verizon Thing Space network. You will need to sign up and select your desired service plan. Please visit https://thingspace.verizon.com/
Required Equipment
- MaaXBoard
- 16GB MicroSD Card
- USB Type C Power Supply
- microUSB Cable
Demo 1. Monarch GO Pi Hat Standalone Operation
The Monarch Go Pi hat can be operated in standalone operation via the MicroUSB interface
Hardware Setup
1. Set the Moanrch Go Pi Hat Jumpers to Standalone operation
- J6 : 3-5 / 4-6
- J7 : 3-5 / 4-6
- J10 : 1-2
2. Connect the Monarch Go Pi using the microUSB J8 connector on the Monarch Go Pi Hat to your PC using a microUSB cable
Software Configuration
1. Now that the hardware is all setup, open a terminal such as Tera Term or Putty and connect to the Monarch Go UART interface.
Please note your COM port will vary from the image below. If you cannot connect to the UART interface please verify the jumpers are configured correctly.
2. In the Terminal enter : AT+CMEE=2 You should receive the message OK back from the modem indicating success
This will allow verbose error messages from AT Commands
3. Now lets check the SIM Card state to verify if the SIM is present and unlocked. Enter AT+CPIN? if everything is operating correctly you will receive back +CPIN:Ready incating the SIM card is present and unlocked
4. Now that we have verified the present of the SIM lets make sure you are connected to the Verizon Thing Space network. Enter AT+CEREG?
You should get back somthing along the lines of +CEREG: 2,1 "XXXX", "XXXXXXX",X if everything is operating correctly.
If you don't recevie this back you should verify your Verizon ThingSpace account and Modem and connected.
5. Now that the connection has been verified lets do a simple ping using AT commands. Enter AT+PING="8.8.8.8" This command will ping google.com. You shoudl recieve 4 ping indicators back followed by an OK.
6. Now you have successfull connected and started working with the Monarch Go Pi Hat Standalone. Lets move over to Single Board Computer development moving into Demo 2.
Demo 2. MaaxBoard Monarch GO Pi Hat Implementatin
Operating System SD Card Setup
1. Take your 16GB microSD Card and connect it to your PC
2. Download the Debian Out of Box image by going to www.avnet.me/maaxboard Reference Designs -> Out of Box Image -> Debian Linux Out of Box Image.
3. You can then use a program such as Win32DiskImager or Etcher.io to flash the .img image onto the 16GB SD Card.
4. Leave the SD Card in your PC as some changes will need to be made.
Customizing the OS and Application
1. For the MaaXBoard Debian image, the default UART used by console for communicating with the SBC is UART1 which is the same UART interface the Monarch Go Pi Hat needs to use.
We will need to change our console UART from UART1 to UART2. Open microSD Card in the windows explorer.
Open the un.ev file using a text editor, change console=ttymxc0 to console=ttymxc1
See completed change in image below for reference. Make sure to save and exit the text editor
2. Now that the console UART interface is configured correctly, lets grab the application we will be using from the Avnet GitHub.
Go to github.com/Avnet/sequans_python Click Clone -> Download ZIP
3. Unzip the ZIP file and paste the http_demo.py onto the microSD Card
4. Before we eject the microSD Card open the http_demo.py application using a text editor.
In the case you are using a different Single Board Computer from the MaaXBoard, you may have to define the correct UART interface based on your hardware.
In this case it is already configured correctly to work with the MaaXBoard.
5. Safely Eject the microSD Card.
Hardware Setup
1. Set the Monarch Go Pi Hat Jumpers to Single Board Computer Operation
- J6 : 1-3 / 2-4
- J7 : 1-3 / 2-4
- J10 : No Connect
2. Connect the Monarch Go Pi Hat to your SBC 40 pin GPIO Raspberry Pi Hat
3. Optional : Connect up the shuttle click interface to the MaaXBoard. Install the Microchip USB I2C click onto the shuttle click.
4. Insert the microSD Card into the MaaXBoard and connect the power supply. The MaaXBoard should power on.
Running the Application
1. Now that the board is powered on, connect to the terminal UART2 interface of the MaaXBoard using Tera Term or Putty.
This can be done by using the optional shuttle click and Microchip USB I2C click.
Another option is using the HDMI interface or SSH into the board.
2. Login to the MaaXBoard using the Username/Password root/avnet
3. Go to the boot directory in the image to find the http_demo.py application. Enter the following commands cd /boot and then enter ls to see the files in your location.
4. Now we must connect the MaaXBoard to the internet via the ethernet port or via the wifi. We need to do this to add additonal packages to run our Monarch Go Pi Hat demo.
a. Ethernet Connection - plug in a unrestricted ethernet connection into the RJ45 jack on the MaaXBoard
b. Wifi Connection - Enter the following commands
i. nmcli r wifi on This command enables the WIFI Device
ii. nmcli dev wifi This command searches for available WIFI networks
iii. nmcli dev wifi con "Embest-WiFi " password "12345678" ifname wlan0 Connects you to the desired network
5.Before we run the application we need to add a Python 3 library to this image that we are missing. Update the existing packages and then add ther python 3 serial library.
a. Enter apt-get update This will update existing packages
b. Enter apt-get install python3-serial This will add the serial package needed to run the application
6. Now that the requried packages are available, lets configure the RTS and CTS GPIO signals approaprately. Run the following commads.
a. echo 81 > /sys/class/gpio/export
b. echo out > /sys/class/gpio/gpio81/direction
c. echo 0 > /sys/class/gpio/gpio81/value
d. echo 3 > /sys/class/gpio/export
e. echo in > /sys/class/gpio/gpio3/direction
These five commands will set RTS (GPIO 17) as an ouput fulled low and CTS (GPIO 16) as an input on the MaaXBoard
7. Now lets run the Python3 application enter python3 ./http_demo.py You should see a menu similiar to what is shown below.
Running the Application
1. I'd reccomend starting with Entering 1 This will show your frimware version and verify communication between the modem and the SBC
2. For the HTTP communications examples, the script interacts with http://httpbin.org--a simple HTTP Request & Response service--by sending PUT, POST, GET, DELETE, and STREAM commands.
When httpbin.org receives the commands, it echos the command back. An example using a PUT command is:
You can also use HTTPS rather than HTTP by toggling TLS prior to issuing the command. In the example above, TLS was enabled so the response url is displayed as "https://httpbin.org/put".
3. Using the MQTT Interface
a.The example script also supports posting and subscribing to an MQTT exchange. To demonstrate interaction with an MQTT broker, the script uses HiveMQ and the Chrome browser application MQTTBox.
To begin, setup the MQTTBox application to use an MQTT Client id of 'client-test1' and a Host address of 'broker.hivemq.com'. This will allow you to monitor and post to topics from within MQTTBox. The setup should look similar to:
b.Once configured, you can monitor and post topics. In the script, 'sqn/test' is the topic used so when posting to the Sequans module, use this topic (in the Topic to publish box) and whatever Payload you would like will be sent to this topic.
When the 'Publish' button is pressed, the payload will be displayed on the right side of the dialog showing the payload for the 'sqn/test' topic. An example of this is shown below:
c.Using the example script provided, select either 7 or 8 to Subscribe/Post messages between HiveMQ, the MQTTBox application, and the Python script.
For example, in the following screen shot, an MQTT Subscribe action has been executed and the script then waits for a subscribed message to be received.
When the payload is posted to the 'sqn/test' topic using MQTTBox, it will also be displayed in the Python Script as shown below.
Similarly, when a Post is executed by the Python script (selection 8), the published message is displayed within MQTTBox as shown below: