Using these instructions and a Wio Tracker LTE from Seeed Studio, you'll quickly connect to the internet using Twilio's Programmable Wireless.
We'll use the Arduino IDE in this quickstart. The modifications we make should be adaptable outside, however.
In this quickstart, you'll learn how to:
- Sign up for a Twilio account
- Purchase a Twilio Programmable Wireless Starter Pack which comes with 3 SIM cards
- Insert a SIM card into the Wio Tracker LTE
- Connect the included cellular PCB antenna to the Wio Tracker
- Power and flash the Wio Tracker
- Verify you are connected to the internet via Programmable Wireless
- Wio Tracker LTE
- PCB cellular antenna included
- 3.7v Lithium Ion Battery with JST SH 1.0mm 2-pin connector
- Alternatively, you can adapt another lithium battery as we did. We used these adapters on Amazon. Carefully note the polarity of the jack.
- Arduino IDE
- Seeed Wio LTE Board Support Package for Arduino
- Follow the README in the repo to install
- Serial Port Driver
- (You likely need to restart after installing the serial port driver)
Already have a Twilio account and SIM card? Skip ahead to the register and activate step.
Before you can connect with Twilio Programmable Wireless you'll need a Twilio account. Once you've signed up, continue with this quickstart.
First, visit the Programmable Wireless Console. On the Orders page, purchase a set of 3 starter SIMs by selecting the SIM Starter Pack... or make a larger custom order by entering a quantity under the Multi-Size SIM Card product.
Note: Orders of 10 SIMs or more will be delivered with the SIM cards already tied to your account.
Once you receive your SIM shipment, visit the Register a SIM page in the Programmable Wireless Console.
Follow that up by picking a Unique Name for the SIM.
Next, select a Rate Plan from the options provided by Twilio.
By default, there are Rate Plans added which approximate the usage we see in the field. Rate Plans let you control every aspect of what your device can do in the field and their data usage. We've added a couple defaults which approximate usage we see in the field, but feel free to explore options later.
When you're happy with the Rate Plan, 'Activate' the SIM card.
Note: You'll need to activate your SIM for real-world workflows although you can use small amounts of data without activating.
With the Wio Tracker still disconnected from power, remove the cellular PCB antenna from the packaging. Connect it to the connector labeled 'LTE' on the Wio. Your setup should look like this:
Punch out your Twilio SIM card and insert it into the slot closest to the PCB on the Wio.
The slot is on the modem side and has an orientation diagram. You want to put it in the 'bottom' slot; the upper slot is for an optional MicroSD card.
We had version 1.1 of the Wio Tracker LTE and the module consumed too much power to be driven over USB.
Connect a 3.7v Lithium Ion battery to the board. If you use the adapters listed on Amazon carefully note the polarity of the plug before making connections. Our wires were reversed red/black for the plug onboard.
Note that the below picture shows the black and red wires oriented reverse of what the board asks for. If you purchase the same item as we did your setup will be similar - triple check the polarity before using the battery if you build an adapter like us.
Note how the battery connects and the orientation, but don't plug it in yet. Before you power up you need to complete one more step we'll cover in a second.
Follow these steps to get serial connected on the board. Note that if you change the code you will need to reboot the board in 'DFU Mode".
Hold down the 'boot' button on the module side of the Wio. It is black with a 'BOOT0' label.
- While still holding the boot button, plug the Micro USB cable between the Tracker and the computer. You should see a flashing LED on the microcontroller side.
- Using a MicroUSB cable, connect the Wio Tracker to an empty USB port on your computer. You should see signs of life (in LED form) on the board.
- Open the Arduino IDE if it isn't yet open. In the 'Tools' menu under 'Boards', scroll to 'Seeed STM32F4 Boards' and select the 'Wio Tracker LTE'.
- DO NOT select a serial port. Your board is in DFU mode so 'Port' should be empty:
Now you're ready to add the firmware to the board. Create a new project and paste the following code, or retreive it from Github and open it in the Arduino IDE.
Once you have the code inside the IDE, 'Upload' the code to the board. Once uploaded, you should see a success message in the Arduino console below the IDE window.
Seeed does not recommend using the in-built serial monitor as it can sometimes interfere with the programming process. We'll share instructions to monitor the results through two methods.
- Unplug the Wio
- Connect the battery to the Wio
- Immediately connect the MicroUSB cable between Wio and computer
The next step depends on your platform.
On a Mac OSX or *NIX machine, you should have the 'screen' emulator built-in. Open a new terminal and run screen using a command similar to the following:
screen /dev/tty.somenumbersandletters 115200
- Unplug the Wio
- Connect the battery to the Wio
- Immediately connect the MicroUSB cable between the Wio and computer
- The serial port will enumerate and you will see it in the 'Tools' -> 'Port' -> <port name> menu. Select the new serial port
- Open the serial monitor by visiting the 'Tools' menu, then selecting 'Serial Monitor'
Now that you have a Wio Tracker LTE on Twilio Programmable Wireless, we can't wait to see what you do next. Here's some inspiration:
- Emulate full end-to-end applications with Twilio Wireless Blueprints
- Manage a fleet of devices with the Programmable Wireless API
- Try Machine to Machine SMS Commands
- See all Programmable Wireless Guides and Tutorials
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。