T1000-E Arduino Examples
The following Arduino examples are available:
Example | Description |
---|---|
Blinky | LED flash - Controls GPIO pins to make an LED blink, used for function tests and status indication. |
Button | Print button event - Detects button state changes and prints event information for user interaction. |
Buzzer | Loop play sound - Drives a buzzer to produce sounds for reminders or alarms. |
Sensor | Print temp/lux/battery value - Reads and prints temperature, light intensity, and battery voltage data. |
Accelerometer | Print ax/ay/az/event value - Collects acceleration data for motion detection and posture recognition. |
GNSS | Print latitude/longitude value - Obtains and prints GNSS-based location data. |
LoRaWAN | Join through OTAA, send test data to LNS - Connects to LoRaWAN and sends test data. |
LoRaWAN Sensor | Join through OTAA, read temp/lux/bat/ax/ay/az, send data to LNS - Collects and transmits various sensor data via LoRaWAN. |
LoRaWAN GNSS | Join through OTAA, scan lat/lon, send data to LNS - Captures and transmits GNSS location data in real-time. |
LoRaWAN WiFi | Join through OTAA, scan WiFi MAC, send data to LNS - Scans WiFi MAC addresses and transmits data for positioning. |
LoRaWAN Beacon | Join through OTAA, scan Beacon MAC, send data to LNS - Scans and transmits Beacon MAC data for tracking and identification. |
Prerequisites
Before starting, make sure to have completed the following steps:
- Install the Arduino IDE
- Add the Seeed Arduino core to the IDE as described here
- Connect the Tracker T1000-E to your computer using the USB cable
Building an example
Open the Arduino IDE and select the T1000-E board:
Then open an example of your choice (in this case the accelerator example):
Save the example to a place of your choice by clicking File -> Save As
. This step is necessary to easily retrieve the compiled .hex
file later on which is exported to the same location as the example code and to allow potential changes to the example.
Now, we are ready to compile the example by clicking the "Verify" button. Do not use "Upload"; this will fail as the binary cannot be uploaded directly to the device by the Arduino IDE (see this section):
The example should compile without any errors, and the output in the terminal should look similar as in the screenshot above.
Uploading to target device
As the T1000-E bootloader only supports flashing via .uf2
drag&drop, it is not possible upload the examples directly via the Arduino IDE.
Instead, follow these steps:
- Export the compiled binary from the Arduino IDE. You will find it in the same folder as the
.ino
sketch.
Convert the
.hex
file into a.uf2
file. This is done using a python script which can be downloaded here. Download and run the script with the following parameters from a terminal:
python uf2conv.py -f 0xADA52840 -c -o test.uf2 <your_hex_file>.hex
Put the device into DFU mode by pressing and holding the device button, then quickly connect the charging cable twice, the green LED will be solid on. You should now find the T1000-E as mass storage device.
- Copy the
.uf2
file over to the mass storage. After it has been copied over, the device automatically starts running it.
Reading serial messages
Messages from the device print out using Serial.println
and Serial.printf
can be read using the integrated terminal of the arduino IDE.
Make sure you have enabled selected USB-CDC and enabled it:
Then open the serial monitor using Tools -> Serial Monitor
and start observing the messages:
LoRaWAN examples
The examples which include LoRaWAN messaging need two further steps.
Set up a LNS
You need a LoRaWAN network server (LNS) where your tracker can connect to. In this example we use The Things Network (TTN), but any other should work fine. In order to work with TTN, you need to have an account with The Things Industries or The Things Network and access to a gateway (either a public one or your own if none is available).
Step 1: Create an application
Navigate to Applications page and click "+ Create application".
Enter an Application ID and click "Create application" to save your changes.
Step 2: Register the Device
Click "+ Register end device".
Set the following parameters:
Frequency Plan: Select the appropriate Frequency plan for the target region
LoRaWAN version:LoRaWAN Specification 1.0.4
Regional Parameters version: V1.0.3 REV A
Now, create the credentials for your device. Either generate a new set or enter exsisting ones.
Adjust example code
To make it work, set the credentials from the previous step in the example code. Also specify the region, e.g. SMTC_MODEM_REGION_AS_923_GRP1
, SMTC_MODEM_REGION_EU_868
, or SMTC_MODEM_REGION_US_915
.
If your region has duty cycle restrictions, make sure to enable the limitation in the reset handler:
Running example code
Compile and flash the LoRaWAN example in the same manner as described for the other examples (create .uf2
file and flash via drag&drop).
Afterwards you should see messages incoming in the TTN interface:
✨ Contributor Project
- This project is supported by the Seeed Studio Contributor Project.
- A special thanks to Frederik for his dedicated efforts. Your work will be exhibited.
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.