{"id":17124066,"url":"https://github.com/jayu/nodemcu-lora-sx1276-lua","last_synced_at":"2026-05-09T01:05:25.938Z","repository":{"id":118315392,"uuid":"477865749","full_name":"jayu/nodemcu-lora-sx1276-lua","owner":"jayu","description":"NodeMCU lua library for LoRa SX1276/SX1278 radio communication modules","archived":false,"fork":false,"pushed_at":"2022-04-04T21:16:47.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:12:27.288Z","etag":null,"topics":["esp32","esp8266","lora","lorawan","lua","lua-library","lua-script","nodemcu","nodemcu-esp8266","nodemcu-lora","nodemcu-lua","sx1276","sx1278"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-04-04T20:40:10.000Z","updated_at":"2023-03-19T21:37:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ef6369b-14cd-493a-b3d2-1edf0f942272","html_url":"https://github.com/jayu/nodemcu-lora-sx1276-lua","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/jayu%2Fnodemcu-lora-sx1276-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Fnodemcu-lora-sx1276-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Fnodemcu-lora-sx1276-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Fnodemcu-lora-sx1276-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayu","download_url":"https://codeload.github.com/jayu/nodemcu-lora-sx1276-lua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245200706,"owners_count":20576674,"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":["esp32","esp8266","lora","lorawan","lua","lua-library","lua-script","nodemcu","nodemcu-esp8266","nodemcu-lora","nodemcu-lua","sx1276","sx1278"],"created_at":"2024-10-14T18:41:47.130Z","updated_at":"2026-05-09T01:05:20.913Z","avatar_url":"https://github.com/jayu.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeMCU LoRa module library\n\nNodeMCU lua library for LoRa SX1276/SX1278 radio communication modules\n\nThe library is a based on the library from https://github.com/JaapBraam/LoRaWanGateway \n\nThe improvements:\n- fixed a bug with incorrect operations on message buffers which result in sending garbage instead of actual message\n- enhanced power management to support 20dBm mode\n  - implementation was inspired by https://github.com/sandeepmistry/arduino-LoRa/blob/master/src/LoRa.cpp\n\nI'm not an expert in implementing such libraries and I don't understand most of these registers operations, but I made it work for me somehow 😃\n\nMost of the credits goes to authors of the mentioned libraries who had to study SX1276 manual a lot 🧐\n\n## Usage\n\n### API\n\n```lua\nlocal radioLib = require('sx1276.lua')\n\nlocal nssPin = 0\nlocal dio0Pin = 1\nlocal dio1Pin = 2\n\nlocal frequency = 433.000 * 1000000 -- Frequency in Hz\nlocal spreadingFactor = \"SF7\" -- \"SF7\" - \"SF12\" \nlocal bandWidth = \"BW125\" -- I think only this one is supported\nlocal errorCorrection = \"4/5\" -- I believe these are supported: \"4/5\", \"4/6\", \"4/7\", \"4/8\"\n\nlocal radioInterface = radioLib(\n  nssPin,\n  dio0Pin,\n  dio1Pin,\n  frequency,\n  spreadingFactor,\n  bandWidth,\n  errorCorrection\n)\n\n-- Receiving\n\nlocal function handleMessage(pkt)\n  print(\"RX!\")\n  print(\"Data: \", pkt.data)\n  print(\"RSSI: \", pkt.rssi)\n  for k, v in pairs(pkt) do\n      print(k, v)\n  end\nend\n\nradioInterface.rxpk = handleMessage\n\n-- Transmitting\n\nlocal pkt = {\n    freq = frequency,\n    codr = errorCorrection,\n    datr = spreadingFactor .. bandWidth,\n    data = \"Here goes your message\",\n    powe = 17 -- values 0..20\n}\n\nradio.txpk(pkt)\n\n```\n\n### Connections \n\n_Stolen from https://github.com/JaapBraam/LoRaWanGateway/blob/master/README.md#hardware_\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003eESP PIN\u003c/th\u003e\u003cth\u003eSX1276 PIN\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD1 (GPIO5)\u003c/td\u003e\u003ctd\u003eDIO0\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD2 (GPIO4)\u003c/td\u003e\u003ctd\u003eDIO1\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD5 (GPIO14)\u003c/td\u003e\u003ctd\u003eSCK\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD6 (GPIO12)\u003c/td\u003e\u003ctd\u003eMISO\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD7 (GPIO13)\u003c/td\u003e\u003ctd\u003eMOSI\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eD0 (GPIO16)\u003c/td\u003e\u003ctd\u003eNSS\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eGND\u003c/td\u003e\u003ctd\u003eGND\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e3.3V\u003c/td\u003e\u003ctd\u003eVCC\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n## TODO (a.k.a. roadmap)\n\nThe library needs a lot of refactoring, feel free to open a PR!\n\n- [ ] refactor global variables with register numbers into object with all registers\n- [ ] refactor all register magic numbers to variables with register numbers\n- [ ] remove code responsible for handling multiple spreading factors\n- [ ] make the API more friendly\n- [ ] implement support for low power mode - right now NodeMCU has to be ON all the time to handle incoming messages, but there is a way to use interrupts from SX1276 to wake up NodeMCU\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayu%2Fnodemcu-lora-sx1276-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayu%2Fnodemcu-lora-sx1276-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayu%2Fnodemcu-lora-sx1276-lua/lists"}