{"id":18837035,"url":"https://github.com/xreef/ebyte_lora_e22_series_library","last_synced_at":"2026-02-25T23:06:08.089Z","repository":{"id":48593480,"uuid":"297445439","full_name":"xreef/EByte_LoRa_E22_Series_Library","owner":"xreef","description":"Arduino LoRa EBYTE E22 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico (rp2040 boards).. sx1262/sx1268","archived":false,"fork":false,"pushed_at":"2023-01-28T16:46:54.000Z","size":2707,"stargazers_count":123,"open_issues_count":2,"forks_count":26,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-01T12:09:18.842Z","etag":null,"topics":["10km","arduino","arduino-library","arduino-samd-boards","e22","ebyte","esp32","esp8266","lora","pico","raspberry-pi","rp2040","stm32","sx1262","sx1268"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xreef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-21T19:50:49.000Z","updated_at":"2025-05-22T18:48:56.000Z","dependencies_parsed_at":"2023-02-15T17:46:10.051Z","dependency_job_id":null,"html_url":"https://github.com/xreef/EByte_LoRa_E22_Series_Library","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/xreef/EByte_LoRa_E22_Series_Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_Series_Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_Series_Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_Series_Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_Series_Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xreef","download_url":"https://codeload.github.com/xreef/EByte_LoRa_E22_Series_Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_Series_Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["10km","arduino","arduino-library","arduino-samd-boards","e22","ebyte","esp32","esp8266","lora","pico","raspberry-pi","rp2040","stm32","sx1262","sx1268"],"created_at":"2024-11-08T02:33:23.332Z","updated_at":"2026-02-25T23:06:08.070Z","avatar_url":"https://github.com/xreef.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\u003cdiv\u003e\r\n\u003ca href=\"https://www.mischianti.org/forums/forum/mischiantis-libraries/ebyte-lora-e22-uart-devices-sx1262-sx1268//\"\u003e\u003cimg\r\n  src=\"https://github.com/xreef/LoRa_E32_Series_Library/raw/master/resources/buttonSupportForumEnglish.png\" alt=\"Support forum EByte e32 English\"\r\n   align=\"right\"\u003e\u003c/a\u003e\r\n\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\u003ca href=\"https://www.mischianti.org/it/forums/forum/le-librerie-di-mischianti/ebyte-e22-dispositivi-lora-uart-sx1262-sx1268/\"\u003e\u003cimg\r\n  src=\"https://github.com/xreef/LoRa_E32_Series_Library/raw/master/resources/buttonSupportForumItaliano.png\" alt=\"Forum supporto EByte e32 italiano\"\r\n  align=\"right\"\u003e\u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n#\r\n\r\n\r\n# Soon a complete tutorial on my site www.mischianti.org\r\n\r\n - [Ebyte LoRa E22 device for Arduino, esp32 or esp8266: settings and basic usage](https://www.mischianti.org/2020/09/25/ebyte-lora-e22-device-for-arduino-esp32-or-esp8266-specs-and-basic-usage-1/)\r\n - [Ebyte LoRa E22 device for Arduino, esp32 or esp8266: library](https://www.mischianti.org/2021/01/28/ebyte-lora-e22-device-for-arduino-esp32-or-esp8266-library-part-2/)\r\n - [Ebyte LoRa E22 device for Arduino, esp32 or esp8266: configuration](https://www.mischianti.org/2022/03/29/ebyte-lora-e22-device-for-arduino-esp32-or-esp8266-configuration-3/)\r\n - [Ebyte LoRa E22 device for Arduino, esp32 or esp8266: fixed transmission and RSSI](https://www.mischianti.org/2022/04/04/ebyte-lora-e22-device-for-arduino-esp32-or-esp8266-fixed-transmission-broadcast-monitor-and-rssi-4/)\r\n - [Ebyte LoRa E22 device for Arduino, esp32 or esp8266: power saving and sending structured data](https://www.mischianti.org/2022/04/10/ebyte-lora-e22-device-for-arduino-esp32-or-esp8266-power-saving-wor-and-structured-data-5/)\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and Arduino shield\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and WeMos D1 shield\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and esp32 dev v1 shield\r\n\r\n\r\n## Changelog\r\n- 2023-01-28 1.0.9 Fix UART_PARITY for ESP32 C3 [Forum](https://www.mischianti.org/forums/topic/problems-including-library/)\r\n- 2022-09-19 1.0.8 Fix stm32 rogerclerk library https://github.com/xreef/LoRa_E32_Series_Library/pull/48\r\n- 2022-03-14 1.0.7 Fix frequencies\r\n- 2022-03-14 1.0.6 Fix support for STM32\r\n- 2022-03-14 1.0.5 Fix UART baud rate variable limit\r\n- 2022-02-23 1.0.4 Add Arduino NANO 33 BLE support and minor change\r\n- 2022-02-03 1.0.3 Fix file example length\r\n- 2022-01-24 1.0.2 Memory leak fix and adjustment\r\n- 2021-12-22 1.0.1 Fix on keywork and change DEBUG_PRINTLN on example with Serial And tested Arduino MKR WiFi 1010 and Arduino Nano 33 IoT\r\n\r\nhttps://downloads.arduino.cc/libraries/logs/github.com/xreef/EByte_LoRa_E22_Series_Library/\r\n\r\n# An Arduino UNO shield to simplify the use\r\n![Arduino UNO shield](https://www.mischianti.org/wp-content/uploads/2019/12/ArduinoShieldMountedE32LoRa_min.jpg)\r\n\r\nYou can order the PCB  [here](https://www.pcbway.com/project/shareproject/LoRa_E32_Series_device_Arduino_shield.html) \r\n\r\nInstruction and assembly video on 6 part of the guide\r\n\r\n# An WeMos D1 shield to simplify the use\r\n![Arduino UNO shield](https://www.mischianti.org/wp-content/uploads/2020/01/WeMosD1ShieldMountedE32LoRa_min.jpg)\r\n\r\nYou can order the PCB  [here](https://www.pcbway.com/project/shareproject/LoRa_E32_Series_device_WeMos_D1_mini_shield_RF_8km_range.html) \r\n\r\nInstruction and assembly video on 6 part of the guide\r\n\r\n\r\n\r\n# LoRa E22 (EBYTE LoRa sx1262/sx1268) series Library for Arduino, esp8266 and esp32-\r\n\r\nI create a library to manage EBYTE E22 series of LoRa device, very powerfull, simple and cheap device.\r\n\r\nLoRa or Long Range wireless data telemetry is a technology pioneered by Semtech that operates at a lower frequency than NRF24L01 (433 MHz, 868 MHz or 916 MHz agains 2.4 GHz for the NRF24L01) but at thrice the distance (from 4000m to 10000m).\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2020/08/Ebyte-LoRa-E22-device-for-Arduino-esp32-or-esp8266-3-devices-module-SMD-768x439.jpg)\r\n\r\nLoRa E22\r\n\r\n\u003cp\u003eYou can find here \u003ca href=\"https://s.click.aliexpress.com/e/_dSqbrK5\" target=\"_blank\"\u003eAliExpress (433MHz 4Km)\u003c/a\u003e - \u003ca href=\"https://s.click.aliexpress.com/e/_dTTkQtn\" target=\"_blank\"\u003eAliExpress (433MHz 10Km)\u003c/a\u003e\u003c/p\u003e\r\n\r\nPlease refer to my article to get updated Schema\r\n\r\n### Library\r\n\r\nYou can find my library here.\r\n\r\nTo download.\r\n\r\nClick the DOWNLOADS button in the top right corner, rename the uncompressed folder LoRa_E22.\r\n\r\nCheck that the LoRa_E22 folder contains LoRa_E22.cpp and LoRa_E22.h.\r\n\r\nPlace the LoRa_E22 library folder your /libraries/ folder.\r\n\r\nYou may need to create the libraries subfolder if its your first library.\r\n\r\nRestart the IDE.\r\n\r\n#### Pinout\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/09/sx1278-sx1276-wireless-lora-uart-module-serial-3000m-arduino-433-rf-robotedu-1705-13-robotedu@101.jpg)\r\n\r\nE22 \r\n\r\n\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend is-style-stripes\" style=\"border-collapse:collapse\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth style=\"background-color:#8ed1fc\"\u003ePin No. \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e Pin item \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e Pin direction \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e Pin application \u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003eM0\u003c/td\u003e\u003ctd\u003eInput（weak pull-up）\u003c/td\u003e\u003ctd\u003eWork with M1 \u0026amp; decide the four operating modes.Floating is not allowed, can be ground.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e2\u003c/td\u003e\u003ctd\u003eM1\u003c/td\u003e\u003ctd\u003eInput（weak pull-up）\u003c/td\u003e\u003ctd\u003eWork with M0 \u0026amp; decide the four operating modes.Floating is not allowed, can be ground.\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e3\u003c/td\u003e\u003ctd\u003eRXD\u003c/td\u003e\u003ctd\u003eInput\u003c/td\u003e\u003ctd\u003eTTL UART inputs, connects to external (MCU, PC) TXD outputpin. Can be configured as open-drain or pull-up input.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e4\u003c/td\u003e\u003ctd\u003eTXD\u003c/td\u003e\u003ctd\u003eOutput\u003c/td\u003e\u003ctd\u003eTTL UART outputs, connects to external RXD (MCU, PC) inputpin. Can be configured as open-drain or push-pull output\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e\u003cbr\u003e5\u003c/td\u003e\u003ctd\u003e\u003cbr\u003eAUX\u003c/td\u003e\u003ctd\u003e\u003cbr\u003eOutput\u003c/td\u003e\u003ctd\u003ePer indicare lo stato di funzionamento del modulo e riattivare l’MCU esterno. Durante la procedura di inizializzazione di autocontrollo, il pin emette una bassa tensione. Può essere configurato come uscita open-drain o output push-pull (è consentito non metterlo a terra, ma se hai problemi, ad esempio ti si freeze il dispositivo è preferibile mettere una restistenza di pull-up da 4.7k o meglio collegarlo al dispositivo).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e6\u003c/td\u003e\u003ctd\u003eVCC\u003c/td\u003e\u003ctd\u003e\u003cbr\u003e\u003c/td\u003e\u003ctd style=\"vertical-align:middle\"\u003ePower supply 2.3V~5.5V DC\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e7\u003c/td\u003e\u003ctd\u003eGND\u003c/td\u003e\u003ctd\u003e\u003cbr\u003e\u003c/td\u003e\u003ctd\u003eGround\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nAs you can see you can set various modes via M0 and M1 pins.\r\n\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend is-style-stripes\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e\u003cstrong\u003eMode\u003c/strong\u003e \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e\u003cstrong\u003eM1\u003c/strong\u003e \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e\u003cstrong\u003eM0\u003c/strong\u003e \u003c/th\u003e\u003cth style=\"background-color:#8ed1fc\"\u003e\u003cstrong\u003eExplanation\u003c/strong\u003e \u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eNormal\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003eUART and wireless channel are open, transparent transmission is on (Supports configuration over air via special command)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eWOR Mode\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003eCan be defined as WOR transmitter and WOR receiver\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eConfiguration mode\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003eUsers can access the register through the serial port to\r\ncontrol the working state of the module\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eDeep sleep mode\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003eSleep mode\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nAs you can see there are some pins that can be use in a static way, but If you connect It to the library you gain in performance and you can control all mode via software, but we are going to explain better next.\r\n\r\n### Fully connected schema\r\n\r\nAs I already say It’s not important to connect all pin to the output of microcontroller, you can put M0 and M1 pins to HIGH or LOW to get desidered configuration, and  **if you don’t connect AUX the library set a reasonable delay to be sure that the operation is complete**.\r\n\r\n#### AUX pin\r\n\r\nWhen transmitting data can be used to wake up external MCU and return HIGH on data transfer finish.\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnTransmission-1024x269.jpg)\r\n\r\nLoRa E22 AUX Pin on transmission\r\n\r\nWhen receiving AUX going LOW and return HIGH when buffer is empty.\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnReception-1024x342.jpg)\r\n\r\nLoRa e22 AUX pin on reception\r\n\r\nIt’s also used for self checking to restore normal operation (on power-on and sleep/program mode).\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnSelfCheck-1024x312.jpg)\r\n\r\nLoRa e22 AUX pin on self-check\r\n\r\nesp8266 connection schema is more simple because It work at the same voltage of logical communications (3.3v).\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32-TTL-100_WemosD1_VD_PU_FullyConnected_bb-e1570517387323-768x560.jpg)\r\n\r\nLoRa E22 TTL 100 Wemos D1 fully connected\r\n\r\nIt’s important to add pull-up resistor (4,7Kohm) to get good stability.\r\n\r\n\u003cfigure class=\"wp-block-table is-style-stripes\"\u003e\u003ctable\u003e\u003cthead\u003e\u003ctr class=\"alt\"\u003e\u003cth\u003eE22\u003c/th\u003e\u003cth\u003eesp8266\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003eM0\u003c/td\u003e\u003ctd\u003eD7\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eM1\u003c/td\u003e\u003ctd\u003eD6\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eTX\u003c/td\u003e\u003ctd\u003ePIN D2 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eRX\u003c/td\u003e\u003ctd\u003ePIN D3 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eAUX\u003c/td\u003e\u003ctd\u003ePIN D5 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eVCC\u003c/td\u003e\u003ctd\u003e5V (but work with less power in 3.3v)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eGND\u003c/td\u003e\u003ctd\u003eGND\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/figure\u003e\r\n\r\nSimilar connection schema for esp32, but for RX and TX we use RX2 and TX2, because by default esp32 doesn’t have SoftwareSerial but have 3 Serial.\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2020/08/Ebyte-LoRa-E22-device-esp32-dev-kit-v1-breadboard-full-connection-768x668.jpg)\r\n\r\nEbyte LoRa E22 device esp32 dev kit v1 breadboard full connection\r\n\r\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003eE22\u003c/th\u003e\u003cth\u003eesp32\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eM0\u003c/td\u003e\u003ctd\u003eD21\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eM1\u003c/td\u003e\u003ctd\u003eD19\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eTX\u003c/td\u003e\u003ctd\u003ePIN RX2 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eRX\u003c/td\u003e\u003ctd\u003ePIN TX3 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eAUX\u003c/td\u003e\u003ctd\u003ePIN D18 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eVCC\u003c/td\u003e\u003ctd\u003e5V (but work with less power in 3.3v)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eGND\u003c/td\u003e\u003ctd\u003eGND\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nArduino working voltage is 5v, so we need to add a voltage divider on RX pin M0 and M1 of LoRa module to prevent damage, you can get more information here  [Voltage divider: calculator and application](https://www.mischianti.org/2019/06/15/voltage-divider-calculator-and-application/).\r\n\r\nYou can use a 2Kohm resistor to GND and 1Kohm from signal than put together on RX.\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32-TTL-100_Arduino_VD_PU_FullyConnected_bb-e1570517268668.jpg)\r\n\r\nLoRa E22 TTL 100 Arduino fully connected\r\n\r\n\u003ctable\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eM0\u003c/td\u003e\u003ctd\u003e7 (voltage divider)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eM1\u003c/td\u003e\u003ctd\u003e6 (voltage divider)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eTX\u003c/td\u003e\u003ctd\u003ePIN 2 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eRX\u003c/td\u003e\u003ctd\u003ePIN 3 (PullUP 4,7KΩ \u0026amp; Voltage divider)\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eAUX\u003c/td\u003e\u003ctd\u003ePIN 5 (PullUP 4,7KΩ)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eVCC\u003c/td\u003e\u003ctd\u003e5V\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003eGND\u003c/td\u003e\u003ctd\u003eGND\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\n## Constructor\r\n\r\nI made a set of quite numerous constructors, because we can have more options and situations to manage.\r\n\r\n```cpp\r\nLoRa_E22(byte rxPin, byte txPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\n\r\nLoRa_E22(byte rxPin, byte txPin, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\n\r\nLoRa_E22(byte rxPin, byte txPin, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\n```\r\n\r\nFirst set of constructor are create to delegate the manage of Serial and other pins to the library.\r\n\r\n\u003cul\u003e\u003cli\u003e\u003ccode\u003etxE22pin\u003c/code\u003e and \u003ccode\u003erxE22pin\u003c/code\u003e is the pin to connect to UART and they are \u003cstrong\u003emandatory\u003c/strong\u003e.\u003c/li\u003e\u003cli\u003e\u003ccode\u003eauxPin \u003c/code\u003eis a pin that check the operation, transmission and receiving status (we are going to explain better next), that pin \u003cstrong\u003eIt isn’t mandatory\u003c/strong\u003e, if you don’t set It I apply a delay to permit the operation to complete itself (with latency,  i\u003cstrong\u003ef you have trouble, like freeze device, you must put a pull-up 4.7k resistor or better connect to the device\u003c/strong\u003e ).\u003c/li\u003e\u003cli\u003e\u003ccode\u003em0pin \u003c/code\u003eand \u003ccode\u003em1Pin \u003c/code\u003eare the pins to change operation MODE (see the table upper), I think \u003cstrong\u003ethis pins in “production” are going to connect directly HIGH or LOW\u003c/strong\u003e, but for test they are usefully to be managed by the library.\u003c/li\u003e\u003cli\u003e\u003ccode\u003ebpsRate \u003c/code\u003eis the boudrate of SoftwareSerial normally is 9600 (the only baud rate in programmin/sleep mode)\u003c/li\u003e\u003c/ul\u003e\r\n\r\nA simple example is\r\n\r\n```cpp\r\n#include \"LoRa_E22.h\"\r\nLoRa_E22 e22ttl100(2, 3); // RX, TX\r\n// LoRa_E22 e22ttl100(2, 3, 5, 6, 7); // RX, TX\r\n```\r\n\r\nWe can use directly a SoftwareSerial with another constructor\r\n\r\n```cpp\r\nLoRa_E22(HardwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\nLoRa_E22(HardwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\nLoRa_E22(HardwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\n```\r\n\r\nThe example upper with this constructor can be do like so.\r\n\r\n```cpp\r\n#include \u003cSoftwareSerial.h\u003e\r\n#include \"LoRa_E22.h\"\r\nSoftwareSerial mySerial(2, 3); // RX, TX\r\nLoRa_E22 e22ttl100(mySerial);\r\n// LoRa_E22 e22ttl100(\u0026amp;mySerial, 5, 7, 6);\r\n```\r\n\r\nThe last set of constructor is to permit to use an HardwareSerial instead of SoftwareSerial.\r\n\r\n```cpp\r\nLoRa_E22(SoftwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\nLoRa_E22(SoftwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\nLoRa_E22(SoftwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);\r\n```\r\n\r\n## Begin\r\n\r\nThe begin command is used to startup Serial and pins in input and output mode.\r\n\r\n```cpp\r\nvoid begin();\r\n```\r\n\r\nin execution is\r\n\r\n```cpp\r\n// Startup all pins and UART\r\ne22ttl100.begin();\r\n```\r\n\r\n### Configuration and information method\r\n\r\nThere a set of methods for manage configuration and get information of the device.\r\n\r\n```cpp\r\nResponseStructContainer getConfiguration();\r\nResponseStatus setConfiguration(Configuration configuration, PROGRAM_COMMAND saveType = WRITE_CFG_PWR_DWN_LOSE);\r\nResponseStructContainer getModuleInformation();\r\nvoid printParameters(struct Configuration configuration);\r\n```\r\n\r\n#### Response container\r\n\r\nTo simplify the manage of response I create a set of container, for me very usefully to manage errors and return generic data.\r\n\r\n##### ResponseStatus\r\n\r\nThis is a status container and have 2 simple entry point, with this you can get the status code and the description of status code\r\n\r\n```cpp\r\nSerial.println(c.getResponseDescription()); // Description of code\r\nSerial.println(c.code); // 1 if Success\r\n```\r\n\r\nThe code are\r\n\r\n```cpp\r\nE22_SUCCESS = 1,\r\nERR_E22_UNKNOWN,\r\nERR_E22_NOT_SUPPORT,\r\nERR_E22_NOT_IMPLEMENT,\r\nERR_E22_NOT_INITIAL,\r\nERR_E22_INVALID_PARAM,\r\nERR_E22_DATA_SIZE_NOT_MATCH,\r\nERR_E22_BUF_TOO_SMALL,\r\nERR_E22_TIMEOUT,\r\nERR_E22_HARDWARE,\r\nERR_E22_HEAD_NOT_RECOGNIZED\r\n```\r\n\r\n##### ResponseContainer\r\n\r\nThis container is created to manage String response and have 2 entry point.\r\n\r\n`data` with the string returned from message and  `status` an instance of  `RepsonseStatus`.\r\n\r\n```cpp\r\nResponseContainer rs = e22ttl.receiveMessage();\r\nString message = rs.data;\r\nSerial.println(rs.status.getResponseDescription());\r\nSerial.println(message);\r\n```\r\n\r\n##### ResponseStructContainer\r\n\r\nThis is the more “complex” container, I use this to manage structure, It has the same entry point of ResponseContainer but data is a void pointer to manage complex structure.\r\n\r\n```cpp\r\nResponseStructContainer c;\r\nc = e22ttl100.getConfiguration();\r\n// It's important get configuration pointer before all other operation\r\nConfiguration configuration = *(Configuration*) c.data;\r\nSerial.println(c.status.getResponseDescription());\r\nSerial.println(c.status.code);\r\nc.close();\r\n```\r\n\r\n#### getConfiguration and setConfiguration\r\n\r\nThe first method is getConfiguration, you can use It to retrive all data stored on device.\r\n\r\n```cpp\r\nResponseStructContainer getConfiguration();\r\n```\r\n\r\nHere an usage example.\r\n\r\n```cpp\r\nResponseStructContainer c;\r\nc = e22ttl100.getConfiguration();\r\n// It's important get configuration pointer before all other operation\r\nConfiguration configuration = *(Configuration*) c.data;\r\nSerial.println(c.status.getResponseDescription());\r\nSerial.println(c.status.code);\r\nSerial.println(configuration.SPED.getUARTBaudRate());\r\nc.close();\r\n```\r\n\r\n![Get configuration](https://www.mischianti.org/wp-content/uploads/2019/12/E32_request_configuration_logic_analyzer-1024x319.jpg)\r\n\r\nStructure of configuration have all data of settings, and I add a series of function to get all description of single data.\r\n\r\n```cpp\r\nconfiguration.ADDL = 0x03; // First part of address\r\nconfiguration.ADDH = 0x00; // Second part\r\nconfiguration.NETID = 0x00; // NETID used for repeater function\r\n \r\nconfiguration.CHAN = 23; // Communication channel\r\n \r\nconfiguration.SPED.uartBaudRate = UART_BPS_9600; // Serial baud rate\r\nconfiguration.SPED.airDataRate = AIR_DATA_RATE_010_24; // Air baud rate\r\nconfiguration.SPED.uartParity = MODE_00_8N1; // Parity bit\r\n \r\nconfiguration.OPTION.subPacketSetting = SPS_240_00; // Packet size\r\nconfiguration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED; // Need to send special command\r\nconfiguration.OPTION.transmissionPower = POWER_22; // Device power\r\n \r\nconfiguration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED; // Enable RSSI info\r\nconfiguration.TRANSMISSION_MODE.fixedTransmission = FT_TRANSPARENT_TRANSMISSION; // Transmission type\r\nconfiguration.TRANSMISSION_MODE.enableRepeater = REPEATER_DISABLED; // Enable repeater mode\r\nconfiguration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED; // Check interference\r\nconfiguration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER; // Enable WOR mode\r\nconfiguration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011; // WOR timing\r\n```\r\n\r\nYou have the equivalent function to get all description:\r\n\r\n```cpp\r\nDEBUG_PRINT(F(\"HEAD : \"));  DEBUG_PRINT(configuration.COMMAND, HEX);DEBUG_PRINT(\" \");DEBUG_PRINT(configuration.STARTING_ADDRESS, HEX);DEBUG_PRINT(\" \");DEBUG_PRINTLN(configuration.LENGHT, HEX);\r\nDEBUG_PRINTLN(F(\" \"));\r\nDEBUG_PRINT(F(\"AddH : \"));  DEBUG_PRINTLN(configuration.ADDH, HEX);\r\nDEBUG_PRINT(F(\"AddL : \"));  DEBUG_PRINTLN(configuration.ADDL, HEX);\r\nDEBUG_PRINT(F(\"NetID : \"));  DEBUG_PRINTLN(configuration.NETID, HEX);\r\nDEBUG_PRINTLN(F(\" \"));\r\nDEBUG_PRINT(F(\"Chan : \"));  DEBUG_PRINT(configuration.CHAN, DEC); DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.getChannelDescription());\r\nDEBUG_PRINTLN(F(\" \"));\r\nDEBUG_PRINT(F(\"SpeedParityBit     : \"));  DEBUG_PRINT(configuration.SPED.uartParity, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.SPED.getUARTParityDescription());\r\nDEBUG_PRINT(F(\"SpeedUARTDatte     : \"));  DEBUG_PRINT(configuration.SPED.uartBaudRate, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.SPED.getUARTBaudRateDescription());\r\nDEBUG_PRINT(F(\"SpeedAirDataRate   : \"));  DEBUG_PRINT(configuration.SPED.airDataRate, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.SPED.getAirDataRateDescription());\r\nDEBUG_PRINTLN(F(\" \"));\r\nDEBUG_PRINT(F(\"OptionSubPacketSett: \"));  DEBUG_PRINT(configuration.OPTION.subPacketSetting, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.OPTION.getSubPacketSetting());\r\nDEBUG_PRINT(F(\"OptionTranPower    : \"));  DEBUG_PRINT(configuration.OPTION.transmissionPower, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.OPTION.getTransmissionPowerDescription());\r\nDEBUG_PRINT(F(\"OptionRSSIAmbientNo: \"));  DEBUG_PRINT(configuration.OPTION.RSSIAmbientNoise, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.OPTION.getRSSIAmbientNoiseEnable());\r\nDEBUG_PRINTLN(F(\" \"));\r\nDEBUG_PRINT(F(\"TransModeWORPeriod : \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.WORPeriod, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());\r\nDEBUG_PRINT(F(\"TransModeTransContr: \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.WORTransceiverControl, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getWORTransceiverControlDescription());\r\nDEBUG_PRINT(F(\"TransModeEnableLBT : \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.enableLBT, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());\r\nDEBUG_PRINT(F(\"TransModeEnableRSSI: \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.enableRSSI, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());\r\nDEBUG_PRINT(F(\"TransModeEnabRepeat: \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.enableRepeater, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getRepeaterModeEnableByteDescription());\r\nDEBUG_PRINT(F(\"TransModeFixedTrans: \"));  DEBUG_PRINT(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);DEBUG_PRINT(\" -\u003e \"); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());\r\n```\r\n\r\nAt same way setConfiguration want a configuration strucutre, so I think the better way to manage configuration is to retrieve the current one, apply the only change you need and set It again.\r\n\r\n```cpp\r\nResponseStatus setConfiguration(Configuration configuration, PROGRAM_COMMAND saveType = WRITE_CFG_PWR_DWN_LOSE);\r\n```\r\n\r\n`configuration` is the strucutre previsiouly show,  `saveType` permit to you to choiche if the change become permanently of only for the current session.\r\n\r\n```cpp\r\nResponseStructContainer c;\r\nc = e32ttl100.getConfiguration();\r\n// It's important get configuration pointer before all other operation\r\nConfiguration configuration = *(Configuration*) c.data;\r\nSerial.println(c.status.getResponseDescription());\r\nSerial.println(c.status.code);\r\n \r\nprintParameters(configuration);\r\nconfiguration.ADDL = 0x03; // First part of address\r\nconfiguration.ADDH = 0x00; // Second part\r\nconfiguration.NETID = 0x00; // NETID used for repeater function\r\n \r\nconfiguration.CHAN = 23; // Communication channel\r\n \r\nconfiguration.SPED.uartBaudRate = UART_BPS_9600; // Serial baud rate\r\nconfiguration.SPED.airDataRate = AIR_DATA_RATE_010_24; // Air baud rate\r\nconfiguration.SPED.uartParity = MODE_00_8N1; // Parity bit\r\n \r\nconfiguration.OPTION.subPacketSetting = SPS_240_00; // Packet size\r\nconfiguration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED; // Need to send special command\r\nconfiguration.OPTION.transmissionPower = POWER_22; // Device power\r\n \r\nconfiguration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED; // Enable RSSI info\r\nconfiguration.TRANSMISSION_MODE.fixedTransmission = FT_TRANSPARENT_TRANSMISSION; // Transmission type\r\nconfiguration.TRANSMISSION_MODE.enableRepeater = REPEATER_DISABLED; // Enable repeater mode\r\nconfiguration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED; // Check interference\r\nconfiguration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER; // Enable WOR mode\r\nconfiguration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011; // WOR timing\r\n \r\n// Set configuration changed and set to not hold the configuration\r\nResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE);\r\nSerial.println(rs.getResponseDescription());\r\nSerial.println(rs.code);\r\nprintParameters(configuration);\r\nc.close()\r\n```\r\n\r\nThe parameter all all managed as constant:\r\n\r\n#### Basic configuration option\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eADDH\u003c/td\u003e\u003ctd\u003eHigh address byte of module (the default 00H)\u003c/td\u003e\u003ctd\u003e00H-FFH\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eADDL\u003c/td\u003e\u003ctd\u003eLow address byte of module (the default 00H)\u003c/td\u003e\u003ctd\u003e00H-FFH\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eSPED\u003c/td\u003e\u003ctd\u003eInformation about data rate parity bit and Air data rate\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eCHAN\u003c/td\u003e\u003ctd\u003eCommunication channel（410M + CHAN*1M）, default 17H (433MHz), \u003cstrong\u003evalid only for 433MHz device\u003c/strong\u003e chek below to check the correct frequency of your device\u003c/td\u003e\u003ctd\u003e00H-1FH\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eOPTION\u003c/td\u003e\u003ctd\u003eType of transmission, packet size, allow special message\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd style=\"background-color:#eeeeee\"\u003eTRANSMISSION_MODE\u003c/td\u003e\u003ctd\u003eA lot of parameter that specify the transmission modality\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nOPTION\r\n\r\nType of transmission, pull-up settings, wake-up time, FEC, Transmission power\r\n\r\n#### SPED detail\r\n\r\nUART Parity bit:  _UART mode can be different between communication parties_\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e4\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e3\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003eUART parity bit\u003c/td\u003e\u003ctd style=\"background-color:#fcb900\"\u003eConstant value\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e8N1 (default)\u003c/td\u003e\u003ctd\u003eMODE_00_8N1\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e8O1\u003c/td\u003e\u003ctd\u003eMODE_01_8O1\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e8 E1\u003c/td\u003e\u003ctd\u003eMODE_10_8E1\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e8N1 (equal to 00)\u003c/td\u003e\u003ctd\u003eMODE_11_8N1\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nUART baud rate: UART baud rate can be different between communication parties, The UART baud rate has nothing to do with wireless transmission parameters \u0026 won’t affect the wireless transmit / receive features.\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e7\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e6\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e5\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003eTTL UART baud rate（bps）\u003c/td\u003e\u003ctd style=\"background-color:#fcb900\"\u003e Constant value \u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1200\u003c/td\u003e\u003ctd\u003eUART_BPS_1200\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e2400\u003c/td\u003e\u003ctd\u003eUART_BPS_2400\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e4800\u003c/td\u003e\u003ctd\u003eUART_BPS_4800\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e9600 (default)\u003c/td\u003e\u003ctd\u003eUART_BPS_9600\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e19200\u003c/td\u003e\u003ctd\u003eUART_BPS_19200\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e38400\u003c/td\u003e\u003ctd\u003eUART_BPS_38400\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e57600\u003c/td\u003e\u003ctd\u003eUART_BPS_57600\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e115200\u003c/td\u003e\u003ctd\u003eUART_BPS_115200\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\nAir data rate: The lower the air data rate, the longer the transmitting distance, better anti- interference performance and longer transmitting time, The air data rate must keep the same for both communication parties.\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e2\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e1\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e0\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003eAir data rate（bps）\u003c/td\u003e\u003ctd style=\"background-color:#fcb900\"\u003e Constant value \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0.3k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_000_03\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1.2k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_001_12\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e2.4k (default)\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_010_24\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e4.8k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_011_48\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e9.6k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_100_96\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e19.2k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_101_192\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e38.4k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_110_384\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e62.5k\u003c/td\u003e\u003ctd\u003eAIR_DATA_RATE_111_625\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\n#### OPTION detail\r\n\r\n####Sub packet setting\r\n\r\nThis is the max lenght of the packet.\r\n\r\nWhen the data is smaller than the sub packet length, the serial output of the receiving end is an uninterrupted continuous output. When the data is larger than the sub packet length, the receiving end serial port will output the sub packet.\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e7\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e6\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003ePacket size\u003c/td\u003e\u003ctd style=\"background-color:#fcb900\"\u003e  Constant value  \u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e240bytes (default)\u003c/td\u003e\u003ctd\u003eSPS_240_00\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e128bytes\u003c/td\u003e\u003ctd\u003eSPS_128_01\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e64bytes\u003c/td\u003e\u003ctd\u003eSPS_064_10\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e32bytes\u003c/td\u003e\u003ctd\u003eSPS_032_11\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\n####RSSI Ambient noise enable\r\n\r\nThis command can enable/disable the management type of RSSI, It’s important to manage the remote configuration, pay attention isn’t the RSSI parameter in the message.\r\n\r\nWhen enabled, the C0 C1 C2 C3 command can be sent in the transmitting mode or WOR transmitting mode to read the register. Register 0x00: Current ambient noise rssi Register 0X01: rssi when the data was received last time.\r\n\r\n\u003ctable class=\"wp-block-advgb-table advgb-table-frontend\"\u003e\u003ctbody\u003e\u003ctr class=\"alt\"\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003e5\u003c/td\u003e\u003ctd style=\"background-color:#8ed1fc\"\u003eRSSI Ambient noise enable\u003c/td\u003e\u003ctd style=\"background-color:#fcb900\"\u003e Constant value \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003eEnable\u003c/td\u003e\u003ctd\u003eRSSI_AMBIENT_NOISE_ENABLED\u003c/td\u003e\u003c/tr\u003e\u003ctr class=\"alt\"\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003eDisable (default)\u003c/td\u003e\u003ctd\u003eRSSI_AMBIENT_NOISE_DISABLED\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\n\r\n####Transmission power\r\n\r\nYou can change this set of constant by apply a define like so:\r\n\r\n```cpp\r\n#define E22_22 // default value without set \r\n#define E22_30\r\n```\r\n\r\nYou can configure Channel frequency olso with this define:\r\n\r\n```cpp\r\n// One of\r\n\r\n#define FREQUENCY_433\r\n#define FREQUENCY_170\r\n#define FREQUENCY_470\r\n#define FREQUENCY_868\r\n#define FREQUENCY_915\r\n```\r\n\r\n### TRANSMISSION_MODE Detail\r\n\r\n####Enable RSSI\r\n\r\nWhen enabled, the module receives wireless data and it will follow an RSSI strength byte after output via the serial port TXD\r\n\r\n####Transmission type\r\n\r\nTransmission mode: in fixed transmission mode, the first three bytes of each user’s data frame can be used as high/low address and channel. The module changes its address and channel when transmit. And it will revert to original setting after complete the process.\r\n\r\n####Enable repeater function\r\n\r\n####Monitor data before transmission\r\n\r\nWhen enabled, wireless data will be monitored before it is transmitted, which can avoid interference to a certain extent, but may cause data delay.\r\n\r\n####WOR\r\n\r\nWOR transmitter: the module receiving and transmitting functions are turned on, and a wake-up code is added when transmitting data. Receiving is turned on.\r\n\r\nWOR receiver: the module is unable to transmit data and works in WOR monitoring mode. The monitoring period is as follows (WOR cycle), which can save a lot of power.\r\n\r\n####WOR cycle\r\n\r\nIf WOR is transmitting: after the WOR receiver receives the wireless data and outputs it through the serial port, it will wait for 1000ms before entering the WOR again. Users can input the serial port data and return it via the wireless during this period. Each serial byte will be refreshed for 1000ms. Users must transmit the first byte within 1000ms.\r\n\r\n - Period T = (1 + WOR) * 500ms, maximum 4000ms, minimum 500ms\r\n - The longer the WOR monitoring interval period, the lower the average power consumption, but\r\nthe greater the data delay\r\n - Both the transmitter and the receiver must be the same (very important).\r\n\r\n\r\n\r\n### Send receive message\r\n\r\nFirst we must introduce a simple but usefully method to check if something is in the receiving buffer\r\n\r\n```cpp\r\nint available();\r\n```\r\n\r\nIt’s simply return how many bytes you have in the current stream.\r\n\r\n#### Normal transmission mode\r\n\r\nNormal/Transparent transmission mode is used to send messages to all device with same address and channel.\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32_transmittingScenarios.jpg)\r\n\r\nLoRa E22 transmitting scenarios, lines are channels\r\n\r\nThere are a lot of method to send/receive message, we are going to explain in detail:\r\n\r\n```cpp\r\nResponseStatus sendMessage(const String message);\r\n```\r\n\r\n```cpp\r\nResponseContainer receiveMessage();\r\n```\r\n\r\nFirst method is sendMessage and is used to send a String to a device in  **Normal mode**.\r\n\r\n```cpp\r\nResponseStatus rs = e22ttl.sendMessage(\"Prova\");\r\nSerial.println(rs.getResponseDescription());\r\n```\r\n\r\nThe other device simply do on the loop\r\n\r\n\r\n```cpp\r\nif (e22ttl.available() \u003e 1){\r\nResponseContainer rs = e22ttl.receiveMessage();\r\nString message = rs.data;` `// First ever get the data\r\nSerial.println(rs.status.getResponseDescription());\r\nSerial.println(message);\r\n}\r\n```\r\n\r\n#### Manage structure\r\n\r\nIf you want send a complex strucuture you can use this method\r\n\r\n\r\n```cpp\r\nResponseStatus sendMessage(const void *message, const uint8_t size);\r\n\r\nResponseStructContainer receiveMessage(const uint8_t size);\r\n```\r\n\r\nIt’s used to send strucutre, for example:\r\n\r\n```cpp\r\nstruct Messaggione {\r\n\r\nchar type[5];\r\n\r\nchar message[8];\r\n\r\nbool mitico;\r\n\r\n};\r\n\r\nstruct Messaggione messaggione = {\"TEMP\", \"Peple\", true};\r\n\r\nResponseStatus rs = e22ttl.sendMessage(\u0026amp;messaggione, sizeof(Messaggione));\r\n\r\nSerial.println(rs.getResponseDescription());\r\n```\r\n\r\nand the other side you can receive the message so\r\n\r\n```cpp\r\nResponseStructContainer rsc = e22ttl.receiveMessage(sizeof(Messaggione));\r\n\r\nstruct Messaggione messaggione = *(Messaggione*) rsc.data;\r\n\r\nSerial.println(messaggione.message);\r\n\r\nSerial.println(messaggione.mitico);\r\n```\r\n\r\n##### Read partial strucure\r\n\r\nIf you want read first part of the message to manage more type of strucutre you can use this method.\r\n\r\n\r\n```cpp\r\nResponseContainer receiveInitialMessage(const uint8_t size);\r\n```\r\n\r\nI create It to receive a string with type or other to identify the strucuture to load.\r\n\r\n```cpp\r\nstruct Messaggione { // Partial strucutre without type\r\n\r\nchar message[8];\r\n\r\nbool mitico;\r\n\r\n};\r\n\r\nchar type[5]; // first part of structure\r\n\r\nResponseContainer rs = e22ttl.receiveInitialMessage(sizeof(type));\r\n\r\n// Put string in a char array (not needed)\r\n\r\nmemcpy ( type, rs.data.c_str(), sizeof(type) );\r\n\r\nSerial.println(\"READ TYPE: \");\r\n\r\nSerial.println(rs.status.getResponseDescription());\r\n\r\nSerial.println(type);\r\n\r\n// Read the rest of structure\r\n\r\nResponseStructContainer rsc = e22ttl.receiveMessage(sizeof(Messaggione));\r\n\r\nstruct Messaggione messaggione = *(Messaggione*) rsc.data;\r\n```\r\n\r\n#### Fixed mode instead of normal mode\r\n\r\nAt same manner I create a set of method to use with fixed transmission\r\n\r\n#### Fixed transmission\r\n\r\n**You need to change only the sending method, because the destination device don’t receive the preamble with Address and Channel.**\r\n\r\nSo for String message you have\r\n\r\n```cpp\r\nResponseStatus sendFixedMessage(byte ADDL, byte ADDH, byte CHAN, const String message);\r\n\r\nResponseStatus sendBroadcastFixedMessage(byte CHAN, const String message);\r\n```\r\n\r\nand for structure you have\r\n\r\n```cpp\r\nResponseStatus sendFixedMessage(byte ADDL, byte ADDH, byte CHAN, const void *message, const uint8_t size);\r\n\r\nResponseStatus sendBroadcastFixedMessage(byte CHAN, const void *message, const uint8_t size );\r\n```\r\n\r\nHere a simple example\r\n\r\n```cpp\r\nResponseStatus rs = e22ttl.sendFixedMessage(0, 0, 0x17, \u0026amp;messaggione, sizeof(Messaggione));\r\n\r\n// ResponseStatus rs = e22ttl.sendFixedMessage(0, 0, 0x17, \"Ciao\");\r\n```\r\n\r\nFixed transmission have more scenarios\r\n\r\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32_transmittingScenarios.jpg)\r\n\r\nLoRa E22 transmitting scenarios, lines are channels\r\n\r\nIf you send to a specific device (second scenarios Fixed transmission) you must add ADDL, ADDH and CHAN to identify It directly.\r\n\r\n```cpp\r\nResponseStatus rs = e22ttl.sendFixedMessage(2, 2, 0x17, \"Message to a device\");\r\n```\r\n\r\nIf you want send a message to all device in a specified Channel you can use this method.\r\n\r\n```cpp\r\nResponseStatus rs = e22ttl.sendBroadcastFixedMessage(0x17, \"Message to a devices of a channel\");\r\n```\r\n\r\nIf you want receive all broadcast message in the network you must set your  `ADDH` and  `ADDL` with  `BROADCAST_ADDRESS`.\r\n\r\n```cpp\r\nResponseStructContainer c;\r\n\r\nc = e22ttl100.getConfiguration();\r\n\r\n// It's important get configuration pointer before all other operation\r\n\r\nConfiguration configuration = *(Configuration*) c.data;\r\n\r\nSerial.println(c.status.getResponseDescription());\r\n\r\nSerial.println(c.status.code);\r\n\r\nprintParameters(configuration);\r\n\r\nconfiguration.ADDL = BROADCAST_ADDRESS;\r\n\r\nconfiguration.ADDH = BROADCAST_ADDRESS;\r\n\r\n// Set configuration changed and set to not hold the configuration\r\n\r\nResponseStatus rs = e22ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE);\r\n\r\nSerial.println(rs.getResponseDescription());\r\n\r\nSerial.println(rs.code);\r\n\r\nprintParameters(configuration);\r\nc.close();\r\n```\r\n\r\n###Wireless configuration\r\n\r\nThis device support wireless configuration with sepecial command, but seems not work, i ask to EBYTE but no response received.\r\n\r\nI implement a command that send the packet in the correct way (tested with logic analizer) but seems not work.\r\n\r\n\r\n \r\nBy the way, first you muset activate RSSI noise environment, than you can use the command like so:\r\n\r\n```cpp\r\n    Configuration configuration;\r\n \r\n  configuration.ADDL = 0x13;\r\n  configuration.ADDH = 0x13;\r\n  configuration.NETID = 0x00;\r\n \r\n  configuration.CHAN = 23;\r\n \r\n  configuration.SPED.uartBaudRate = UART_BPS_9600;\r\n  configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;\r\n  configuration.SPED.uartParity = MODE_00_8N1;\r\n \r\n  configuration.OPTION.subPacketSetting = SPS_240_00;\r\n  configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;\r\n  configuration.OPTION.transmissionPower = POWER_22;\r\n \r\n  configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;\r\n  configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;\r\n  configuration.TRANSMISSION_MODE.enableRepeater = REPEATER_DISABLED;\r\n  configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;\r\n  configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_TRANSMITTER;\r\n  configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;\r\n ```\r\n \r\n\r\n## Thanks\r\n\r\nNow you have all information to do your work, but I think It’s important to show some realistic examples to undestand better all the possibility.\r\n\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: settings and basic usage\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: library\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: configuration\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: fixed transmission and RSSI\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: power saving and sending structured data\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: repeater mode and remote settings\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and Arduino shield\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and WeMos D1 shield\r\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and esp32 dev v1 shield\r\n\r\n-\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreef%2Febyte_lora_e22_series_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxreef%2Febyte_lora_e22_series_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreef%2Febyte_lora_e22_series_library/lists"}