Cellular
Last updated
Last updated
This tutorial will show how to connect your car to the internet using M2, a Digi XBee Cellular LTE modem and a SIM card. You may also wish to reference the modem's datasheet.
The modem plugs directly into the 20 pin wireless socket on top of your M2. Make sure that it is oriented correctly with the angled chamfers pointed toward the USB/SD side of your M2. Please make sure your M2 is not being powered when plugging in the modem.
Before plugging the modem into your M2, make sure to install a SIM card. This modem uses a 4FF (Nano) size SIM card.
As you work with the Digi modem, please keep in mind that it requires more power that your computer can provide directly over a USB port. You have 2 options:
Power your M2 via the OBD2 port (i.e. plugging into your car or some sort of adapter)
Use a powered USB hub. This option is preferable for desktop development. We've had good luck with this inexpensive hub:
https://www.amazon.com/AmazonBasics-Port-2-5A-power-adapter/dp/B00DQFGH80
A good first step is to check that everything is working it to talk to the modem from your computer, through your M2. For this, you need to program your M2 with a simple sketch that will forward data between the 2 serial ports:
USBSerial, the USB connection between the M2 processor and your computer.
Serial, the Serial connection between the M2 processor and the XBee socket pins
This sketch will also make the GREEN LED blink as the associate pin of the modem toggles. The pin signals and locations for the modem can be found here.
The second part to a basic communication test is the software on your computer. Digi offers a nice UI called XCTU to communicate with their products. Download the latest verison.
Once downloaded and installed, launch XCTU and follow the instructions from Digi's documentation.
From there, you can do all sorts of fun things, from sending an SMS to connecting to servers to posting data to a website. Several examples are found on Digi's documentation page.