GithubHelp home page GithubHelp logo

Comments (4)

dangerverma avatar dangerverma commented on September 28, 2024

Don't ask my why, i am just a technology enthusiast but when i put in

TX:
nrf24.setChannel(1);
(in setup())

and
RX:
nrf24.setChannel(5);
(again in setup())

it works brilliantly and consistently each time without any queuing.

Some radio genius should be able to answer it.

Try and see if it works for you!

from radiohead.

JamesLenz avatar JamesLenz commented on September 28, 2024

I will probably give it another go after finals, I have NO time to mess with this right now
but if this does indeed fix the problem, thank you

from radiohead.

iwasz avatar iwasz commented on September 28, 2024

I had similar problem. I wired two nRFs to a STM32F4 board, where one was sending and the other receiving and I compared what was sent with the data received. And to my surprise data I was receiving sometimes would arrive in wrong order (BTW the same code on much slower STM32F0 board was fine)! My problem proved to be due to wrong CE pin code in my transmit function (I use my own nRF lib). So faulty code looked like that :

void Nrf24L01P::transmit (uint8_t *data, size_t len)
{
        setCe (true);
        spi->setNss (false);
        spi->transmit8 (W_TX_PAYLOAD);
        spi->transmit8 (data, len, nullptr, bogoDelay);
        spi->setNss (true);
        setCe (false);
}

And the code that fixed my problem :

void Nrf24L01P::transmit (uint8_t *data, size_t len)
{
        spi->setNss (false);
        spi->transmit8 (W_TX_PAYLOAD);
        spi->transmit8 (data, len, nullptr, bogoDelay);
        spi->setNss (true);
        setCe (true);
        HAL_Delay (1);
        setCe (false);
}

Only after the data to be transmitted is put into the RX FIFO, I make a HI pulse on CE pin. Diagram on page 35 of nRF24L01+ pointed me in the right direction. PS of course 1ms is too long and this delay is to be modified. Full code is here : https://github.com/iwasz/libmicro/tree/master/src/rf

from radiohead.

rmolinowski avatar rmolinowski commented on September 28, 2024

Greetings, great library, but I have this issue as well. Since I'm sending a joystick control position several times a second over RF, it's not too big an issue, but the "solution" by dangerverma, above makes no sense, and Radiohead uses spiburstwrite and not the method shown by iwasz. Any assistance on this would be helpful.

from radiohead.

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.