Difference between revisions of "SX1262 915M LoRa HAT"

From Waveshare Wiki
Jump to: navigation, search
Line 98: Line 98:
 
If the module is set to configuration mode (Mode 2), you can configure registers according to table below. (Baud rate: 9600, 8N1)
 
If the module is set to configuration mode (Mode 2), you can configure registers according to table below. (Baud rate: 9600, 8N1)
  
{|border="1px" style="text-align:center"
+
{|border="1px" style="text-align:center; background:#FEFEFE"
 
|+ Configure registers
 
|+ Configure registers
 +
|-style="background:grey; color:white"
 +
|'''Function'''
 +
|colspan="6" |'''Descriptions'''
 
|-
 
|-
|Function
+
|rowspan="10" style="background:#C7C7C7"|'''Configure registers'''|
|colspan="5" |Descriptions
+
|colspan="2"|Command format
 +
|colspan="5"|0xC0 + Begin address + Length + Data
 
|-
 
|-
|rowspan="10"|Configure registers
+
|colspan="2"|Answer format
|colspan="5"|Command format: 0xC0 + Begin address + Length + Data
+
|colspan="5"|0xC1 + Begin address + Length + Data
 
|-
 
|-
|colspan="5"|Answer format: 0xC1 + Begin address + Length + Data
+
|colspan="6" style="background:#CCCCCC"|Examples 1: Set channel to 0x11
 
|-
 
|-
|colspan="5"|Examples 1: Set channel to 0x11
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"|Command||0xC0||0x05||0x01||0x11
 
|-
 
|-
|Command||0xC0||0x05||0x01||0x11
+
|colspan="2"|Answer||0xC1||0x05||0x01||0x11
 
|-
 
|-
|Answer||0xC1||0x05||0x01||0x11
+
|colspan="6" style="background:#CCCCCC"|Examples 2: Set Module address (0x1234), Network address(0x00), UART(9600, 8N1), Air speed(1.2K)
 
|-
 
|-
|colspan="5"|Examples 2: Set Module address (0x1234), Network address(0x00), UART(9600, 8N1), Air speed(1.2K)
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"|Command||0xC0||0x00||0x04||0x12 0x34 0x00 0x61
 
|-
 
|-
|Command||0xC0||0x00||0x04||0x12 0x34 0x00 0x61
+
|colspan="2"|Answer||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
 
|-
 
|-
|Answer||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
+
|rowspan="10" style="background:#C7C7C7"|'''Read registers'''
 +
|colspan="2"|Command format
 +
|colspan="5"|0xC1 + Begin address + Length
 
|-
 
|-
|rowspan="10"|Read registers
+
|colspan="2"|Answer format
|colspan="5"|Command format: 0xC1 + Begin address + Length
+
|colspan="5"|0xC1 + Begin address + Length + Data
 
|-
 
|-
|colspan="5"|Answer format: 0xC1 + Begin address + Length + Data
+
|colspan="6" style="background:#CCCCCC"|Examples 1: Read channel
 
|-
 
|-
|colspan="5"|Examples 1: Read channel
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"|Command||0xC1||0x05||0x01||
 
|-
 
|-
|Command||0xC1||0x05||0x01||
+
|colspan="2"|Answer||0xC1||0x05||0x01||0x12 0x34 0x00 0x61
 
|-
 
|-
|Answer||0xC1||0x05||0x01||0x12 0x34 0x00 0x61
+
|colspan="6" style="background:#CCCCCC"|Examples 2: Read Module address, Network address, Serial port and air speed.
 
|-
 
|-
|colspan="5"|Examples 2: Read Module address, Network address, Serial port and air speed.
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"|Command||0xC1||0x00||0x04||
 
|-
 
|-
|Command||0xC1||0x00||0x04||
+
|colspan="2"|Answer||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
 
|-
 
|-
|Answer||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
+
|rowspan="10" style="background:#C7C7C7"|'''Set temporary registers'''
 +
|colspan="2"|Command format
 +
|colspan="5"|0xC2 + Begin address + Lenght + Data
 
|-
 
|-
|rowspan="10"|Set temporary registers
+
|colspan="2"|Answer format
|colspan="5"|Command format: 0xC2 + Begin address + Lenght + Data
+
|colspan="5"|0xC1 + Begin address + Lenght + Data
 
|-
 
|-
|colspan="5"|Answer format: 0xC1 + Begin address + Lenght + Data
+
|colspan="6" style="background:#CCCCCC"|Examples 1:Set channel to 0x11
 
|-
 
|-
|colspan="5"|Examples 1: Set channel to 0x11
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"|Command||0xC2||0x05||0x01||0x11
 
|-
 
|-
|Command||0xC2||0x05||0x01||0x11
+
|colspan="2"|Answer||0xC1||0x00||0x01||0x11
 
|-
 
|-
|Answer||0xC1||0x00||0x01||0x11
+
|colspan="6" style="background:#CCCCCC"|Examples 2: Set module address(0x1234), network address(0x00), serial port(9600 8N1), Air speed(1.2K)
|colspan="5"|Examples 2: Set Module address (0x1234), Network address(0x00), UART(9600, 8N1), Air speed(1.2K)
 
 
|-
 
|-
| ||Head||Begin address||Length||Data
+
|colspan="2"| ||Head||Begin address||Length||Data
 
|-
 
|-
|Command||0xC2||0x05||0x01||0x11
+
|colspan="2"|Command||0xC2||0x00||0x04||0x12 0x34 0x00 0x61
 
|-
 
|-
|Answer||0xC1||0x05||0x01||0x11
+
|colspan="2"|Answer||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
 +
|-
 +
|rowspan="10" style="background:#C7C7C7"|'''Wireless configuration'''
 +
|colspan="2"|Command format
 +
|colspan="5"|0xCF 0xCF + Common command
 +
|-
 +
|Answer format
 +
|colspan="5"|0xCD 0xCF + Common answer
 +
|-
 +
|colspan="6" style="background:#CCCCCC"|Examples 1: Wireless set channel to 0x11
 +
|-
 +
| ||Wireless Head||Head(common)|| Begin address||Length||Data
 +
|-
 +
|Command||0xCF 0xCF||0xC2||0x05||0x01||0x11
 +
|-
 +
|Answer||0xCD 0xCF||0xC1||0x05||0x01||0x11
 +
|-
 +
|colspan="6" style="background:#CCCCCC"|Examples 2: Wireless set module (0x1234), network address(0x00), serial port(9600 8N1), Air speed(1.2K)
 +
|-
 +
| ||Wireless Head||Head (common) ||Begin address||Length||Data
 +
|-
 +
|Command||0xCF 0xCF||0xC2||0x00||0x04||0x12 0x34 0x00 0x61
 +
|-
 +
|Answer||0xCD 0xCF||0xC1||0x00||0x04||0x12 0x34 0x00 0x61
 +
|-
 +
|rowspan="2" style="background:#C7C7C7"|'''Format error'''
 +
|colspan="6" style="background:#CCCCCC"|Answer of Format error
 +
|-
 +
|colspan="6"|0xFF 0xFF 0xFF
 
|}
 
|}
 +
【Note】
 +
:When wireless configuring, you need to first configure Modules address, NETID(network address), Air speed and Key
  
 
==Resources==
 
==Resources==

Revision as of 08:38, 19 August 2019

SX1262 915M LoRa HAT
SX1262 915M LoRa HAT
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Instruction

This is a Raspberry Pi LoRa HAT based on SX1262, covers 915MHz frequency band. It allows data transmission up to 5km through serial port.

Features

  • Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards
  • Onboard CP2102 USB TO UART converter, for serial debugging
  • Brings the UART control interface, for connecting host boards like Arduino/STM32
  • 4x LED indicators, easy to check the module status
  • LoRa spread spectrum modulation technology, up to 81 available signal channel, longer communication distance, more robust to interference
  • Auto multi-level repeating, suit for ultra long range communication, allows multi network on the same region
  • Low power consumption features like deep sleeping and Wake on Radio, ideal for battery-powered applications
  • Customizable communication key which won't be retrieved, greatly improves the security of user data
  • Supports LBT, monitoring the signal channel noise before transmitting, greatly improves the success ratio under extreme environment
  • Supports RSSI signal intensity indicating, for evaluating signal quality, tuning the network
  • Supports wireless parameter configuration, by sending wireless command/data packet, remotely configure or retrieve the module parameter
  • Supports fixed-point transmission, broadcast, signal channel monitor
  • Comes with development resources and manual (examples for Raspberry Pi/STM32)

Specification

Specification of SX1265 915M LoRa HAT
Consumption Transmit Current 133mA (Transient current)
Receive Current 11mA
Sleep Current 2uA (LoRa module deep sleep)
MAX Transmit Power 22.0dBm(10, 13, 17, 22dBm Selectable)
Transmit Length 240 Bytes (32, 64, 128, 240 Bytes Selectable)
Buffer 1000 Bytes
Working bands 850.125 ~ 930.125MHz
Receive Sensitivity [email protected] (On air)
Interface UART
Range 5KM(Sunny day; open area; Antenna: AUX 5dBi, Height 2.5m; Air Speed: 2.4kbps)
Working voltage 5V
Logic voltage 3.3V
Working Temperature 40 ~ 85°C

Hardware description

Hardware description of SX1262 LoRa HAT
  1. SX1262 LoRa module
  2. 74HC125V: voltage level translator
  3. CP2102: USB TO UART converter
  4. Raspberry Pi GPIO connector: for connecting with Raspberry Pi
  5. USB TO UART port
  6. UART header: for connecting host boards like STM32/Arduino
  7. SMA antenna connector
  8. IPEX antenna connector
  9. Indicators:
    • RXD/TXD: UART RX/TX indicator
    • AUX: auxiliary indicator
    • PWR: power indicator
  10. UART selection jumpers
    • A: control the LoRa module through USB TO UART
    • B: control the LoRa module through Raspberry Pi
    • C: access Raspberry Pi through USB TO UART
  11. LoRa mode selection jumpers
    • short M0, short M1: transmission mode
    • short M0, open M1: configuration mode
    • open M0, short M1: WOR mode
    • open M0, open M1: deep sleep mode

【Note】

Mode 0: Transmission mode, Module transmit data when users send data to UART interface. Wireless receiving is enabled to receive data and send to UART interface when idle.
Mode 1:When it is defined to Transmit, user need to add wakeup codes before transmitting, receiving is same as Mode 0.
Mode 2: Wireless transmit and wireless receive are disabled, users can configure configuration according to #Registers Configuration
Mode 3: Wireless transmit and wireless receive are disabled, module enter deep sleep mode. Module will configure when switching to other modes.

User Guide

Registers Configuration

If the module is set to configuration mode (Mode 2), you can configure registers according to table below. (Baud rate: 9600, 8N1)

Configure registers
Function Descriptions
Configure registers| Command format 0xC0 + Begin address + Length + Data
Answer format 0xC1 + Begin address + Length + Data
Examples 1: Set channel to 0x11
Head Begin address Length Data
Command 0xC0 0x05 0x01 0x11
Answer 0xC1 0x05 0x01 0x11
Examples 2: Set Module address (0x1234), Network address(0x00), UART(9600, 8N1), Air speed(1.2K)
Head Begin address Length Data
Command 0xC0 0x00 0x04 0x12 0x34 0x00 0x61
Answer 0xC1 0x00 0x04 0x12 0x34 0x00 0x61
Read registers Command format 0xC1 + Begin address + Length
Answer format 0xC1 + Begin address + Length + Data
Examples 1: Read channel
Head Begin address Length Data
Command 0xC1 0x05 0x01
Answer 0xC1 0x05 0x01 0x12 0x34 0x00 0x61
Examples 2: Read Module address, Network address, Serial port and air speed.
Head Begin address Length Data
Command 0xC1 0x00 0x04
Answer 0xC1 0x00 0x04 0x12 0x34 0x00 0x61
Set temporary registers Command format 0xC2 + Begin address + Lenght + Data
Answer format 0xC1 + Begin address + Lenght + Data
Examples 1:Set channel to 0x11
Head Begin address Length Data
Command 0xC2 0x05 0x01 0x11
Answer 0xC1 0x00 0x01 0x11
Examples 2: Set module address(0x1234), network address(0x00), serial port(9600 8N1), Air speed(1.2K)
Head Begin address Length Data
Command 0xC2 0x00 0x04 0x12 0x34 0x00 0x61
Answer 0xC1 0x00 0x04 0x12 0x34 0x00 0x61
Wireless configuration Command format 0xCF 0xCF + Common command
Answer format 0xCD 0xCF + Common answer
Examples 1: Wireless set channel to 0x11
Wireless Head Head(common) Begin address Length Data
Command 0xCF 0xCF 0xC2 0x05 0x01 0x11
Answer 0xCD 0xCF 0xC1 0x05 0x01 0x11
Examples 2: Wireless set module (0x1234), network address(0x00), serial port(9600 8N1), Air speed(1.2K)
Wireless Head Head (common) Begin address Length Data
Command 0xCF 0xCF 0xC2 0x00 0x04 0x12 0x34 0x00 0x61
Answer 0xCD 0xCF 0xC1 0x00 0x04 0x12 0x34 0x00 0x61
Format error Answer of Format error
0xFF 0xFF 0xFF

【Note】

When wireless configuring, you need to first configure Modules address, NETID(network address), Air speed and Key

Resources

Documents

Demo codes

Softwares

FAQ

...

Supports

Support

If you require technical support, please go to the Support page and open a ticket.