{"id":16658212,"url":"https://github.com/connorrigby/elixir-rf69","last_synced_at":"2025-04-09T18:30:28.880Z","repository":{"id":152452186,"uuid":"267203256","full_name":"ConnorRigby/elixir-rf69","owner":"ConnorRigby","description":"Elixir driver for RFM69HCW radio","archived":false,"fork":false,"pushed_at":"2022-03-18T21:18:41.000Z","size":54,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:36:36.424Z","etag":null,"topics":["circuits","elixir","nerves","radio","rf69"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnorRigby.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}},"created_at":"2020-05-27T02:39:01.000Z","updated_at":"2022-11-18T18:54:08.000Z","dependencies_parsed_at":"2023-06-08T02:30:19.511Z","dependency_job_id":null,"html_url":"https://github.com/ConnorRigby/elixir-rf69","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/ConnorRigby%2Felixir-rf69","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Felixir-rf69/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Felixir-rf69/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Felixir-rf69/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnorRigby","download_url":"https://codeload.github.com/ConnorRigby/elixir-rf69/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087547,"owners_count":21045535,"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":["circuits","elixir","nerves","radio","rf69"],"created_at":"2024-10-12T10:03:43.236Z","updated_at":"2025-04-09T18:30:28.862Z","avatar_url":"https://github.com/ConnorRigby.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RF69HCW Elixir Interface\n\nInteract with RFM69HCW radio modules via spi.\n\n[datasheet](https://cdn.sparkfun.com/datasheets/Wireless/General/RFM69HCW-V1.1.pdf)\n\n[Arduino compatible library](https://github.com/LowPowerLab/RFM69)\n\n[Purchase from adafruit](https://www.adafruit.com/product/3070)\n\n[Purchase from SparkFun](https://www.sparkfun.com/products/12775)\n\n## Current Features / Known Issues / wants\n\n* [x] Packet encryption/decryption\n* [x] Send packets\n* [x] Receive packets\n* [x] Auto Ack packets\n* [x] Support other frequencies\n* [x] AES encryption\n* [x] Basic Usage documentation\n* [x] RSSI value reading\n* [x] Processing packet data outside of the library\n* [ ] Packet recv/send telemetry (because why not?)\n* [ ] Unit tests?\n\n## WARNINGS\n\nBe sure to check your local laws for legal radio bands.\n\n## Compatability\n\nPackets are encoded/decoded with the same format as\nLowPowerLabs RF69 library version 1.4 ([described here](https://lowpowerlab.com/2019/05/02/rfm69-10bit-node-addresses/)).\nThe goal is to have feature parity with the Arduino library.\n\n## Wiring\n\nCurrently i've only tested on Raspberry Pi, but it should work\non any device that [ElixirCircuits](https://elixir-circuits.github.io/) supports.\n\n## Usage\n\n```elixir\niex()\u003e {:ok, pid} = RF69.start_link [\n  reset_pin: 16,\n  ss_pin: 25,\n  irq_pin: 13,\n  spi_bus_name: \"spidev0.0\",\n]\n{:ok, #PID\u003c0.1660.0\u003e}\niex()\u003e receive do\n...()\u003e  %RF69.Packet{} = packet -\u003e\n...()\u003e  IO.inspect(packet, label: \"received packet\")\n...()\u003e  :ok\n...()\u003e end\npacket received: %RF69.Packet{\n  ack_requested?: true,\n  is_ack?: false,\n  payload: \"123 ABCDEFGHIJK\",\n  rssi: -42,\n  sender_id: 2,\n  target_id: 1\n}\n:ok\niex()\u003e RF69.send(pid, 2, \"hello node 2 from gateway node!\")\n:ok\niex()\u003e \n```\n\n## Examples\n\nThe API defined is pretty low level. If you want to use it, you should probably\nwrap the radio server in your own genserver. See the [`Logger` Example](lib/rf69/logger_receiver.ex)\nfor an example.\n\n[There is a repo here](https://github.com/ConnorRigby/elixir-rf69-examples) with some more examples\n\n## Acking\n\nBy default the rf69 server will respond to acks If your implementation requires user acking, when starting\nthe rf69 server, pass in `auto_ack?: false`.\nThis will require that in your code when you receive a packet, you will be responsible for acking it in\nthe configured amount of time required by your other nodes. Here's an example:\n\n```elixir\ndef handle_info(%Packet{requires_ack?: true} = packet, state) do\n  # Process the packet (whatever that means to your application)\n  case process_packet(packet) do\n    :ok -\u003e \n      # packet processed successfully.\n      RF69.ack(state.rf69, packet)\n    :error -\u003e \n      # packet processed unsuccessfully.\n      # The protocol has no concept of \"nack\"ing, so the lack of\n      # an ack should be considered a \"nack\"\n      Logger.error \"Not acking #{inspect(packet)}\"\n  end\n  {:noreply, state}\nend\n```\n\n## Encryption\n\nAES Encryption is handled at the hardware level. All you as a developer need to\ndo is load the encryption key when starting the server.\n\n\u003e WARNING:\n\u003e This key must be **EXACTLY** 16 bytes wide.\n\n```elixir\n{:ok, pid} = RF69.start_link(encrypt_key: \"sampleEncryptKey\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorrigby%2Felixir-rf69","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnorrigby%2Felixir-rf69","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorrigby%2Felixir-rf69/lists"}