163 lines
5.1 KiB
Markdown
163 lines
5.1 KiB
Markdown
# LoRaWAN Sensor HT-CT62
|
|
|
|
A LoRaWAN communication project for Heltec HT-CT62 devices, featuring two Arduino sketch implementations for wireless sensor data transmission.
|
|
|
|
## Overview
|
|
|
|
This project provides LoRaWAN connectivity solutions for the Heltec HT-CT62 device, supporting both basic and advanced communication modes. The system enables remote sensor monitoring through LoRaWAN networks with configurable parameters and multiple authentication methods.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
├── LoRaWan/ # Basic LoRaWAN implementation
|
|
│ └── LoRaWan.ino # Simple LoRaWAN communication sketch
|
|
├── LoRaWanNode/ # Advanced LoRaWAN node implementation
|
|
│ └── LoRaWanNode.ino # Feature-rich node with serial commands
|
|
├── HT-CT62(Rev1.1).pdf # Device datasheet and technical documentation
|
|
└── README.md # This file
|
|
```
|
|
|
|
## Features
|
|
|
|
### Basic Implementation (LoRaWan/)
|
|
- Standard LoRaWAN Class A communication
|
|
- OTAA (Over-The-Air Activation) support
|
|
- Mock data transmission for testing
|
|
- 15-second transmission intervals
|
|
- Confirmed message transmission
|
|
|
|
### Advanced Implementation (LoRaWanNode/)
|
|
- Enhanced LoRaWAN Class C communication
|
|
- Serial command interface for real-time control
|
|
- EEPROM storage for persistent configuration
|
|
- Debug mode with detailed logging
|
|
- Dynamic payload management
|
|
- Remote device restart capability
|
|
- Runtime App EUI and App Key modification
|
|
|
|
## Hardware Requirements
|
|
|
|
- **Device**: Heltec HT-CT62 (Rev 1.1 or later)
|
|
- **Connectivity**: LoRaWAN gateway within range
|
|
- **Development**: Arduino IDE with Heltec board support
|
|
|
|
## Software Requirements
|
|
|
|
- Arduino IDE
|
|
- Heltec ESP32 board package
|
|
- LoRaWAN library for Heltec devices
|
|
|
|
## Configuration
|
|
|
|
### Network Parameters
|
|
|
|
The project supports both OTAA and ABP activation methods:
|
|
|
|
#### OTAA Configuration
|
|
```cpp
|
|
uint8_t devEui[] = {0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x06, 0x53, 0xC8};
|
|
uint8_t appEui[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
|
uint8_t appKey[] = {0x74, 0xD6, 0x6E, 0x63, 0x45, 0x82, 0x48, 0x27, 0xFE, 0xC5, 0xB7, 0x70, 0xBA, 0x2B, 0x50, 0x45};
|
|
```
|
|
|
|
#### Regional Settings
|
|
- **Default Region**: Configurable via Arduino IDE tools
|
|
- **Channel Mask**: Channels 0-7 enabled by default
|
|
- **Data Rate**: DR3 (configurable)
|
|
|
|
### Advanced Node Serial Commands
|
|
|
|
The advanced implementation supports real-time commands via serial interface:
|
|
|
|
| Command | Format | Description |
|
|
|---------|--------|-------------|
|
|
| `1` + data | `1Hello World` | Send custom data payload |
|
|
| `2` | `2` | Restart the device |
|
|
| `3` + 8 bytes | `3XXXXXXXX` | Change App EUI |
|
|
| `4` + 16 bytes | `4XXXXXXXXXXXXXXXX` | Change App Key |
|
|
|
|
## Installation and Setup
|
|
|
|
1. **Install Arduino IDE** with Heltec ESP32 support
|
|
2. **Clone/Download** this repository
|
|
3. **Open** desired sketch (`LoRaWan.ino` or `LoRaWanNode.ino`)
|
|
4. **Configure** LoRaWAN parameters for your network
|
|
5. **Select** correct board and region in Arduino IDE
|
|
6. **Upload** the sketch to your HT-CT62 device
|
|
|
|
## Usage
|
|
|
|
### Basic Implementation
|
|
1. Power on the device
|
|
2. Monitor serial output for connection status
|
|
3. Device will automatically join the network and transmit data every 15 seconds
|
|
|
|
### Advanced Implementation
|
|
1. Power on and monitor serial output
|
|
2. Send commands via serial interface for real-time control:
|
|
```
|
|
1sensor_data_123 # Send sensor data
|
|
2 # Restart device
|
|
3APPEUI01 # Set new App EUI
|
|
4APPKEY1234567890AB # Set new App Key
|
|
```
|
|
|
|
## Debug Mode
|
|
|
|
Enable debug output in the advanced implementation:
|
|
```cpp
|
|
#define DEBUG_MODE 1 // Set to 1 to enable debug messages
|
|
```
|
|
|
|
## Transmission Settings
|
|
|
|
- **Duty Cycle**: 15 seconds (configurable)
|
|
- **Confirmed Messages**: Enabled
|
|
- **Retry Attempts**: 4 attempts with adaptive data rate
|
|
- **Application Port**: 2
|
|
- **Max Payload**: 32 bytes
|
|
|
|
## Technical Specifications
|
|
|
|
- **Device Class**: A (basic) / C (advanced)
|
|
- **Activation**: OTAA preferred, ABP supported
|
|
- **ADR**: Adaptive Data Rate enabled
|
|
- **Regional Support**: Multiple regions via Arduino IDE configuration
|
|
|
|
## Troubleshooting
|
|
|
|
### Common Issues
|
|
1. **Join Failed**: Check devEui, appEui, and appKey configuration
|
|
2. **No Gateway**: Ensure LoRaWAN gateway is within range
|
|
3. **Region Mismatch**: Verify region settings match your location
|
|
4. **Payload Too Large**: Keep data payload ≤ 32 bytes
|
|
|
|
### Debug Steps
|
|
1. Enable debug mode in advanced implementation
|
|
2. Monitor serial output for detailed logs
|
|
3. Verify network credentials with your LoRaWAN provider
|
|
4. Check regional frequency plan compatibility
|
|
|
|
## License
|
|
|
|
This project is based on Heltec Automation examples and follows their licensing terms.
|
|
|
|
## Contributing
|
|
|
|
1. Fork the repository
|
|
2. Create a feature branch
|
|
3. Commit your changes
|
|
4. Push to the branch
|
|
5. Create a Pull Request
|
|
|
|
## Support
|
|
|
|
- **Heltec Documentation**: https://www.heltec.org
|
|
- **LoRaWAN Specification**: LoRaWAN 1.0.2+
|
|
- **Hardware Manual**: See `HT-CT62(Rev1.1).pdf` for detailed specifications
|
|
|
|
---
|
|
|
|
**Manufacturer**: Heltec Automation
|
|
**Website**: www.heltec.org
|
|
**Device**: HT-CT62 LoRaWAN Sensor Node |