Skip to main content

Get Started with Arduino

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.

Preparation

Hardware Preparation

  • SenseCAP T1000-E x 1
  • USB Cable x 1
  • Computer x 1

Software Preparation

Before you can start developing,the following software tools are required.

Check here for to Get Started with Arduino.

tip

The version needs to be newer than v1.6.12.

Get Started

Prerequisites

  1. Add URL

Navigate to File -> Preferences, and add the following URL to Additional Boards Manager URLs:

https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

pir

  1. Install Board

Navigate to Boards Manager, searchseeed nrf52, select the latest version and install it.

Building an Example

  1. Select board and port

Board: Seeed Tracker T1000 E
Port: Your device port

pir

  1. build example

Navigate to File -> Examples -> Seeed Tracker T1000 E LoRaWAN, Then open an example of your choice (in this case the accelerator example):

pir

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