Transferring data via NRF24L01 between Arduino Nano and Raspberry Pi

Hello, I've been researching this issue for around 2 days and couldn't fix it despite some online sources being available so here I am.

I am trying to transfer a data struct using the RF24 library from arduino to raspberry pi. (And viceversa in the near future)
Both programs are written in C++

I can manage to successfully transmit..something? Which is consistently wrong and I makes me think of a different data representation, while I can't fix the issue myself

Input/output in picture

This is the same struct code for both programs

#pragma pack(push, 1)
typedef uint8_t transmitvalue;
typedef struct {
  transmitvalue x = 0, y = 0;
}
dpack;
#pragma pack(pop)

dpack packet;

I have also tried transmitting char arrays or different data types with the same result

Also this is the gettingstarted example output

Do you think the problem is in the code snippet you shared? Please post a complete example that replicates the problem.

Realizing the example was wrong too made me suspicious and reinstalled the RF24 library (using the install script provided from their site) this time with SPIDEV instead of the BCM driver and seems to be working perfectly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.