Skip to main content

T1000-E Arduino Examples

The following Arduino examples are available:

ExampleDescription
BlinkyLED flash - Controls GPIO pins to make an LED blink, used for function tests and status indication.
ButtonPrint button event - Detects button state changes and prints event information for user interaction.
BuzzerLoop play sound - Drives a buzzer to produce sounds for reminders or alarms.
SensorPrint temp/lux/battery value - Reads and prints temperature, light intensity, and battery voltage data.
AccelerometerPrint ax/ay/az/event value - Collects acceleration data for motion detection and posture recognition.
GNSSPrint latitude/longitude value - Obtains and prints GNSS-based location data.
LoRaWANJoin through OTAA, send test data to LNS - Connects to LoRaWAN and sends test data.
LoRaWAN SensorJoin through OTAA, read temp/lux/bat/ax/ay/az, send data to LNS - Collects and transmits various sensor data via LoRaWAN.
LoRaWAN GNSSJoin through OTAA, scan lat/lon, send data to LNS - Captures and transmits GNSS location data in real-time.
LoRaWAN WiFiJoin through OTAA, scan WiFi MAC, send data to LNS - Scans WiFi MAC addresses and transmits data for positioning.
LoRaWAN BeaconJoin 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:

  1. Install the Arduino IDE
  2. Add the Seeed Arduino core to the IDE as described here
  3. 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:

pir

Then open an example of your choice (in this case the accelerator example):

pir

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):

pir

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:

  1. Export the compiled binary from the Arduino IDE. You will find it in the same folder as the .ino sketch.

pir

  1. 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

  2. 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.

pir

  1. 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:

pir

Then open the serial monitor using Tools -> Serial Monitor and start observing the messages:

pir

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".

pir

Enter an Application ID and click "Create application" to save your changes.

pir

Step 2: Register the Device

Click "+ Register end device".

pir

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

pir

Now, create the credentials for your device. Either generate a new set or enter exsisting ones.

pir

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.

pir

If your region has duty cycle restrictions, make sure to enable the limitation in the reset handler:

pir

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:

pir

✨ Contributor Project

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.

Loading Comments...