Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SX1280 startTransmit after CAD not working #1085

Closed
jonas-koeritz opened this issue May 3, 2024 · 4 comments
Closed

SX1280 startTransmit after CAD not working #1085

jonas-koeritz opened this issue May 3, 2024 · 4 comments
Labels
question Generic question about code or usage resolved Issue was resolved (e.g. bug fixed, or feature implemented)

Comments

@jonas-koeritz
Copy link

What I want to achieve

I am trying to implement a listen before talk (LBT) scheme.

What I've tried

There is no example for interrupt driven CAD for the SX1280, I've tried to implement this myself using the RADIOLIB_LOW_LEVEL flag to manipulate state directly. After this didn't work as expected, I resorted to use scanChannel(). This returns correct results but a subsequent startTransmit() just returns 0 and doesn't send a packet.

I've followed the example code for blocking CAD and can successfully detect an occupied channel using scanChannel(). However, if I try to startTransmit() when I've detected that the channel is free. It returns state 0 (no error) but does not send the LoRa packet.

If I remove the CAD code from the same codebase, the packets get sent at the anticipated interval and can be received by a matchingly configured receiver.

Guesses

Maybe something that scanChannel() does to the modules state results in it not being configured correctly for transmission afterwards. Receiving data works, transmission doesn't.

@HeadBoffin
Copy link
Collaborator

By implication CAD is doing a receive - in this case listening across spreading factors. So the radio isn't really setup for a transmit on a particularly SF. Maybe set the SF you want to use before transmitting?

@jgromes
Copy link
Owner

jgromes commented May 5, 2024

@jonas-koeritz The fact that SX128x lacks the interface for interrupt-driven CAD is an oversight on my part and will be rectified - thanks! However, I was unable to replicate the primary issue which is that startTransmit after CAD does not send a packet. Could you please fill in the infromation requested by the issue template, mainly the code you are running?

@jonas-koeritz
Copy link
Author

Thanks for getting back on the interrupt driven CAD stuff. I fixed my other issue in the meantime. It was caused by an integration error, while debugging I had to detach a component, which caused the main loop to run slowly (waiting for that component to respond). As a result, the interrupt flags where not checked/cleared correctly.

@jgromes
Copy link
Owner

jgromes commented May 5, 2024

@jonas-koeritz glad I could help! Do let me know if you get a chance to try the interrupt-driven version of CAD (I only found one SX1280 device so I couldn't test it fully).

@jgromes jgromes added question Generic question about code or usage resolved Issue was resolved (e.g. bug fixed, or feature implemented) labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Generic question about code or usage resolved Issue was resolved (e.g. bug fixed, or feature implemented)
Projects
None yet
Development

No branches or pull requests

3 participants