{"id":14963428,"url":"https://github.com/xreef/ebyte_lora_e22_micropython_library","last_synced_at":"2025-10-25T02:30:32.074Z","repository":{"id":149366596,"uuid":"617682731","full_name":"xreef/EByte_LoRa_E22_micropython_library","owner":"xreef","description":"MicroPython LoRa EBYTE E22 device library complete and tested with Arduino SAMD, esp8266, esp32, Raspberry, rp2040 and STM32. sx1262/sx1268","archived":false,"fork":false,"pushed_at":"2024-07-16T06:46:15.000Z","size":2416,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T04:51:30.762Z","etag":null,"topics":["arduino","e22","ebyte","esp32","esp8266","lora","micropython","raspberry-pi-pico","rp2040","samd","stm32","sx1262","sx1268","uart"],"latest_commit_sha":null,"homepage":"https://www.mischianti.org/category/my-libraries/ebyte-lora-e22-devices/","language":"Python","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-22T22:21:37.000Z","updated_at":"2024-07-16T06:46:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e700c309-f577-497a-a54a-7ff7bec47f6b","html_url":"https://github.com/xreef/EByte_LoRa_E22_micropython_library","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"553ef42567ac0e55c92ad54aef2deade2892013b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_micropython_library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_micropython_library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_micropython_library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreef%2FEByte_LoRa_E22_micropython_library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xreef","download_url":"https://codeload.github.com/xreef/EByte_LoRa_E22_micropython_library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238059129,"owners_count":19409601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["arduino","e22","ebyte","esp32","esp8266","lora","micropython","raspberry-pi-pico","rp2040","samd","stm32","sx1262","sx1268","uart"],"created_at":"2024-09-24T13:31:29.608Z","updated_at":"2025-10-25T02:30:31.272Z","avatar_url":"https://github.com/xreef.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv\u003e\n\u003ca href=\"https://www.mischianti.org/forums/forum/mischiantis-libraries/ebyte-lora-e22-uart-devices-sx1262-sx1268//\"\u003e\u003cimg\n  src=\"https://github.com/xreef/LoRa_E32_Series_Library/raw/master/resources/buttonSupportForumEnglish.png\" alt=\"Support forum EByte e32 English\"\n   align=\"right\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ca href=\"https://www.mischianti.org/it/forums/forum/le-librerie-di-mischianti/ebyte-e22-dispositivi-lora-uart-sx1262-sx1268/\"\u003e\u003cimg\n  src=\"https://github.com/xreef/LoRa_E32_Series_Library/raw/master/resources/buttonSupportForumItaliano.png\" alt=\"Forum supporto EByte e32 italiano\"\n  align=\"right\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n#\n# EBYTE LoRa E22 devices micropython library (SX1262, SX1268)\n\n\n### Changelog\n - 2023-05-02 0.0.4 Minor fix on data size message\n - 2023-04-25 0.0.3 Minor fix on set configuration\n - 2023-04-18 0.0.2 Fix regular expression and better constant management\n - 2023-03-21 0.0.1 Fully functional library\n\n### Library usage\nHere an example of constructor, you must pass the UART interface and (if you want, but It's reccomended)\nthe AUX pin, M0 and M1.\n\n### Installation\nTo install the library execute the following command:\n\n```bash\npip install ebyte-lora-e22\n```\n\n#### Initialization\n\n```python\nfrom lora_e22 import LoRaE22\nfrom machine import UART\n\nuart2 = UART(2)\nlora = LoRaE22('400T22D', uart2, aux_pin=15, m0_pin=21, m1_pin=19)\n```\n#### Start the module transmission\n\n```python\ncode = lora.begin()\nprint(\"Initialization: {}\", ResponseStatusCode.get_description(code))\n```\n\n#### Get Configuration\n\n```python\nfrom lora_e22 import LoRaE22, print_configuration\nfrom lora_e22_operation_constant import ResponseStatusCode\n\ncode, configuration = lora.get_configuration()\n\nprint(\"Retrieve configuration: {}\", ResponseStatusCode.get_description(code))\n\nprint_configuration(configuration)\n```\n\nThe result\n\n```\n# ----------------------------------------\n# HEAD :  0xc1   0x0   0x9\n#\n# AddH :  0x0\n# AddL :  0x0\n#\n# Chan :  23  -\u003e  433\n#\n# SpeedParityBit :  0b0  -\u003e  8N1 (Default)\n# SpeedUARTDatte :  0b11  -\u003e  9600bps (default)\n# SpeedAirDataRate :  0b10  -\u003e  2.4kbps (default)\n#\n# OptionSubPacketSett:  0b0  -\u003e  240bytes (default)\n# OptionTranPower :  0b0  -\u003e  22dBm (Default)\n# OptionRSSIAmbientNo:  0b0  -\u003e  Disabled (default)\n#\n# TransModeWORPeriod :  0b11  -\u003e  2000ms (default)\n# TransModeTransContr:  0b0  -\u003e  WOR Receiver (default)\n# TransModeEnableLBT :  0b0  -\u003e  Disabled (default)\n# TransModeEnableRSSI:  0b0  -\u003e  Disabled (default)\n# TransModeEnabRepeat:  0b0  -\u003e  Disabled (default)\n# TransModeFixedTrans:  0b0  -\u003e  Transparent transmission (default)\n# ----------------------------------------\n```\n\n#### Set Configuration\n\nYou can set only the desidered parameter, the other will be set to default value.\n```python\nconfiguration_to_set = Configuration('400T22D')\nconfiguration_to_set.ADDL = 0x02\nconfiguration_to_set.ADDH = 0x01\nconfiguration_to_set.CHAN = 23\n\nconfiguration_to_set.NETID = 0\n\nconfiguration_to_set.SPED.airDataRate = AirDataRate.AIR_DATA_RATE_100_96\nconfiguration_to_set.SPED.uartParity = UARTParity.MODE_00_8N1\nconfiguration_to_set.SPED.uartBaudRate = UARTBaudRate.BPS_9600\n\nconfiguration_to_set.OPTION.subPacketSetting = SubPacketSetting.SPS_064_10\nconfiguration_to_set.OPTION.transmissionPower = TransmissionPower('400T22D').\\\n                                                    get_transmission_power().POWER_10\n# or\n# configuration_to_set.OPTION.transmissionPower = TransmissionPower22.POWER_10\nconfiguration_to_set.OPTION.RSSIAmbientNoise = RssiAmbientNoiseEnable.RSSI_AMBIENT_NOISE_ENABLED\n\nconfiguration_to_set.TRANSMISSION_MODE.WORTransceiverControl = WorTransceiverControl.WOR_TRANSMITTER\nconfiguration_to_set.TRANSMISSION_MODE.enableLBT = LbtEnableByte.LBT_DISABLED\nconfiguration_to_set.TRANSMISSION_MODE.enableRSSI = RssiEnableByte.RSSI_ENABLED\nconfiguration_to_set.TRANSMISSION_MODE.enableRepeater = RepeaterModeEnableByte.REPEATER_DISABLED\nconfiguration_to_set.TRANSMISSION_MODE.fixedTransmission = FixedTransmission.FIXED_TRANSMISSION\nconfiguration_to_set.TRANSMISSION_MODE.WORPeriod = WorPeriod.WOR_1500_010\n\nconfiguration_to_set.CRYPT.CRYPT_H = 1\nconfiguration_to_set.CRYPT.CRYPT_L = 1\n\n\n# Set the new configuration on the LoRa module and print the updated configuration to the console\ncode, confSetted = lora.set_configuration(configuration_to_set)\n```\n\nI create a CONSTANTS class for each parameter, here a list:\nAirDataRate, UARTBaudRate, UARTParity, TransmissionPower, ForwardErrorCorrectionSwitch, WirelessWakeUpTime, IODriveMode, FixedTransmission\n\n#### Send string message\n\nHere an example of send data, you can pass a string \n```python\nlora.send_transparent_message('pippo')\n```\n\n```python\nlora.send_fixed_message(0, 2, 23, 'pippo')\n```\nHere the receiver code\n```python\nwhile True:\n    if lora.available() \u003e 0:\n        code, value = lora.receive_message()\n        print(ResponseStatusCode.get_description(code))\n\n        print(value)\n        utime.sleep_ms(2000)\n```\n\nIf you want receive RSSI also you must enable it in the configuration\n```python\nconfiguration_to_set.TRANSMISSION_MODE.enableRSSI = RssiEnableByte.RSSI_ENABLED\n```\n\nand set the flag to True in the receive_message method\n```python\ncode, value, rssi = lora.receive_message(True)\n```\n\n\n\nResult\n\n```\nSuccess!\npippo\n```\n\n#### Send dictionary message\n\nHere an example of send data, you can pass a dictionary\n```python\nlora.send_transparent_dict({'pippo': 'fixed', 'pippo2': 'fixed2'})\n```\n\n```python\nlora.send_fixed_dict(0, 0x01, 23, {'pippo': 'fixed', 'pippo2': 'fixed2'})\n```\n\nHere the receiver code\n```python\nwhile True:\n    if lora.available() \u003e 0:\n        code, value = lora.receive_dict()\n        print(ResponseStatusCode.get_description(code))\n        print(value)\n        print(value['pippo'])\n        utime.sleep_ms(2000)\n```\n\nif you want receive RSSI also you must enable it in the configuration\n```python\nconfiguration_to_set.TRANSMISSION_MODE.enableRSSI = RssiEnableByte.RSSI_ENABLED\n```\n\nand set the flag to True in the receive_dict method\n```python\ncode, value, rssi = lora.receive_dict(True)\n```\n\n\nResult\n\n```\nSuccess!\n{'pippo': 'fixed', 'pippo2': 'fixed2'}\nfixed\n```\n\n\n# This is a porting of the Arduino library for EBYTE LoRa E22 devices to Micropython\n\n\n# Soon a complete tutorial of the original library on my site www.mischianti.org\n\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/)\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/)\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/)\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/)\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/)\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and Arduino shield\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and WeMos D1 shield\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and esp32 dev v1 shield\n\n\nhttps://downloads.arduino.cc/libraries/logs/github.com/xreef/EByte_LoRa_E22_Series_Library/\n\n# An Arduino UNO shield to simplify the use\n![Arduino UNO shield](https://www.mischianti.org/wp-content/uploads/2019/12/ArduinoShieldMountedE32LoRa_min.jpg)\n\nYou can order the PCB  [here](https://www.pcbway.com/project/shareproject/LoRa_E32_Series_device_Arduino_shield.html) \n\nInstruction and assembly video on 6 part of the guide\n\n# An WeMos D1 shield to simplify the use\n![Arduino UNO shield](https://www.mischianti.org/wp-content/uploads/2020/01/WeMosD1ShieldMountedE32LoRa_min.jpg)\n\nYou can order the PCB  [here](https://www.pcbway.com/project/shareproject/LoRa_E32_Series_device_WeMos_D1_mini_shield_RF_8km_range.html) \n\nInstruction and assembly video on 6 part of the guide\n\n\n\n# LoRa E22 (EBYTE LoRa sx1262/sx1268) series Library for Arduino, esp8266 and esp32-\n\nI create a library to manage EBYTE E22 series of LoRa device, very powerfull, simple and cheap device.\n\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).\n\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)\n\nLoRa E22\n\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\n\nPlease refer to my article to get updated Schema\n\n### Library\n\nYou can find my library here.\n\nTo download.\n\nClick the DOWNLOADS button in the top right corner, rename the uncompressed folder LoRa_E22.\n\nCheck that the LoRa_E22 folder contains LoRa_E22.cpp and LoRa_E22.h.\n\nPlace the LoRa_E22 library folder your /libraries/ folder.\n\nYou may need to create the libraries subfolder if its your first library.\n\nRestart the IDE.\n\n#### Pinout\n\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)\n\nE22 \n\n\n\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\n\nAs you can see you can set various modes via M0 and M1 pins.\n\n\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\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\n\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.\n\n### Fully connected schema\n\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**.\n\n#### AUX pin\n\nWhen transmitting data can be used to wake up external MCU and return HIGH on data transfer finish.\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnTransmission-1024x269.jpg)\n\nLoRa E22 AUX Pin on transmission\n\nWhen receiving AUX going LOW and return HIGH when buffer is empty.\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnReception-1024x342.jpg)\n\nLoRa e22 AUX pin on reception\n\nIt’s also used for self checking to restore normal operation (on power-on and sleep/program mode).\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/e32auxPinOnSelfCheck-1024x312.jpg)\n\nLoRa e22 AUX pin on self-check\n\nesp8266 connection schema is more simple because It work at the same voltage of logical communications (3.3v).\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32-TTL-100_WemosD1_VD_PU_FullyConnected_bb-e1570517387323-768x560.jpg)\n\nLoRa E22 TTL 100 Wemos D1 fully connected\n\nIt’s important to add pull-up resistor (4,7Kohm) to get good stability.\n\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\n\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.\n\n![](https://www.mischianti.org/wp-content/uploads/2020/08/Ebyte-LoRa-E22-device-esp32-dev-kit-v1-breadboard-full-connection-768x668.jpg)\n\nEbyte LoRa E22 device esp32 dev kit v1 breadboard full connection\n\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\n\n\n![Get configuration](https://www.mischianti.org/wp-content/uploads/2019/12/E32_request_configuration_logic_analyzer-1024x319.jpg)\n\n\n#### Basic configuration option\n\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\n\nOPTION\n\nType of transmission, pull-up settings, wake-up time, FEC, Transmission power\n\n#### SPED detail\n\nUART Parity bit:  _UART mode can be different between communication parties_\n\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\n\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.\n\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\n\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.\n\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\n\n#### OPTION detail\n\n####Sub packet setting\n\nThis is the max lenght of the packet.\n\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.\n\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\n\n####RSSI Ambient noise enable\n\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.\n\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.\n\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\n\n### TRANSMISSION_MODE Detail\n\n####Enable RSSI\n\nWhen enabled, the module receives wireless data and it will follow an RSSI strength byte after output via the serial port TXD\n\n####Transmission type\n\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.\n\n####Enable repeater function\n\n####Monitor data before transmission\n\nWhen enabled, wireless data will be monitored before it is transmitted, which can avoid interference to a certain extent, but may cause data delay.\n\n####WOR\n\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.\n\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.\n\n####WOR cycle\n\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.\n\n - Period T = (1 + WOR) * 500ms, maximum 4000ms, minimum 500ms\n - The longer the WOR monitoring interval period, the lower the average power consumption, but\nthe greater the data delay\n - Both the transmitter and the receiver must be the same (very important).\n\n\n\n### Send receive message\n\nFirst we must introduce a simple but usefully method to check if something is in the receiving buffer\n\n```cpp\nint available();\n```\n\nIt’s simply return how many bytes you have in the current stream.\n\n#### Normal transmission mode\n\nNormal/Transparent transmission mode is used to send messages to all device with same address and channel.\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32_transmittingScenarios.jpg)\n\nLoRa E22 transmitting scenarios, lines are channels\n\n\nFixed transmission have more scenarios\n\n![](https://www.mischianti.org/wp-content/uploads/2019/10/LoRa_E32_transmittingScenarios.jpg)\n\nLoRa E22 transmitting scenarios, lines are channels\n\n\n## Thanks\n\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.\n\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: settings and basic usage\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: library\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: configuration\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: fixed transmission and RSSI\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: power saving and sending structured data\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: repeater mode and remote settings\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and Arduino shield\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and WeMos D1 shield\n - Ebyte LoRa E22 device for Arduino, esp32 or esp8266: WOR microcontroller and esp32 dev v1 shield\n\n-\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreef%2Febyte_lora_e22_micropython_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxreef%2Febyte_lora_e22_micropython_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreef%2Febyte_lora_e22_micropython_library/lists"}