{"id":16241634,"url":"https://github.com/tve/sx1276fsk","last_synced_at":"2025-10-18T02:18:51.326Z","repository":{"id":56019816,"uuid":"313687436","full_name":"tve/SX1276fsk","owner":"tve","description":"Driver for SX1276 radio using FSK mode, for Arduino/esp32","archived":false,"fork":false,"pushed_at":"2020-11-30T21:25:20.000Z","size":12,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T15:45:27.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tve.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":"2020-11-17T17:04:57.000Z","updated_at":"2024-10-28T16:01:04.000Z","dependencies_parsed_at":"2022-08-15T11:31:22.708Z","dependency_job_id":null,"html_url":"https://github.com/tve/SX1276fsk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tve/SX1276fsk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2FSX1276fsk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2FSX1276fsk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2FSX1276fsk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2FSX1276fsk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tve","download_url":"https://codeload.github.com/tve/SX1276fsk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2FSX1276fsk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279453438,"owners_count":26172861,"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","status":"online","status_checked_at":"2025-10-18T02:00:06.492Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-10T14:08:11.458Z","updated_at":"2025-10-18T02:18:51.296Z","avatar_url":"https://github.com/tve.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"SX1276 FSK-mode driver\n======================\n\nThis driver uses the sx1276 \"LoRa\" radio in FSK mode in order to communicate mostly\nwith RFM69 radios. It uses the JeeLabs packet format, as follows:\n\n```\n byte: content\n    0: packet length N = 2..65\n    1: group parity (b7..6), dest id (b5..0)\n    2: flags (b7..6), src id (b5..0)\n    3..(N-1): payload data (max 63 bytes)\n    N..(N+1): 16-bit crc\n```\n\nThis driver is geared towards the ESP32. For other uC's the `attachInterrupt` calls probably have to\nbe tweaked.\n\nInterrupts\n----------\nThis driver is designed to use interrupts, but it can also function without.\nThe main reason to use interrupts is that it avoids SPI accesses to the radio while the radio is in\nRX mode and that lowers the noise floor. This adds ~9dB of SNR when in LoRa mode and is bound to\nalso help a little in FSK mode, although FSK mode can't RX below the noise floor, so it's perhaps\nless important.\n\nIdeally both DIO0 and DIO4 are connected to gpio pins for the following reasons:\n- DIO0 is used to get a payload-ready interrupt, which means the esp32 doesn't need to continuously poll\n  the radio while it's receiving.\n- DIO4 is used to get a preamble-detect interrupt, which is used to capture the RSSI, AFC, and AGC\n  settings, this means the esp32 doesn't have to continuously poll while the radio is listening for\n  a signal.\n\nThe driver works fine with neither interrupt lines oir with only one.\n\nRSSI, AGC, AFC\n--------------\nLike seemingly all Semtech packet radios the SX1276 has its ugly quirks when it comes to RSSI\nmeasurements as well as AGC/AFC. (The LoRa mode fixes this crap.) Here are my notes:\n- The RSSI value register is \"free running\" and not frozen when the packet is received. It is most\n  accurate during the preamble period after AFC/AGC happen. This means it has to be captured early\n  in the packet and is invalid by the time payload-ready is signaled.\n- The AGC/AFC process has a flaw, which is that it is not automatically restarted if packet\n  reception times out. The driver configures the radio to do AGC/AFC when it detects a preamble and\n  what happens is that if sync address match does not occur (e.g. because the signal is too low)\n  then AGC/AFC remain locked in until some future packet is received.\n- To fix the locked AFC/AGC issue the drive interrupts on preamble-detect, sets a timer, and then\n  restarts RX if no sync-address match occurs within a couple of milliseconds.\n- From the point of view of capturing RSSI/AFC/AGC it would be possible to use sync-address match\n  interrupt on DIO2, however this doesn't provide an opportunity to fix the locked AFC/AGC issue.\n\nReset\n-----\nConnecting the radio's reset pin is not strictly required as it has a proper power-on reset.\nHowever, while experiementing, it is possible to get the radio into odd non-functional states that\ncan only be cleared by a hardware reset. If the driver is used without modification the probably that\nthis occurs is very small.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftve%2Fsx1276fsk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftve%2Fsx1276fsk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftve%2Fsx1276fsk/lists"}