Code Monkey home page Code Monkey logo

Comments (7)

jgromes avatar jgromes commented on May 28, 2024

I don't think it's a good idea to add this. At the core, RadioLib is a collection of drivers for radio modules - the library does all the heavy lifting of register configuration etc., and leaves the top level functionality fully exposed to the user - the user can then implement whatever he wants on top of that. This restriction means that only features of the hardware are implemented.

What you're describing seems to be more like a part of some protocol - it's a higher level of abstraction and it's not a feature of any radio module.

from radiolib.

BarryPSmith avatar BarryPSmith commented on May 28, 2024

This is true. It's OSI layer 2 (one layer above physical layer). I thought it might fit in with the other protocols in the library.

from radiolib.

jgromes avatar jgromes commented on May 28, 2024

It would have to be implemented as a standalone protocol - PhysicalLayer is just an abstraction that provides common interface to similar radio modules.

from radiolib.

BarryPSmith avatar BarryPSmith commented on May 28, 2024

Yes, I would certainly think to do something along those lines. But the protocol has to know whether there is traffic on the channel in order to work. Currently there is no method on Physical layer like isChannelBusy, although all of the hardware units provide something that could be used:
RF9x, SX126x and 127x provide scanChannel.
RF69 would have to implement something with the RSSI DIO or register.
nRF24 looks like it needs to expose RPD measurements (datasheet section 6.4).
C1101 can expose Carrier Sense (Datasheet 17.4)

As I mentioned, I don't have much desire to write the code for modules I don't own or use, but I can write the protocol to work on SX126x and that can be expanded in future.

from radiolib.

BarryPSmith avatar BarryPSmith commented on May 28, 2024

Hey nevermind, I wrote the code and it's only 17 lines long and you're right it doesn't need to be a part of RadioLib.

from radiolib.

jgromes avatar jgromes commented on May 28, 2024

I remain sceptical, sorry. My main issue is that different protocols might handle collisions differently. If at some point we come to the conclusion it would be advantageous to provide information about channel state to the upper layers, your outline for what to use in different modules would be 100% correct.

Also (mainly as a note for your code), scanChannel on RF9x and SX127x will only detect LoRa preamble, not the whole packet. In addition, RF9x, SX127x and SX126x have FSK modem, which can't use scanChannel at all and must rely on RSSI measurement - not sure if this is relevant to your code, just putting it out there.

from radiolib.

Cloolalang avatar Cloolalang commented on May 28, 2024

Mysensors library is using it in RFM95_sendWithRetry

from radiolib.

Related Issues (20)

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.