{"id":17648659,"url":"https://github.com/matthias-bs/lorae22","last_synced_at":"2025-10-16T16:16:11.561Z","repository":{"id":37904547,"uuid":"405853633","full_name":"matthias-bs/loraE22","owner":"matthias-bs","description":"A MicroPython class for the Ebyte E22 Series LoRa modules","archived":false,"fork":false,"pushed_at":"2023-01-11T21:27:00.000Z","size":5707,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T06:03:54.283Z","etag":null,"topics":["gps","lora","micropython"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthias-bs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-13T06:10:19.000Z","updated_at":"2025-04-25T08:01:06.000Z","dependencies_parsed_at":"2023-02-09T07:00:53.253Z","dependency_job_id":null,"html_url":"https://github.com/matthias-bs/loraE22","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-bs%2FloraE22","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-bs%2FloraE22/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-bs%2FloraE22/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-bs%2FloraE22/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthias-bs","download_url":"https://codeload.github.com/matthias-bs/loraE22/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823921,"owners_count":21809713,"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":["gps","lora","micropython"],"created_at":"2024-10-23T11:19:42.264Z","updated_at":"2025-10-16T16:16:11.471Z","avatar_url":"https://github.com/matthias-bs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loraE22\nA MicroPython class for the Ebyte E22 Series LoRa modules\n\nThe supported EBYTE E22 modules are based on SEMTECH SX1262/SX1286 chipsets and are available for the \n400 MHz (410.125...493.125) and\n900 MHz (850.125...930.125) frequency ranges and provide 22 dBm max. TX power.  \n\nA simple UART interface is used to control the device.\n\n**EBYTE Datasheets:**\u003cbr\u003e\n[E22-900T22D](https://www.ebyte.com/en/product-view-news.html?id=1117)\u003cbr\u003e\n[E22-400T22D](https://www.ebyte.com/en/product-view-news.html?id=922)\n\n\nThe loraE22 class is based on the loraE32 class by effevee:\nhttps://github.com/effevee/loraE32\n\n## Warnings\n\n**Connect proper antenna before transmitting!**\n\n**Before use, check your local regulations for using this frequency range. E.g. in most of Europe, the maximum allowed TX power is below the default value of 22 dBm! There might also be additional restrictions, e.g. restrictions on the duty cycle of your transmissions (that is the fraction of air time to the total time spanned during a period of using the device)!**\n\n## NOTES\n\n1. The E22 and E32 are different in many details - \n   - commands\n   - register layout\n   - mode control\n   - AUX signal timing (in Configuration mode, AUX cannot be used to detect completion of command/response sequence)\n2. The E22 or E32 modules do not seem to be suitable for LoRaWAN communication\n   (e.g. The Things Network)\n3. See issue https://github.com/matthias-bs/loraE22/issues/6 for compatibility issues with newer (V2.1) E22 modules\n\n## Minimal NodeMCU-ESP32 hardware setup\n\n![NodeMCU-ESP32](20211014_134055_1.jpg)\n\nSee code for pin configuration.\n\n## Test code\n**Notes:** The loraE22 test code differs from the E32 test code in terms of used UART and AUX pin! Furthermore, loraE22 uses 'normal mode', while loraE32 uses 'wakeup mode' in *sendMessage()*. \n\nTransmission mode | TX (Addr - Ch) | RX (Addr - Ch) | MSG (Addr - Ch) | Transmitter Code | Receiver Code\n:---: | :------: | :------: | :------: | :----: | :----:\n|transparent|0x0001 - 0x02|0x0001 - 0x02|0x0001 - 0x02|[testSendE22_Transparent.py](examples/testSendE22_Transparent.py)|[testRecvE22_Transparent.py](examples/testRecvE22_Transparent.py)\n|fixed P2P|0x0001 - 0x02|0x0003 - 0x04|0x0003 - 0x04|[testSendE22_P2P.py](examples/testSendE22_P2P.py)|[testRecvE22_P2P.py](examples/testRecvE22_P2P.py)\n|fixed broadcast|0x0001 - 0x02|0x0003 - 0x04|0xFFFF - 0x04|[testSendE22_Broadcast.py](examples/testSendE22_Broadcast.py)|[testRecvE22_Broadcast.py](examples/testRecvE22_Broadcast.py)\n|fixed monitor|0x0001 - 0x02|0xFFFF - 0x04|0x0003 - 0x04|[testSendE22_Monitor.py](examples/testSendE22_Monitor.py)|[testRecvE22_Monitor.py](examples/testRecvE22_Monitor.py)\n\n## Example: Bi-directional transmission between two nodes\n\nEach node sends a message at a fixed interval containing an LED control \nvalue according to the state of a push button.\n\nAfterwards it checks for received messages. If a message with LED control\nvalue is available, the LED is switched accordingly.\n\nThe transmission mode (address/channel config) for the local node and the\npeer node can be set as desired in the arrays *addr* and *chan*.\n\nThe code of [node0.py](examples/node0.py) and [node1.py](examples/node1.py) is identical except for the settings of\nthe variables *me* and *peer*.\n\nNode0 | Node1\n:---: | :---: \n[node0.py](examples/node0.py)|[node1.py](examples/node1.py)\n\n## Range test setup\n\nThe LoRa transmitter sends a string containing its chip ID and a message sequence number at a fixed interval. \n\nThe LoRa receiver prints/logs _\\\u003ctimestamp\\\u003e,\\\u003clatitude\\\u003e,\\\u003clongitude\\\u003e,\\\u003caltitude\\\u003e,\\\u003crssi\\\u003e_ at a pre-defined interval.\n\nThe receiver's position and a timestamp are decoded from NMEA messages received via UART from a GPS receiver. For this purpose, [micropyGPS](https://github.com/inmcm/micropyGPS) is used.\n\nIf available, incoming LoRa messages are received from the ebyteE22 LoRa transceiver module via another UART.\nIf the messages expected from the LoRa transmitter could not be received for a certain time, an RSSI value of\n-255 dBm is assumed, indicating loss of the LoRa radio link.\n\nThe tuple _\\\u003ctimestamp\\\u003e,\\\u003clatitude\\\u003e,\\\u003clongitude\\\u003e,\\\u003caltitude\\\u003e,\\\u003crssi\\\u003e_ is printed and optionally written to a log file\nonly if a valid position is available.\n\nIf logging is enabled, a filename in the format *log_\\\u003c8_random_hex_digits_\\\u003e.csv* is created after power-on or reset.\nThe log files are written to MicroPython's internal file system. Logging must be stopped explicitly by pressing a key, otherwise the \nfile cannot be closed properly and will be corrupt/empty.\n\nTwo LEDs indicate the state of the GPS fix and the LoRa link, respectively.\n\nTransmitter Node | Receiver Node\n:---: | :---: \n[lora_tx.py](range_test/lora_tx.py)|[lora_rssi_logger.py](range_test/lora_rssi_logger.py)\n\nLog files can be converted from CSV-format to a suitable format - such as GPX or KML - on the host later.\nSee [rssi_csv_to_kml.py](range_test/rssi_csv_to_kml.py) - The KML output file provides the RSSI value as extended data to be\ndisplayed with the elevation plot in GoogleEarth. (Usage: `rssi_csv_to_kml.py log_deadbeef.csv \u003elog_deadbeef.kml`)\n\n![google_earth_elevation_plot_w_rssi](https://user-images.githubusercontent.com/83612361/138741016-65af87f3-f257-42dd-a63e-b09cc4f8651c.png)\nNote: The plot just serves as an example - the logging interval should have been shorter and the logging strategy has been modified afterwards.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthias-bs%2Florae22","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthias-bs%2Florae22","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthias-bs%2Florae22/lists"}