esp_netif_lora/README.md

37 lines
871 B
Markdown
Raw Normal View History

2023-12-30 00:11:43 -05:00
# `esp_netif_lora`
2023-12-28 21:14:40 -05:00
An ESP-NETIF driver for ESP-Now
# usage
Installing this on two devices with LwIP debugging turned up and you will see packets being exchanged.
This could also be the basis for using any other system that is capable of using LwIP.
Install with
```
2023-12-30 00:11:43 -05:00
git clone https://git.oit.cloud/morgan/esp_netif_lora/ components/esp_netif_lora
2023-12-28 21:14:40 -05:00
```
## complete example
```
#include "esp_mac.h"
#include "esp_wifi.h"
#include "nvs_flash.h"
2023-12-30 00:11:43 -05:00
#include "esp_netif_lora.h"
2023-12-28 21:14:40 -05:00
void app_main() {
2023-12-30 00:11:43 -05:00
esp_netif_lora_config_t config;
2023-12-28 21:14:40 -05:00
esp_efuse_mac_get_default((uint8_t*)&config.mac);
2023-12-30 00:11:43 -05:00
esp_netif_set_ip4_addr(&config.ip_info.ip, 10, 20 , 0, config.mac[5]);
esp_netif_set_ip4_addr(&config.ip_info.gw, 10, 20 , 0, 1);
2023-12-28 21:14:40 -05:00
esp_netif_set_ip4_addr(&config.ip_info.netmask, 255, 255 , 255, 0);
2023-12-30 00:11:43 -05:00
esp_log_level_set("LoRa32", ESP_LOG_INFO);
esp_netif_lora_init(&config);
2023-12-28 21:14:40 -05:00
}
```