start:arduino:esp32b:lora
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| start:arduino:esp32b:lora [2021/03/24 14:24] – créée gerardadmin | start:arduino:esp32b:lora [2023/01/27 16:08] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ======== Esp32 - Lora ======== | ======== Esp32 - Lora ======== | ||
| + | |||
| + | {{ : | ||
| ESP32 (32 bits, 2 cores, 180 MHz) | ESP32 (32 bits, 2 cores, 180 MHz) | ||
| - | Connectivity | + | |
| - | WiFi | + | |
| - | BLE | + | |
| - | LoRa (SX1276) 433MHz, 868MHz, 915MHz | + | |
| + | |||
| + | ==== Brochage ESP32 Lora ==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ==== Liens web==== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | |||
| + | ====Configuration==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ==Programmes== | ||
| + | |||
| + | **Carte1 (envoi)** | ||
| + | |||
| + | Ouvrer et televerser le programme : Examples > LoRaLibrary > OLED_LoRa_Sender | ||
| + | |||
| + | |||
| + | **Carte 2 (Reception)** | ||
| + | |||
| + | Ouvrer et televerser le programme : Examples > LoRaLibrary > OLED_LoRa__Receiver | ||
| + | |||
| + | |||
| + | **Ajouter la configuration | ||
| + | |||
| + | Ajoutez les déclarations suivantes dans les 2 programmes. | ||
| + | |||
| + | <code c Lorawanconf.ino> | ||
| + | |||
| + | |||
| + | ... | ||
| + | |||
| + | // LoRa API https:// | ||
| + | |||
| + | // LoRaWAN Parameters | ||
| + | #define BAND 868100000 | ||
| + | #define PABOOST false | ||
| + | #define TXPOWER 14 | ||
| + | #define SPREADING_FACTOR 12 | ||
| + | #define BANDWIDTH 125000 | ||
| + | #define CODING_RATE 5 | ||
| + | #define PREAMBLE_LENGTH 8 | ||
| + | #define SYNC_WORD 0x34 | ||
| + | |||
| + | void configForLoRaWAN() | ||
| + | { | ||
| + | LoRa.setTxPower(TXPOWER); | ||
| + | LoRa.setSpreadingFactor(SPREADING_FACTOR); | ||
| + | LoRa.setSignalBandwidth(BANDWIDTH); | ||
| + | LoRa.setCodingRate4(CODING_RATE); | ||
| + | LoRa.setPreambleLength(PREAMBLE_LENGTH); | ||
| + | LoRa.setSyncWord(SYNC_WORD); | ||
| + | LoRa.crc(); | ||
| + | } | ||
| + | |||
| + | String loraCfg = " | ||
| + | void displayLoRaConfig(int x, int y){ | ||
| + | loraCfg = | ||
| + | "fr " + String(BAND/ | ||
| + | + " sf" + String(SPREADING_FACTOR, | ||
| + | + " bw" + String(BANDWIDTH/ | ||
| + | + " cr" + String(CODING_RATE, | ||
| + | display.drawString(x, | ||
| + | loraCfg = | ||
| + | + " pr" + String(PREAMBLE_LENGTH, | ||
| + | + " pw" + String(TXPOWER, | ||
| + | + " sw" + String(SYNC_WORD, | ||
| + | ; | ||
| + | display.drawString(x, | ||
| + | } | ||
| + | |||
| + | ... | ||
| + | |||
| + | // should be done before LoRa.begin | ||
| + | configForLoRaWAN(); | ||
| + | |||
| + | if (!LoRa.begin(BAND, | ||
| + | display.drawString(0, | ||
| + | display.display(); | ||
| + | while (1); | ||
| + | } | ||
| + | displayLoRaConfig(0, | ||
| + | display.drawString(0, | ||
| + | |||
| + | ... | ||
| + | |||
| + | display.display(); | ||
| + | ... | ||
| - | Links | ||
| - | [[https:// | + | </code> |
| - | [[https:// | + | |
| - | [[https:// | + | |
/home/chanteri/www/fablab37110/data/attic/start/arduino/esp32b/lora.1616592299.txt.gz · Dernière modification : (modification externe)
