Time synchronization setup of a MeteoHelix LoRaWAN weather station on TTN

QUESTION: Is remote time synchronization possible with the MeteoHelix LoRaWAN weather stations on TTN so that they can send data in 10 minute intervals on the hour?

ANSWER: MeteoHelix weather stations provide the ability to change settings and time synchronization remotely via a LoRaWAN down link connection from The Things Network (TTN) and other LoRa server providers. The below instructions and screenshots will guide you through the setup process.

LoRaWAN & Sigfox remote time synch icon.png

Time Synch on TTN

Log into your The Things Network Console at the following link: https://console.thethingsnetwork.org/

TTN Console quick downlink instructions

  1. In the top horizontal menu, click Applications.

  2. Select the application which contains your device as shown in the screenshots.

  3. In the lower horizontal menu, select Devices.

  4. Next, select the device requiring time synchronization.

  5. In the new lower horizontal menu, select Overview.

  6. Scroll way down to find the Downlink section.

  7. To send the time synchronization, fill out the Downlink section as follows:

    • Scheduling = “replace” or “first

    • FPort = 1

    • Payload = 01 5B E7 03 D0 00 00 00

    • Confirmed = checked or unchecked

Detailed downlink format explanation

Scheduling is set by default to “replace”, thus replacing all currently scheduled downlinks, if any, so that any other previously scheduled downlinks will not be sent. Setting the downlink scheduling to “first” or “last” will put this manually added downlink message in the downlink queue ahead of or after the already scheduled downlinks.

FPort for 99% of use cases will remain set to 1.

Payload format is 8 bytes long. Each pair of symbols is a byte in hexadecimal format as follows:

  • 01 5B E7 03 D0 00 00 00
    The first byte (first pair) identifies the type of message being sent. For time-synch command, the first pair must be 01. (In hexadecimal syntax 0x01)

  • 01 5B E7 03 D0 00 00 00
    The next four bytes (four pairs) contain the Unix Epoch time stamp in hex number format, 5DE703D0, which converts to 1575420880 in our familiar decimal system and in Unix Epoch time to: GMT: Wednesday, December 4, 2019 00:54:40

  • 01 5B E7 03 D0 00 00 00
    The last three bytes ( 3 pairs) are empty (zeros).

Confirmed may be left unchecked for MeteoHelix weather stations.

1. SELECT the application to which the device is connected

2. SELECT YOUR DEVICE for time synch from the list of available devices (make sure the dot indicating connection status is green next to the device address)

3. under device info, scroll down and fill out the downlink section and click send


Preparing time-synch downlink payload

If the last received data arrives at 20:19:47, 13 seconds too early, the internal time of the weather station is 13 seconds ahead of official GMT time. Since data is set by default to 10 minute intervals, we will send the weather station the last received time plus 10:00 minutes, since the downlink data on LoRa devices can only be received in a short window of time right after the device uploads its sensor data.

Converting date and time to downling message hexadecimal format

Your input:
(Date & time of last recieved data +
10 minutes)
Converted to Unix epoch
decimal date and time
20190412 20:19:47 1555100387
Decimal epoch date and timeConverted to hex epoch date and time
1555100387 5CB0F2E3
  1. Add 10 minutes to the last recived data time stamp 20:19:47 + 10 minutes = 20:29:47

  2. Convert time “YYYYMMDD 20:29:47” to Unix Epoch time stamp to Unix ten digit decimal format: Date & time to Unix Epoch decimal format converter

  3. Convert the decimal time stamp to four byte hexadecimal format for insertion into the time-sych message: Decimal-to-hex converter

Creating the downling message hexadecimal format

  1. Time-synch command is 0x01 in hex format: 01

  2. Append the four byte hex date and time after the 01 command: 01 5C B0 F2 E3

  3. Append three empty bytes (00 00 00) so the total message length is 8 bytes: 01 5C B0 F2 E3 00 00 00


Advanced downlink scheduling on TTN

Advanced information on how to setup automatic downlinks using your application as connected to the TTN LoRa server can be found here: https://www.thethingsnetwork.org/docs/applications/mqtt/api.html#downlink-messages


How does the MeteoHelix automatically handle time synchronization?

All that is required is for the MeteoHelix IoT Pro to recieve a Unix time stamp of the last received data in the form of the above specified 0x01 hex command. It then performs time synchronization according to an internal algorithm which also prevents the duplicate sending of messages after time synchronization has been performed.

The internal real time clock is very accurate and only drifts a few seconds per week. Thus, time synchronization should only be required every few weeks to maintain accurate data uplink intervals, unless environmental temperatures are highly variable.

If time time on device is sent forward and skips over the 10min sending internal time ( 29:36 -> 30:05) than the data from the last 9:36 will be averaged together with the next 10min interval data and be sent at 40:00 time.

Recieve window 1 length

Receive window 2 length

Acknowledge (Ack) timeout is set to 2 seconds. Modem resets if Ack timeout (message 2D) is received.

MeteoHelix IoT Pro LoRaWAN micro weather station in agriculture

MeteoHelix IoT Pro LoRaWAN micro weather station in agriculture

Simple tips to maximize your LoRaWAN and Sigfox weather station signal strength in the city

QUESTION: I don’t have good signal strength and get intermittent data from my IoT weather station in the city. What can I try to improve the wireless coverage?

ANSWER:

To solve wireless connectivity problems in urban areas, one must first know the following information:

  1. Where is the receiver located (gateway): Is it inside, outside, how many walls are between the gateway and the outdoors, on what floor and how high above ground level is it located.

  2. Where is the weather station located (end-node): Is it outside on a balcony or a lamp post, how many walls are between the gateway and the outdoors, how high above ground level is it located, and in general, what is between the weather station an the gateway.

Solutions for the city

  1. With many buildings around, the most common problem with wireless signal in urban weather stations is caused by building walls which weaken and block wireless signals from reaching the Sigfox and LoRaWAN receiver stations, also called gateways.

  2. Second most common problem is the gateway is location in the building. if located on the opposite side of a building, each wall and window between the gateway and the weather station weakens and potentially blocks the wireless signal. Try moving the gateway close to a window in the direction or your weather station and as high above the ground (on the highest floor of your building), outdoors or on the roof.

  3. Step 2 - Increase signal strength with a NANO/PICO/MICRO gateway or a signal repeater is also an option.

    1. Sigfox offers a micro-gateway and also a signal repeater station to increase wireless coverage between buildings.

    2. LoRaWAN offers many choices of gateways at varying price levels and performance. Searching the web for “LoRaWAN Gateways” will offer many choices.

    3. LoRaWAN gateway locations can be found on this TTNmapper map and the TTN Mapper phone app can help you find a location with good signal strength of LoRaWAN coverage.

Simple tips to maximize your LoRaWAN and Sigfox weather station signal strength in the country

QUESTION: I don’t have good signal strength and get intermittent data from my IoT weather station. I am in a rural area of the country. How can I improve my wireless coverage?

ANSWER:

To solve wireless connectivity problems, one must first know the following information:

  1. Where is the receiver located (gateway): Is it inside, outside, how many walls are between the gateway and the outdoors, and how high above ground level is it located.

  2. Where is the weather station located (end-node): Is it inside, outside, how many walls are between the gateway and the outdoors, and how high above ground level is it located.

Solutions for the country side

  1. In the country with wide open spaces, the single most common solution is to mount the weather station higher or on top of the closest hill to make sure it has line of sight view of the reciever which is called a gateway in IoT wireless systems like Sigfox and LoRaWAN.

  2. Second most common problem is that the gateway is located indoors or on the opposite side of a building where building walls weaken and block wireless signals from reaching their destination. Try moving the gateway close to a window, in your attic or outdoors or on the roof.

  3. Increasing signal strength with a NANO/PICO/MICRO gateway or a signal repeater is also an option.

    1. Sigfox now offers a micro-gateway along with a repeater station to get wireless coverage in a valley behind a hill from the Sigfox gateway.

    2. LoRaWAN offers more choices of gateways. Try searching the web for “LoRaWAN Gateway” and many choices will pop up.

    3. LoRaWAN gateway locations can be found on this TTNmapper map and the TTN Mapper phone app can help you find a location with good signal strength of LoRaWAN coverage.