{"id":25476980,"url":"https://github.com/armanghobadi/ulora","last_synced_at":"2026-02-14T19:03:58.386Z","repository":{"id":278003748,"uuid":"934225772","full_name":"armanghobadi/ulora","owner":"armanghobadi","description":"ULoRa is a MicroPython library for SX127x LoRa modules (e.g., SX1276, SX1278) on embedded systems like ESP32, ESP8266, and ARM, enabling low-power, long-range communication for IoT applications.","archived":false,"fork":false,"pushed_at":"2025-02-17T20:02:19.000Z","size":2426,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T09:41:45.328Z","etag":null,"topics":["lora","lorawan","lpwan","micropython","sx1276","sx1277","sx1278","sx1279","sx127x"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ulora/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armanghobadi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-17T13:34:59.000Z","updated_at":"2025-10-24T07:49:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"133d9b7f-a815-48d4-a24f-a080adff3d08","html_url":"https://github.com/armanghobadi/ulora","commit_stats":null,"previous_names":["armanghobadi/ulora"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/armanghobadi/ulora","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fulora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fulora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fulora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fulora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armanghobadi","download_url":"https://codeload.github.com/armanghobadi/ulora/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armanghobadi%2Fulora/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["lora","lorawan","lpwan","micropython","sx1276","sx1277","sx1278","sx1279","sx127x"],"created_at":"2025-02-18T13:29:10.674Z","updated_at":"2026-02-14T19:03:58.381Z","avatar_url":"https://github.com/armanghobadi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ULoRa: Lightweight LoRa Library for SX127x Modules\n\n![ULoRa SX127X ](./images/logo.png)\n\n`ULoRa` is a lightweight MicroPython library designed for interfacing with SX127x series LoRa modules (e.g., SX1276, SX1278). This library allows for long-range communication with low power consumption, making it ideal for IoT (Internet of Things) applications. It supports a wide range of features such as packet transmission, reception, power management, and more, all customizable for your specific needs.\n\n![Hardware](./images/sx1278.png)\n\n## Features\n- **Packet Transmission and Reception** using LoRa\n- Configurable parameters: frequency, spreading factor, TX power, bandwidth, coding rate, preamble length\n- **Low Power Management**: Sleep and standby modes\n- Automatic hardware reset handling\n- Support for CRC and IQ inversion\n- Implicit header mode support\n- Full MicroPython integration for embedded systems\n\n## Supported Platforms\n- ESP32 \n- ESP8266\n- Any MicroPython-supported platform with SPI interface support\n\n## Hardware Requirements\n- SX127x LoRa module (e.g., SX1276, SX1278)\n- Microcontroller with SPI support (e.g., ESP32)\n- Jumper wires to connect the LoRa module to the microcontroller\n\n\n\n## Installation\n\n### Install via PyPI (Recommended)\nTo install `ULoRa` via upip, run the following command:\n\n```bash\nupip install ulora\n```\n\n### Manual Installation\nAlternatively, you can download the `ulora` files from the repository and place it in your project folder .\n\n\n## Hardware Connections\n\n### Pinout for ESP32 (or other compatible platforms)\n```plaintext\nSX1278 Module   | ESP32 Pins\n----------------|--------------\n  DIO0          | 33\n  SS (Chip Select) | 14\n  Reset         | 32\n  SCK           | 25\n  MISO          | 26\n  MOSI          | 27\n```\n\nMake sure to connect the LoRa module correctly to the microcontroller for communication.\n\n![Hardware](./images/hardware.png)\n\n\n## Library Usage\n\n### Importing the Library\n\nTo use the `ULoRa` library in your project, start by importing it:\n\n```python\nfrom ulora.core import ULoRa\nfrom machine import SPI, Pin\n```\n\n### Initializing the LoRa Module\n\nCreate an `SPI` object and define the pins to connect the LoRa module to your microcontroller:\n\n```python\nspi = SPI(1, baudrate=5000000, polarity=0, phase=0,sck=Pin(25), mosi=Pin(27), miso=Pin(26))\npins = {\"ss\": 14, \"reset\": 32, \"dio0\": 33}\n\nlora = ULoRa(spi, pins)\n```\n\nYou can also configure optional parameters like frequency, spreading factor, etc., during initialization:\n\n```python\nparameters = {\n    \"frequency\": 433000000,\n    \"tx_power_level\": 10,\n    \"spreading_factor\": 8,\n}\n\nlora = ULoRa(spi, pins, parameters)\n```\n\n### Sending Data\n\nTo send a message, use the `println()` method. The `repeat` parameter specifies how many times to repeat the transmission:\n\n```python\nlora.println(\"Hello, LoRa!\", repeat=3)\n```\n\nTo send binary data, use the `send()` method:\n\n```python\nlora.send(b\"Hello, LoRa!\")\n```\n\n### Receiving Data\n\nTo receive data, use the `listen()` method. You can set the `timeout` parameter to control how long the receiver waits for a message:\n\n```python\nmessage = lora.listen(timeout=5000)\nif message:\n    print(\"Received:\", message)\nelse:\n    print(\"Timeout - No data received\")\n```\n\nTo check for available data in a non-blocking way, use the `check()` method:\n\n```python\nif lora.check():\n    print(\"Data is available!\")\n    message = lora.listen(timeout=1000)\n    print(\"Received:\", message)\n```\n\n\n\n\n\n### Example Sender Device \n\n\n```python\nfrom machine import Pin, SPI\nfrom time import sleep\nfrom ulora.core import ULoRa  # Ensure the ULoRa class is implemented and imported correctly\n\n# ============================================================================ \n# Sender Test Example\n# ============================================================================ \nif __name__ == \"__main__\": \n    # This example is designed for a MicroPython environment with an SX127x connected. \n    # Adjust the SPI bus and pin numbers as per your hardware configuration.\n    try: \n        # ------------------------- Initializing SPI -------------------------\n        print(\"Initializing SPI bus...\")\n        spi = SPI(1, baudrate=5000000, polarity=0, phase=0,\n                  sck=Pin(25), mosi=Pin(27), miso=Pin(26))\n        print(\"SPI bus initialized with SCK: 25, MOSI: 27, MISO: 26.\")\n        \n        # ------------------------- Defining Pin Mappings --------------------\n        print(\"Setting up pin configurations...\")\n        pins = {\n            \"ss\": 14,     # Chip Select (CS) pin\n            \"reset\": 32,  # Reset pin\n            \"dio0\": 33    # DIO0 pin\n        }\n        print(f\"Pin configuration: SS={pins['ss']}, Reset={pins['reset']}, DIO0={pins['dio0']}.\")\n        \n        # ------------------------- Creating ULoRa Instance ------------------\n        print(\"Creating ULoRa instance with default parameters...\")\n        lora = ULoRa(spi, pins)\n        print(\"ULoRa instance created successfully.\")\n        \n        # ------------------------- Transmitting Test Message ----------------\n        test_message = \"Hello From Arman Ghobadi\"\n        print(\"\\n----- Transmitting Message -----\")\n        print(f\"Message: {test_message}\")\n        \n        # Send the message via LoRa\n        lora.println(test_message)\n        \n        print(\"Message transmission complete.\")\n        print(\"---------------------------------------------------------------------\\n\")\n        \n        # ------------------------- Waiting for Response ---------------------\n        # You can add code here to listen for incoming messages if needed.\n        print(\"You can now listen for responses...\")\n\n    except Exception as e:\n        # ------------------------- Error Handling --------------------------\n        print(\"\\nError during test:\")\n        print(f\"Exception: {e}\")\n        print(\"Please check the wiring and LoRa module configuration.\")\n\n\n\n```\n\n## Test Sender Image\n![Sender](./tests/images/sender.png)\n\n\n\n### Example Receiver Device \n\n\n```python\nfrom machine import Pin, SPI\nfrom time import sleep\nfrom ulora.core import ULoRa  # Ensure the ULoRa class is implemented and imported correctly\n\n# ============================================================================ \n# Sender Test Example\n# ============================================================================ \nif __name__ == \"__main__\": \n    # This example is designed for a MicroPython environment with an SX127x connected. \n    # Adjust the SPI bus and pin numbers as per your hardware configuration.\n    try: \n        # ------------------------- Initializing SPI -------------------------\n        print(\"Initializing SPI bus...\")\n        spi = SPI(1, baudrate=5000000, polarity=0, phase=0,\n                  sck=Pin(25), mosi=Pin(27), miso=Pin(26))\n        print(\"SPI bus initialized with SCK: 25, MOSI: 27, MISO: 26.\")\n        \n        # ------------------------- Defining Pin Mappings --------------------\n        print(\"Setting up pin configurations...\")\n        pins = {\n            \"ss\": 14,     # Chip Select (CS) pin\n            \"reset\": 32,  # Reset pin\n            \"dio0\": 33    # DIO0 pin\n        }\n        print(f\"Pin configuration: SS={pins['ss']}, Reset={pins['reset']}, DIO0={pins['dio0']}.\")\n        \n        # ------------------------- Creating ULoRa Instance ------------------\n        print(\"Creating ULoRa instance with default parameters...\")\n        lora = ULoRa(spi, pins)\n        print(\"ULoRa instance created successfully.\")\n        \n        # ------------------------- Transmitting Test Message ----------------\n        test_message = \"Hello From Arman Ghobadi\"\n        print(\"\\n----- Transmitting Message -----\")\n        print(f\"Message: {test_message}\")\n        \n        # Send the message via LoRa\n        lora.println(test_message)\n        \n        print(\"Message transmission complete.\")\n        print(\"---------------------------------------------------------------------\\n\")\n        \n        # ------------------------- Waiting for Response ---------------------\n        # You can add code here to listen for incoming messages if needed.\n        print(\"You can now listen for responses...\")\n\n    except Exception as e:\n        # ------------------------- Error Handling --------------------------\n        print(\"\\nError during test:\")\n        print(f\"Exception: {e}\")\n        print(\"Please check the wiring and LoRa module configuration.\")\n\n\n\n```\n\n## Test Receiver Image\n![Receiver](./tests/images/receiver.png)\n\n\n\n\n\n## License\n\n`ULoRa` is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Acknowledgements\n- Thanks to the MicroPython community for providing great resources and libraries.\n- LoRa module specifications are based on [Semtech SX127x datasheets](https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1276).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmanghobadi%2Fulora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmanghobadi%2Fulora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmanghobadi%2Fulora/lists"}