Git Product home page Git Product logo

rfm69's Introduction

rfm69

A generic no_std rust driver to support RFM69 family wireless chips.

crates.io page docs.rs page

Examples

All examples are in the examples directory and were tested using RPI 4 + RFM69W.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Credits

This library was inspired by older rfm69 crate from Benjamin Cheng.

rfm69's People

Contributors

almusil avatar cmaves avatar mr-sven avatar qwandor avatar rkreis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rfm69's Issues

SPI Timing issues with RFM69HCW

Hi.

I've recently tried to use this library with a RFM69HCW. Sadly, the communication just did not work and even the read_all_regs call resulted in all registers having the same values (sometimes depending on the SPI speed setting). Also, manually write and read to the registers wouldn't work, as their values always stayed "the same".

~6 hours later ~

There is a mistake inside here:

This library performs separate SPI operations to first write the operation + register-index and then the padding bytes to transfer the data back from the chip (or in case of write the data is just being written). Why is this fatal? Let's have a look into the datasheet, page 44...

image

The chip expects the CS to be low during the data-transfer (which is implemented correctly), but will instantly answer with the requested data back to the host - our sample chip does not even wait for the padding byte of the master. In case of the two separate write calls, this just leads to rubbish being written.

Solution?

A proof of concept to fix the single-byte communication can be found here: https://github.com/simonmicro/rfm69/tree/bug/rfm69hcwSerialCommunication. It allows to set and get a register, but will still fail on the read_all_regs call. A janky solution to fix the multi-byte communication can be found here https://github.com/simonmicro/rfm69/tree/bug/rfm69hcwSerialCommunicationWithStd - but as I'm no Rust-pro I was forced to remove the nostd limitation and to use a buffer-copy with allocation to get it working.

I hope this can be merged / ported to properly fix this, including the nostd-requirement.

Greetings!

Also I would recommend implementing something like this: https://github.com/jgillula/rpi-rfm69/blob/44ed86d9e70e7d1010d41ce6386c709d9d7d1689/RFM69/radio.py#L117. This will allow developers to more quickly discover problems with their SPI setup, as well as properly syncing with the chip.

Having trouble getting this working with Adafruit RFM69 bonnet on Raspberry Pi

This is more of a support request than a bug, let me know if there's a more appropriate place to ask.

I'm trying to get this working with an Adafruit RFM69 bonnet on my Raspberry Pi 4. For a start I'm trying to run the receive example included with the crate.

According to the pinout, RST is connected to GPIO 25 and CS to CE1, so I changed the example to use /dev/spidev0.1 (which from what I understand will result in CE1 being pulled high while communicating). I don't understand why the example also sets up a SysfsPin for CS. What is this supposed to do, given that spidev is already managing the CS line? I tried commenting out the code in lib.rs which uses CS, and changing receive.rs to set_direction(Direction::Low) so it isn't holding RST high, but it's still not working; it reports every register value as being 0x00 and then panics on the recv call.

Any idea what I'm missing here? And why does Rfm69::new take a separate pin for CS?

Large packets

It would be nice to send larger packets than the FIFO. As far as I understand, we could use RegFifoThresh and read out the FIFO while still receiving a packet. Have you already tried anything like that, @almusil? Otherwise I'll give it a try.

Examples don't build

The examples don't build on a clean checkout. It looks like it may have been because linux_embedded_hal made some breaking changes in 0.3.1.

Add exmaples

  • Add examples for generic usage
  • Add examples for usage with LowPowerLab compatible RFM69

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.