The QSentinel Loten Protocol is a new network layer protocol designed to work on top of the ESP-NOW protocol. It addresses the limitations of the ESP-NOW protocol, such as the payload size limitation of only 250 bytes and the lack of secure and efficient encryption. Loten Protocol provides a solution to these issues, offering enhanced payload size, improved security, and faster encryption.
- Increased payload size support
- Enhanced security with efficient encryption
- Compatible with ESP-NOW protocol
- Easy integration with existing projects
This is the beta release of the QSentinel Loten Protocol. In this version, we have focused on solving the payload size limitation and improving encryption. It's important to note that this version is still in the testing phase and may contain bugs.
-
Peer-to-Peer (P2P) Connection: ESP-NOW enables direct communication between ESP32 devices, eliminating the routing overhead associated with traditional Wi-Fi networks.
-
Lightweight and Efficient: Designed for resource-constrained devices, ESP-NOW has a minimal footprint, making it well-suited for ESP32 microcontrollers with limited resources.
-
Low-Latency Data Transmission: By sidestepping routing delays, ESP-NOW facilitates rapid data exchange between connected devices, ideal for real-time applications requiring swift responsiveness.
- Sensor Networks: Efficiently collect data from multiple sensors to a central ESP32 device.
- Industrial Automation: Enable real-time control and communication between devices in industrial environments.
- Smart Home Automation: Facilitate low-latency communication between smart home devices for tasks like lighting control or appliance management.
- Drone Communication: Ensure reliable data exchange between drones and ground control units.
In the upcoming version, we plan to introduce a master-slave communication API, providing more flexibility and functionality to the protocol.
We welcome contributions from the community! If you have any suggestions, bug fixes, or feature requests, please open an issue or submit a pull request.
To use the Loten Protocol in your project, follow these steps:
- Install
esp_now
andAESLib
libraries. - Set up the data receiving callback function using
setProcessReceivedDataCallback(userProcessReceivedData)
. - Initialize the protocol using
lotenInit(destMacList)
. Provide a list of destination MAC addresses (destMacList
) in the setup function.
// Example Usage
#include "loten.h"
typedef struct hi {
int temp[100];
} hi;
// Define the data receiving callback function
void userProcessReceivedData(const uint8_t* data, uint16_t length) {
// Your custom data processing logic here
Serial.println("User defined received data:");
if (length != sizeof(hi)) {
Serial.println("Received data length does not match hi structure size");
return;
}
hi receivedData;
memcpy(&receivedData, data, sizeof(hi));
for (int i = 0; i < 100; i++) {
Serial.println(receivedData.temp[i]);
}
}
void setup() {
// Initialize serial communication
Serial.begin(115200);
// call back function prototype
// void (*ProcessReceivedDataFunc)(const uint8_t* data, uint16_t length);
// Install ESP-NOW libraries and set up callback function
setProcessReceivedDataCallback(userProcessReceivedData);
// Initialize Loten Protocol with destination MAC list
uint8_t destMacList[MAX_CONNECTIONS][6] = {
{0xB0, 0xB2, 0x1C, 0xB1, 0xD1, 0xA8},
{0xB0, 0xB2, 0x1C, 0xB1, 0xD2, 0xA4}
};
//prototype -> void lotenInit(uint8_t macList[][6], uint16_t prime_modulusc = DEFAULT_PRIME_MODULUS);
//it is recommend to use a large prime number as the prime modulus
lotenInit(destMacList);
}
void loop() {
// Your loop code here
// Example data sending
hi data;
for (int i = 0; i < 100; i++) {
data.temp[i] = i + 1;
}
//prototype -> void lotenSend(const void *data, size_t dataSize, const uint8_t *destMac, bool encrypted);
//encryption is optional
lotenSend(&data, sizeof(data), destMacList[0], true);
}