mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
Merge branch 'master' of github.com:m5stack/m5-docs
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
|
||||
### 1. Arduino IDE
|
||||
|
||||
*To get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/8servos_hat/Arduino)*
|
||||
*To get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/8servos-hat/Arduino)*
|
||||
|
||||
|
||||
## 8Servos HAT Instructions
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
# Module LoRa868 {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/module/module_lora868_01.jpg" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lora868_02.jpg" width="30%" height="30%">
|
||||
|
||||
***
|
||||
|
||||
:memo:**[Description](#Description)** :octocat:**[Example](#Example)** :electric_plug:**[Schematic](#Schematic)** 🛒**[Purchase](https://m5stack.com/collections/m5-module/products/lora868-module)** <img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo-min.jpg">**[EasyLoader](#EasyLoader)**
|
||||
|
||||
## Description
|
||||
|
||||
**LoRa868** integrated LoRa Module Ra-01H, working frequency is 803~930MHz,designed and produced by Ai-Thinker. On the board has some extra space left over, so we give you a prototyping area, it's great for adding on your customized circuit working with the LoRa868 Module.
|
||||
|
||||
LoRa enables long-range transmissions (more than 10 km in rural areas) with low power consumption,The technology is presented in two parts: LoRa, the physical layer and LoRaWAN (Long Range Wide Area Network), the upper layers.
|
||||
|
||||
LoRa and LoRaWAN permit long-range connectivity for Internet of Things (IoT) devices in different types of industries.
|
||||
|
||||
## Product Features
|
||||
|
||||
- LoRa Module: Ra-01H (by Ai-Thinker)
|
||||
- Series Communication Protocol: SPI
|
||||
- Universal Perboard
|
||||
- Working Frequency: 803~930 MHz
|
||||
- Supports FSK, GFSK, MSK, GMSK, LoRa ™ and OOK modulation modes
|
||||
- Receive sensitivity: lowest to -141 dBm
|
||||
- Programmable bit rate up to 300Kbps
|
||||
- Build-in FPC Antenna
|
||||
- External Antenna port
|
||||
- Program platform: Arduino, Micropython, UIFlow(Blockly)
|
||||
- Product Size:54.2mm x 54.2mm x 12.8mm
|
||||
- Product weight:14.5g
|
||||
|
||||
## Include
|
||||
|
||||
- 1x M5Stack LoRa868 Module
|
||||
|
||||
## Applications
|
||||
|
||||
- Automatic meter reading
|
||||
- Home building automation
|
||||
- Remote irrigation system
|
||||
|
||||
## Related Link
|
||||
|
||||
- **[LoRa Info](http://wiki.ai-thinker.com/lora) (LoRa)**
|
||||
|
||||
- **[LoRaWAN Regional Parameters](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/module/lorawantm_regional_parameters_v1.1rb_-_final.pdf)**
|
||||
|
||||
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Module/EasyLoader_LORA868_Duplex.exe"><button type="button" class="btn btn-primary">click to download EasyLoader</button></a>
|
||||
|
||||
>1.EasyLoader is a simple and fast program burner. Every product page in EasyLoader provides a product-related case program. It can be burned to the master through simple steps, and a series of function verification can be performed.(**Currently EasyLoader is only available for Windows OS**)
|
||||
|
||||
>2.After downloading the software, double-click to run the application, connect the M5 device to the computer via the data cable, select the port parameters, and click **"Burn"** to start burning.
|
||||
|
||||
!>3.The CP210X (USB driver) needs to be installed before the EasyLoader is burned. [Click here to view the driver installation tutorial](en/related_documents/M5Burner#install-usb-driver)
|
||||
|
||||
## Example
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
These are the point-to-point communication examples between two LORA868 modules. The LoRa nodes send and receive messages.
|
||||
|
||||
* Blue string indicates sending succeed.
|
||||
|
||||
* Yellow string display the received messages.
|
||||
|
||||
* Red string indicates initialization failed.
|
||||
|
||||
*To get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LORA868/Arduino)*
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
#include <M5LoRa.h>
|
||||
|
||||
//declaration
|
||||
String outgoing; // outgoing message
|
||||
byte msgCount = 0; // count of outgoing messages
|
||||
byte localAddress = 0xBB; // address of this device
|
||||
byte destination = 0xFF; // destination to send to
|
||||
|
||||
//initialization
|
||||
M5.begin();
|
||||
LoRa.setPins(); // set CS, reset, IRQ pin
|
||||
LoRa.begin(868E6); // initialize ratio at 868 MHz
|
||||
|
||||
//send message
|
||||
void sendMessage(String outgoing) {
|
||||
LoRa.beginPacket(); // start packet
|
||||
LoRa.write(destination); // add destination address
|
||||
LoRa.write(localAddress); // add sender address
|
||||
LoRa.write(msgCount); // add message ID
|
||||
LoRa.write(outgoing.length()); // add payload length
|
||||
LoRa.print(outgoing); // add payload
|
||||
LoRa.endPacket(); // finish packet and send it
|
||||
msgCount++; // increment message ID
|
||||
}
|
||||
|
||||
//receive message
|
||||
void onReceive(int packetSize) {
|
||||
if (packetSize == 0) return; // if there's no packet, return
|
||||
int recipient = LoRa.read(); // recipient address
|
||||
byte sender = LoRa.read(); // sender address
|
||||
byte incomingMsgId = LoRa.read(); // incoming msg ID
|
||||
byte incomingLength = LoRa.read(); // incoming msg length
|
||||
|
||||
String incoming = "";
|
||||
|
||||
while (LoRa.available()) {
|
||||
incoming += (char)LoRa.read();
|
||||
}
|
||||
}
|
||||
|
||||
onReceive(LoRa.parsePacket());
|
||||
```
|
||||
|
||||
<img src="assets/img/product_pics/module/module_example/LORA/example_module_lora868_02.png">
|
||||
|
||||
## Schematic
|
||||
|
||||
<img src="assets/img/product_pics/module/lora868_sch.png">
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
### 1. Arduino IDE
|
||||
|
||||
[点击此处](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/8serves_hat/Arduino),获取完整程序.
|
||||
[点击此处](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/8serves-hat/Arduino),获取完整程序.
|
||||
|
||||
|
||||
## 舵机控制说明
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
# Module LoRa868 {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/module/module_lora868_01.jpg" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lora868_02.jpg" width="30%" height="30%">
|
||||
|
||||
***
|
||||
|
||||
:memo:**[描述](#描述)** :octocat:**[例程](#例程)** :electric_plug:**[原理图](#原理图)** 🛒**[购买链接](https://m5stack.com/collections/m5-module/products/lora868-module)** <img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo-min.jpg">**[EasyLoader](#EasyLoader)**
|
||||
|
||||
## 描述
|
||||
|
||||
**LoRa868** 是M5Stack堆叠模块系列中的一款,节点通信模块,工作频率806~930MHz.该模块集成了由Ai-Thinker设计和生产的Ra-01H模组,模块上保留了一定的拓展空间,以便你进行更多的功能设计.无论是进行基本的远距离通信或是有着更多定制化元素的项目,LoRa868模块都会是合适的选择.
|
||||
|
||||
LoRa能够实现低功耗的远距离通信(在乡村地区等较为空旷的地区,通信距离甚至能够超过10公里).该技术由两部分组成:LoRa物理层和LoRaWAN(长距离广域网)上层.
|
||||
|
||||
LoRa和LoRaWAN允许与不同类型的物联网(IoT)设备,进行远程连接.
|
||||
|
||||
## 产品特性
|
||||
|
||||
- LoRa 模块: Ra-01H (by Ai-Thinker)
|
||||
- 串行通信协议: SPI
|
||||
- 万能板
|
||||
- 工作频率: 806~930 MHz
|
||||
- 支持FSK,GFSK,MSK,GMSK,LoRa™和OOK调制模式
|
||||
- 接收灵敏度:低至-141 dBm
|
||||
- 可编程比特率高达300Kbps
|
||||
- 内置柔性PCB天线
|
||||
- 外部天线接口
|
||||
- 开发平台: Arduino, Micropython, UIFlow(Blockly)
|
||||
- 产品尺寸:54.2mm x 54.2mm x 12.8mm
|
||||
- 产品重量:14.5g
|
||||
|
||||
## 包含
|
||||
|
||||
- 1x M5Stack LoRa868 模块
|
||||
|
||||
## 应用
|
||||
|
||||
- 自动抄表系统
|
||||
- 楼宇自动化
|
||||
- 远程灌溉系统
|
||||
|
||||
## 相关链接
|
||||
|
||||
- **[LoRa模块信息](http://wiki.ai-thinker.com/lora) (LoRa)**
|
||||
|
||||
- **[LoRaWAN 区域参数](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/module/lorawantm_regional_parameters_v1.1rb_-_final.pdf)**
|
||||
|
||||
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Module/EasyLoader_LORA868_Duplex.exe"><button type="button" class="btn btn-primary">点击下载EasyLoader</button></a>
|
||||
|
||||
>1.EasyLoader是一个简洁快速的程序烧录器,每一个产品页面里的EasyLoader都提供了一个与产品相关的案例程序,通过简单步骤将其烧录至主控,能够进行一系列的功能验证.**(目前EasyLoader仅适用于Windows操作系统)**
|
||||
|
||||
>2.下载软件后,双击运行应用程序,将M5设备通过数据线连接至电脑,选择端口参数,点击 **"Burn"** 即可开始烧录
|
||||
|
||||
!>3.EasyLoader烧录前需要安装有CP210X(USB驱动程序),[点击此处查看驱动安装教程](zh_CN/related_documents/M5Burner#安装串口驱动)
|
||||
|
||||
## 例程
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
在本案例中,将使用两个LoRa868模块分别进行发送与接收消息.实现点对点的通信功能.
|
||||
|
||||
* 蓝色字符串表示发送成功.
|
||||
|
||||
* 黄色字符串显示收到的消息.
|
||||
|
||||
* 红色字符串表示初始化失败.
|
||||
|
||||
*以下代码仅为片段,如需获取完整代码, [请点击此处.](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LORA868/Arduino)*
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
#include <M5LoRa.h>
|
||||
|
||||
//declaration
|
||||
String outgoing; // outgoing message
|
||||
byte msgCount = 0; // count of outgoing messages
|
||||
byte localAddress = 0xBB; // address of this device
|
||||
byte destination = 0xFF; // destination to send to
|
||||
|
||||
//initialization
|
||||
M5.begin();
|
||||
LoRa.setPins(); // set CS, reset, IRQ pin
|
||||
LoRa.begin(868E6); // initialize ratio at 868 MHz
|
||||
|
||||
//send message
|
||||
void sendMessage(String outgoing) {
|
||||
LoRa.beginPacket(); // start packet
|
||||
LoRa.write(destination); // add destination address
|
||||
LoRa.write(localAddress); // add sender address
|
||||
LoRa.write(msgCount); // add message ID
|
||||
LoRa.write(outgoing.length()); // add payload length
|
||||
LoRa.print(outgoing); // add payload
|
||||
LoRa.endPacket(); // finish packet and send it
|
||||
msgCount++; // increment message ID
|
||||
}
|
||||
|
||||
//receive message
|
||||
void onReceive(int packetSize) {
|
||||
if (packetSize == 0) return; // if there's no packet, return
|
||||
int recipient = LoRa.read(); // recipient address
|
||||
byte sender = LoRa.read(); // sender address
|
||||
byte incomingMsgId = LoRa.read(); // incoming msg ID
|
||||
byte incomingLength = LoRa.read(); // incoming msg length
|
||||
|
||||
String incoming = "";
|
||||
|
||||
while (LoRa.available()) {
|
||||
incoming += (char)LoRa.read();
|
||||
}
|
||||
}
|
||||
|
||||
onReceive(LoRa.parsePacket());
|
||||
```
|
||||
|
||||
<img src="assets/img/product_pics/module/module_example/LORA/example_module_lora868_02.png">
|
||||
|
||||
## 原理图
|
||||
|
||||
<img src="assets/img/product_pics/module/lora_sch.png">
|
||||
Reference in New Issue
Block a user