USB-TO-LoRa-xF

From Waveshare Wiki
Jump to: navigation, search
USB-TO-LoRa-xF
USB-TO-LoRa-xF.jpg

SMA, USB
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

This product does not support LoRaWAN.
This product only supports SX1262-LoRa-DTU-xF corresponding model communication.
At least two USB-TO-LoRa-HFs are required to form a LoRa communication network (same for USB-TO-LoRa-LF).

Introduction

The USB-TO-LoRa-xF is a wireless data transfer unit with USB interfaces based on the SX1262 module. Adopts LoRa Modulate and Demodulate technology, with the advantages of anti-interference and long-distance communication (up to 5KM). Supports point-to-point, point-to-multipoint, relay network, AES, etc. Compact size and easy to install.

Feature

  • Adopts LoRa Modulate and Demodulate technology, anti-interference, and long-distance communication.
  • Adopts the original SX1262 chip, with -148dBm reception sensitivity and 22dBm emit power.
  • Supports preamble detection, with CRC, automatic packetization, 960 bytes cache functions.
  • Supports LBT sending, RSSI output, and AT command configuration.
  • AES communication to ensure data transmission security.
  • Supports multi-level relay networking to increase the wireless communication distance.
  • Supports host configuration and firmware upgrade (support firmware customization for batch order).
  • High-quality components such as TCXO are used for stable operation in harsh conditions.
  • Comes with online development resources and manuals.

Parameters

Shape
Interface USB Type A Interface
SMA-KE female header: 6dBi Omni-directional Antenna × 1
Case ABS case
Dimensions 56.40 × 18.40 × 12.52mm
Wireless Parameters
Frequency Sub-GHz (410~490MHz, 850~930MHz)
Signal Modulation LoRa
Encryption Type AES
Emit Power +22dBm Max
Receiving Sensitivity -148dBm
UART Parameters
Baud Rate 1200 ~ 115200bps
Checksum None, even, odd
Data Bit 8 ~ 9 bit
Flow Control No flow control
Environment Requirements
Operating Temperature TCXO version:0 ~ 85℃
Normal version:0 ~ 50℃
Humidity Range 5% ~ 95% Relative Humidity

Hardware Description

This product does not support LoRaWAN.
This product only supports SX1262-LoRa-DTU-xF corresponding model communication.
At least two USB-TO-LoRa-HFs are required to form a LoRa communication network (same for USB-TO-LoRa-LF).

USB

Power up and run after connecting to the USB Type A Female port.

SMA Connector (Antenna)

Connect the SMA connector to the matching 6dBi omnidirectional antenna.

Indicator

  • PWR: when connecting to the USB interface, the PWR indicator is on.
  • TXD: when sending the data, the TXD indicator is on and off after sending.
  • RXD: when receiving the data, the RXD indicator is on and off after receiving.

Button

  • KEY: Note: Do not press the button within 3 seconds after powering on. Press and hold the button for 2 seconds to enter firmware update mode within 3 seconds of powering on. After 3 seconds of powering on, press and hold the KEY button for two seconds to restore factory settings.

Dimensions

USB-TO-LoRa-xF02.jpg

LoRa & LoRaWAN

What is LoRa ?

[Semtech]'s LoRa is a long-distance, low-power wireless platform for the Internet of Things (IoT), which generally refers to radio frequency chips using LoRa technology. The main features are as follows:

  • The spread spectrum modulation technology adopted by LoRa (abbreviation of long-range) is derived from Chirp Spread Spectrum (CSS) technology, which is one of the long-distance wireless transmission technology and LPWAN communication technology. Spread spectrum technology uses bandwidth for sensitivity technology, Wi-Fi, ZigBee, etc. all use spread spectrum technology, but the characteristic of LoRa modulation is that it is close to the limit of Shannon's theorem, and the sensitivity can be improved with maximum efficiency. Compared with traditional FSK technology, at the same communication rate, LoRa is more sensitive than FSK by 8 ~12dBm. At present, LoRa mainly operates in the ISM frequency band of Sub-GHz.
  • LoRa technology integrates technologies such as digital spread spectrum, digital signal processing, and forward error correction coding, which greatly improves the performance of long-distance communication. Lora's link budget is better than any other standardized communication technology. The link budget refers to the main factors that determine the distance in a given environment.
  • LoRa RF chips mainly include SX127X series, SX126X series and SX130X series, of which SX127X and SX126X series are used for LoRa nodes, and SX130X is used for LoRa gateways. For details, please refer to [Semtech]'s product list.

What is LoRaWAN ?

  • LoWAN is an open protocol for low-power wide-area networks based on LoRa radio modulation technology. Designed to wirelessly connect battery-powered "things" to the Internet in regional, national or global networks, and target critical Internet of Things (IoT) requirements such as two-way directional communication, end-to-end security, mobility, and localized services. The node wirelessly connects to the Internet with network access authentication, which is equivalent to establishing an encrypted communication channel between the node and the server. The LoRaWAN protocol level is shown in the figure below.
    • The Class A/B/C node devices in the MAC layer basically cover all the application scenarios of the Internet of Things. The differences among the three nodes lie in the different time slots of sending and receiving for nodes.
    • EU868 and AS430 in the Modulation layer show that frequency band parameters are different in different countries. Please click the reference [link] for regional parameters.

SX1262-LoRa-HAT-0201.png

  • To achieve LoRaWAN network coverage in cities or other areas, it needs to be composed of four parts: nodes (LoRa node RF chips), gateways (or base stations, LoRa gateway RF chips), Servers and clouds, as shown in the figure below:
    • DEVICE (node device) needs to initiate a network access request packet to GATEWAY (gateway) and then to the server. After passing the authentication, it can normally send and receive application data from the server.
    • GATEWAY (gateway) can communicate with the server via a wired network or 3/4/5G wireless network.
    • The main operators on the server side include TTN, etc. For building cloud services by yourself, please refer to lorawan-stack, chirpstack.

SX1262-LoRa-DTU-xF LORA.png

Application

LoRa devices and networks such as LoRaWAN enable smart IoT applications to help solve the planet's formidable challenges in energy management, natural resource reduction, pollution control, infrastructure efficiency, disaster prevention, and more. Semtech's LoRa devices have achieved hundreds of successful use cases in smart cities, homes and buildings, communities, metrology, supply chain, logistics, agriculture, and more. LoRa networks have covered hundreds of millions of devices in more than 100 countries and are committed to a smarter planet.

How To Use

Boot Test

  • This test uses two sets of USB to RS232 cables and a DTU connection to test on PC Windows 10, DTU uses an RS232 interface for streaming mode transmission by default when powered on.
  • Download and open the AT setting tool or other serial port assistant tools, connect the USB to the RS232 serial port number, set the baud rate to 115200, and finally click to open the serial port.
  • After entering the data in the SSCOM sending area and clicking the send button, the received data will be printed on the other set of LoRa devices as shown in the figure below.

SX1262-LoRa-DTU-xF User Guide 01.jpg

AT Commands

  • The DTU works in the stream transmission mode of the RS232 interface by default, and the default parameters can be used for pairing and sending. The default parameters are as follows:
Item Parameter Default Value
Spreading Factor Default 7, (7~12 optional)
Bandwidth Default 0: 125KHz (1:250, 2:500 (KHz) optional)
Code Rate Default 4/5 (4/5, 4/6, 4/7, 4/8 optional)
Emit Power Default 22dBm (10~22dBm optional)
Network ID Default 0 (0~255 optional)
LBT (Listen Before Talk) Default 0: disabled, 1: enabled
Operating Mode Default 1: stream mode (2: packet mode, 3: relay mode)
Transmission Channel HF version defaults to 18 (corresponding to 868MHz) ( 0~80 is optional, corresponding to 850~930Mhz or 410~490MHz )
LF version defaults to 23 (corresponding to 433MHz)
Receiving Channel HF version defaults to 18 (corresponding to 868MHz) ( 0~80 is optional, corresponding to 850~930Mhz or 410~490MHz )
LF version defaults to 23 (corresponding to 433MHz)
Address Default 0 (0~65535 optional, 65535 is broadcast listening address)
Interface Selection Default 3: RS232 (1: RS422, 2: RS485, 3: RS232 optional)
Interface Baud Rate Default 115200bps (1200~115200bps optional)
Interface Parity No parity by default (no parity, odd parity, even parity optional)
Key Default 0 no encryption (0~65535 optional)
  • For DTU settings, please check the add CRLF or add the carriage return line feed option. If the extension bar does not appear, click the extension button on the right to pop up. Click the +++ command button to enter the AT command mode, as shown in the figure below:

DTU-xF User Guide.jpg

  • When configuring DTU for other devices such as PLC, pay attention to the carriage return and line feed character CR LF(\r\n) at the end of the AT command.
+++\r\n                                               Enter AT command mode
AT+EXIT\r\n                                           Exit AT command mode
ATE\r\n                                               Enable/disable AT command echo
AT+VER\r\n                                            Check the software version number
AT+HELP\r\n                                           View AT help

AT+SF=7\r\n                                           Set the spreading factor to 7, the value range is 7~12
AT+BW=0\r\n                                           Set bandwidth, 0 means 125KHz, 1 means 250KHz, 2 means 500KHz
AT+CR=1\r\n                                           Set the encoding rate to 1, 1 represents 4/5, 2 represents 4/6, 3 represents 4/7, 4 represents 4/8
AT+PWR=22\r\n                                         Set the RF power, the value range is 10~22dBm
AT+NETID=0\r\n                                        Network ID assignment, the value range is 0~65535
AT+LBT=0\r\n                                          Enable/disable LBT function, 0: disable, 1: enable
AT+MODE=1                                             DTU working mode, 1: stream mode, 2: packet mode, 3: relay mode
AT+TXCH=18\r\n                                        Transmit channel, value range 0~80, corresponding frequency point is 850~930MHz or 410~490MHz
AT+RXCH=18\r\n                                        Receive channel, value range 0~80, corresponding frequency point is 850~930MHz or 410~490MHz
AT+RSSI=0\r\n                                         Enable/disable RSSI signal value output, 0: disable, 1: enable
AT+ADDR=0\r\n                                         Set DTU address, value range 0~65535
AT+PORT=3\r\n                                         Set COM port, 1:RS422, 2:RS485, 3:RS232
AT+BAUD=115200\r\n                                    Set COMx port baud rate, value range 1200~115200, 1200, 2400, ....., 57600, 115200ss
AT+COMM="8N1"\r\n                                     Set COM port parameters, data bits: 8 or 9, parity: N, O, E, stop bits: 0, 1, 2
AT+AllP=7,125,1,22,0,0,1,18,18,0,0,3,115200, "8N1",0   Set the spreading factor to key multi-parameter
AT+RESTORE=0\r\n                                      Restore factory settings, 0: disabled, 1: enabled

Stream Transfer Mode

  • Stream transfer mode refers to a transmission mode in which the DTU transmits the data stream sent by the interface to other Device for demodulation by LoRa and outputs the data stream from the specified interface, that is, send and receive as shown below:
    • Suppose there are Device A, B, C, D, E, F, and G devices to form a stream mode communication network. To change the address, channel, and working mode of the devices in the LoRa network, please refer to the following communication diagram and parameter table, and pay attention to using the AT command (AT+MODE=1\r\n) to switch to the stream transfer mode.
      • Device A and Device C form point-to-point communication.
        • Device A sends Hello World to Device C, and Device C with a matching address channel can receive it normally.
        • Device C sends Hello World to Device A, and Device A with a matching address channel can receive it normally.
      • Device A, B, C, D, E, and F constitute stream mode point-to-multiple communication, Device B's address is set to 65535 (Hex: 0xFFFF), at this time it will be used as a device with broadcast monitoring function in the LoRa network, Device B broadcast when sending data streams, devices with addresses 0~65535 in the same channel can receive data streams, and when other devices send data streams, Device B can monitor the data streams of devices with addresses 0~65535 in the same channel.
        • Device B broadcasts and sends HI World data streams, Device A, C, D, and E with matching channels receive normally, and Device F with mismatched channels fails to receive.
        • When Device A, C, D, and E send data stream, such as Device A sends Hello World, Device B can monitor the received data stream.
        • When Device F with a mismatched channel sends a data stream, Device B fails to monitor and receive.

DTU-xF User Guide02.jpg

Parameters Device A Device B Device C Device D Device E Device F
Spreading Factor 7 7 7 7 7 7
Bandwidth 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz
Code rate 1: 4/5 1: 4/5 1: 4/5 1: 4/5 1: 4/5 1: 4/5
Operating Mode 1: Stream mode 1: Stream mode 1: Stream mode 1: Stream mode 1: Stream mode 1: Stream mode
Address 65534 (Hex:0xFFFE) 65535 (Hex:0xFFFF) 65534 (Hex:0xFFFE) 65534 (Hex:0xFFFE) 0 (Hex:0x0000) 65534 (Hex:0xFFFE)
Channel 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 65 (Hex:0x41)
Example 1 Send Hello World × ×
Example 2 Send Hi World ×
Example 3 Send Any World × ×

SX1262-LoRa-DTU-xF User Guide090.jpg

Packet Transfer Mode

  • Packet mode refers to a transmission mode in LoRa devices where the first 3 bytes of the sent data stream specify the destination device address and channel. The data stream uses the hexadecimal (Hex) data format.
    • Assuming there are Device A, B, C, D, E, and F, a total of 6 LoRa devices forming a packet mode LoRa communication network. To modify the address, channel, and working mode of the LoRa devices in the network, please refer to the communication diagram and parameter table provided below. Please note to use the AT command (AT+MODE=2\r\n) to switch to packet mode.
      • Device A and Device C devices form a packet-mode point-to-point communication
        • Device A sends hexadecimal data stream FF FE 12 AA, where FF FE is the address of the receiving data stream device (i.e., Device C), 12 is the channel of the receiving data stream device (i.e., Device C), and AA is the data (note that the hexadecimal data format is A...F, such as AA, AF, FA, etc.). F, such as AA, AF, FA, etc.), the Device C device with a matching address channel receives the data normally.
        • Device C sends hexadecimal data stream 00 01 12 CC, where 00 01 is the address of the receiving data stream device (i.e., Device A), 12 is the channel of the receiving data stream device (i.e., Device A), and CC is the data (note that the hexadecimal data format is A...F, such as AA, AF, FA, etc.). F, such as AA, AF, FA, etc.), the Device A device with a matching address channel receives the data normally.
      • Device A, B, C, D, E, and F form a packet mode point-to-multiple communication, Device B's address is set to 65535(Hex:0xFFFF), this time it will be used as a broadcast listening device in the LoRa network, Device B broadcasts and sends out a data stream, the devices with the address 0~65535 under the same channel will be able to receive the stream, and when the other devices send out a stream, Device B will be able to listen to the stream of the devices with the address 0~65535 under the same channel. When other devices send data streams, Device B can listen to the data streams of devices with addresses 0~65535 under the same channel.
        • Device B broadcasts and sends a hexadecimal data stream FF FF 12 BB, where FF FF is the broadcast address, 12 is the channel, BB is the data, Device A, C, D, E (channel 18(Hex:0x12)) with matching channel receives it normally, and Device F (channel 65(Hex:0x41)) with mismatching channel fails to receive it.
        • When Device A, C, D, or E sends a data stream, such as Device A sends FF FE 12 AA, Device B can listen to the received data stream BB.
        • When Device F device (channel 65 (Hex: 0x41)) with a mismatched channel sends a data stream, Device B fails to monitor and receive.

DTU-xF User Guide03.jpg

Parameters Device A Device B Device C Device D Device E Device F
Spreading Factor 7 7 7 7 7 7
Bandwidth 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz
Code Rate 1: 4/5 1: 4/5 1: 4/5 1: 4/5 1: 4/5 1: 4/5
Operating Mode 2: Packet transfer mode 2: Packet transfer mode 2: Packet transfer mode 2: Packet transfer mode 2: Packet transfer mode 2: Packet transfer mode
Address 65534 (Hex:0xFFFE) 65535 (Hex:0xFFFF) 65534 (Hex:0xFFFE) 65534 (Hex:0xFFFE) 0 (Hex:0x0000) 65534 (Hex:0xFFFE)
Channel 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12) 65 (Hex:0x41)
Example 1 Send AA (Hex) × ×
Example 2 Send BB (Hex) ×
Example 3 Send CC (Hex) × ×

SX1262-LoRa-DTU-xF User Guide15.jpg

Relay Mode

  • Relay mode refers to a transmission mode in the LoRa network where some LoRa devices act as relay nodes to forward data streams from either stream mode or packet mode. Relay mode devices do not output any data from their interfaces; their main function is to increase the wireless communication distance.

DTU-xF User Guide10.jpg

First-level Relay

  • The first-level relay refers to a transmission mode in a LoRa network where multiple LoRa devices are configured, and only one LoRa device acts as a relay node to forward data streams from other LoRa devices.
    • In a separate first-level relay LoRa network comprising devices A, G, and H, when Device G is set as the relay mode using the AT+MODE=3\r\n command, it only relays data streams from Device A and Device H while not outputting any data streams from its interface.
    • In the relay mode LoRa communication network, the communication devices in stream mode or packet mode have the same parameters except for the NETID parameter. For Device A and H, their NETID parameters will be used as addressing addresses for the relay node. For example, the NETID values of Device A and H form the address for Device G in hexadecimal: 0x0304 (Decimal: 772).
Parameters Device A Device G Device H
Spreading Factor 7 7 7
Bandwidth 0: 125KHz 0: 125KHz 0: 125KHz
Code Rate 1: 4/5 1: 4/5 1: 4/5
NETID Hex: 0x03 (Decimal: 3) Ignore Hex: 0x03 (Decimal: 3)
Operating Mode 1: Stream Transfer Mode 3: Relay Mode 1: Stream Transfer Mode
Address Hex: 0x0102 (Decimal: 258) Hex: 0x0304 (Decimal: 772) Hex: 0x0102 (Decimal: 258)
Channel 18 (Hex:0x12) 18 (Hex:0x12) 18 (Hex:0x12)

SX1262-LoRa-DTU-xF User Guide17.jpg

Second-level Relay

  • Second-level relay refers to a transmission mode in a LoRa network where multiple LoRa devices are configured, and only two LoRa devices act as relay nodes to forward data streams from other LoRa devices.
  • In the network depicted above, devices A, B, C, and D form a second-level relay LoRa network. After configuring Device B and C as relay mode using the AT+MODE=3\r\n command, they will only relay data streams from Device A and Device D while not outputting any data streams from their interfaces.
Parameters Device A Device B Device C Device D
Spreading Factor 7 7 7 7
Bandwidth 0: 125KHz 0: 125KHz 0: 125KHz 0: 125KHz
Code Rate 1: 4/5 1: 4/5 1: 4/5 1: 4/5
NETID Hex: 0x03 (Decimal: 3) Ignore Ignore Hex: 0x05 (Decimal: 3)
Operating Mode 1: Stream Transfer Mode 3: Relay Mode 3: Relay Mode 1: Stream Transfer Mode
Address Hex: 0x0102 (Decimal: 258) Hex: 0x0304 (Decimal: 772) Hex: 0x0405 (Decimal: 1029) Hex: 0x0102 (Decimal: 258)
Channel 18 (Hex: 0x12) 18 (Hex: 0x12) 18 (Hex: 0x12) 18 (Hex: 0x12)

SX1262-LoRa-DTU-xF User Guide 18.jpg

Other Functions

RSSI Output

  • RSSI, Received signal strength indication, used to evaluate signal quality, improve communication network, distance measurement, etc.
  • After using AT+RSSI=1 (default 0: disabled) to enable the RSSI function, as shown in the figure below, each output data packet will follow a hexadecimal RSSI value.

SX1262-LoRa-DTU-xF User Guide22.jpg

LBT (Listen Before Talk)

  • LBT (Listen Before Talk) means that the module actively monitors the channel environment noise before sending. This function can improve the communication success rate and anti-collision processing of DTU in harsh environments.
  • Use AT+LBT=1 (default 0: disabled) to enable the LBT function, and actively monitor the channel noise before sending the data packet, if it exceeds the threshold, the sending will be delayed, the maximum delay is two seconds, and the sending will be forced after more than two seconds.

SX1262-LoRa-DTU-xF User Guide23.jpg

Update Firmware

  • Press and hold the button for 2 seconds to enter firmware update mode after 3 seconds of powering on. Release the KEY button when the TXD and RXD lights are on simultaneously. Enter firmware update mode after the TXD and RXD lights turn off.
  • Download and open the firmware update software and select the corresponding COM port. Choose the latest firmware for the corresponding model, such as USB-TO-LoRa-HF-B-V12.ws, and click the 'Update' button to update.

USB-TO-LoRa-xF-Update01.jpg


Resource

Datasheet

Software

Others

FAQ

 Answer:
  • The default mode is transparent transmission. Enable carriage return and line feed by checking the corresponding option. Use a baud rate of 115200 to send '+++' to enter command mode.
  • To exit the AT command mode, send the following command with carriage return and line feed.
+++
AT+EXIT

{{{5}}}


 Answer:

By default, LoRa packet CRC detection cannot be canceled, auto packetization and 960 bytes caching are fixed and cannot be changed, and the maximum data size of a single packet is 240 bytes, if it exceeds 240 bytes, it will be automatically packetized. Support preamble detection with CRC, auto packetization, and 960 bytes caching:
USB-TO-LORA-XF-faq03.png

{{{5}}}


 Answer:

Exit AT command mode after setting.

{{{5}}}


 Answer:

For abnormal modules, please refer to the steps to upgrade the firmware and repair it.
Press the KEY button within three seconds after powering on, the TXD RXD light flashes once, and the firmware update mode is entered.
Download and open the firmware update software, open the corresponding COM, select the latest firmware such as SX1262-LoRa-DTU-HF-V1.1.ws, and click the Update button to update:
USB-TO-Lora-faq.jpg

  • Firmware:

https://files.waveshare.com/upload/0/0b/USB-TO-LoRa-Update.zip

  • Update tool:

https://files.waveshare.com/wiki/USB-TO-LoRa-XF/firmware/DTU%20Update%20Tool.exe

  • Refer Video:

https://files.waveshare.com/wiki/USB-TO-LoRa-XF/video/lora-dtu-firmware-video.zip

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)