Aeris and Exosite

Follow

Aeris is a US based MVNO that enables IoT devices to connect to the internet through the use of cellular networks.

This guide will walk you through activating your Aeris SIM card and connecting to Exosite with a cellular gateway.

Prerequisites

You will need the following pieces of hardware to complete this walkthrough:

Setup

The outline of this guide will be as follows:

  • Provision and activate SIM card through Aeris' dashboard
  • Add SIM to compatible Multitech Conduit
  • Enable the Multitech Conduit to use the correct APN
  • Run a short program that enables the modem, waits for an input change, and writes the data to Exosite

Provision and Activate SIM Card Through Aeris

To provision your SIM card, you will need to go to the Aeris Dashboard.

This is the dashboard page that shows account overview information. We want to activate a SIM card, so select the Devices tab from this page.

aeris_dashboard.png

You can see the devices that are already registered on the devices page. To Add another device, click the SIM Inventory button on the top toolbar.

aeris_devices.png

This will bring you to the SIM inventory page that shows the sims that are associated with your account.

sim_inventory.png

By default, 2G SIM cards are shown. Change the dropdown filter to LTE to see LTE SIM cards.

2g_to_LTE.png

This should show SIMS registered with your account. To add a new SIM, find it and look at the number of the back.

LTE_inventory.png

Select the SIM you want to provision, then select a plan for the SIM card.

add_new_device.png

After the SIM has been added, you will be taken to the SIM page that shows information about the SIM card.

added_sim.png

After adding the SIM and going back to the dashboard, we can see there are now two SIMs.

added_device.png

This means the SIM card is ready to be used!

Sending Data with the Multitech Conduit

The next step of this walkthrough is to use the SIM we just registered to send data to Exosite. We will do this very simply to focus on getting something working as quickly as possible.

The hardware used for this is a Multitech Conduit MTCDT-H5-210L with a GPIO mCard and a GPIO cable. The Multitech Conduit uses mLinux, so the setup instructions will be different if you are not using a Multitech Conduit.

Log in to the conduit - connect the USB serial cable and connect to the newly registered serial port at a baud rate of 115200. You should be presented with a login prompt, enter the login information matching your hardware.

After entering, you should have access to a shell where you can run commands.

Set the Aeris APN to "iot.aer.net" (info available here) with the following command:

# mlinux-set-apn iot.aer.net

After that, create the following file on the device:

#!/bin/bash
# MODIFY TO YOUR SETTINGS
PID=""
CIK=""
# END MODIFICATION
if [ -z $PID ] || [ -z "$CIK" ]; then
echo 'PID or CIK not set... exiting...'
exit 1
fi;
echo 'initializing cellular modem...'
pppd call gsm
trap ctrl_c INT
function ctrl_c() {
echo 'shutting down cellular modem'
killall pppd exit 1
}
while ! ifconfig ppp0;
do
ps -A | grep ppp
sleep 0.5
done;
echo 'Cell connection established'
echo 'Waiting until IP address is granted...'
sleep 0.1
until ifconfig ppp0 | grep 'inet addr:'; do :; done
echo 'Waiting for input change...'
LAST_BUTTON=0
COUNT=0
while :
do
BUTTON=$(mts-io-sysfs show ap2/din0)
if [[ $BUTTON -eq 1 ]] && [[ $BUTTON -ne $LAST_BUTTON ]] ; then
COUNT=$((COUNT+1))
echo 'The count is: '$COUNT
curl --request POST \
--url https://$PID.m2.exosite.io/onep:v1/stack/alias \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'x-exosite-cik: '$CIK \
--data "count=$COUNT"
fi
LAST_BUTTON=$BUTTON
sleep 0.05
done;

The script above has two lines that need to be edited to match your Exosite product (the PID and CIK).

The script will turn the cellular modem on, wait for a connection to be established, wait for an IP to be registered, and then send an event to Exosite every time the din0 pin has changed.

The following shows the output from the script after running, waiting, and then pressing the button two times.

count_1.png

count_2.png

Have more questions? Submit a request

Comments