Manchester Library 433MHz again

Miq1:
Correct. All that happens is: you will get the length byte first as part of the payload.

I even studied the Manchester lib code thoroughly to find if the length would be processed anywhere. No, not at all.

OK, thanks. Maybe you are using an older version.

This was some of the code I was referring to:

    // added by caoxp @ https://github.com/caoxp
    // compatible with unfixed-length data, with the data length defined by the first byte.
	// at a maximum of 255 total data length.
    if( (*curByte) == 1)
    {
      rx_maxBytes = data[0];
    }

arduarn:
OK, thanks. Maybe you are using an older version.

This was some of the code I was referring to:

    // added by caoxp @ https://github.com/caoxp

// compatible with unfixed-length data, with the data length defined by the first byte.
// at a maximum of 255 total data length.
   if( (*curByte) == 1)
   {
     rx_maxBytes = data[0];
   }

I must apologize, I missed that bit. I tried again and you are right, the length byte is used indeed. My fault was not to count that as well when giving the payload length, so instead of 4 bytes I gave only 3. Now doing it correctly, the receiveComplete() works as should be.

So here is the code again, this time using the length byte. I removed my sensor stuff from it, as it does not matter in regards to the RF transmission.

Sender:

#include <Manchester.h>
#define DATA_433 1

uint8_t packet[4];

void setup() {
  man.setupTransmit(DATA_433, MAN_1200);
  packet[0] = 4; // transmission length including length byte
}

void loop() {
    packet[1] = random(256);
    packet[2] = random(256);
    packet[3] = random(256);
    man.transmitArray(4, packet);
    delay(10000);
}

Receiver:

#include <Manchester.h>

#define DATA_433 4

uint8_t packet[4];

void setup() {
  man.setupReceive(DATA_433, MAN_1200);
  man.beginReceiveArray(4, packet);
  Serial.begin(9600);
  Serial.println("");
}

void loop() {
  if (man.receiveComplete()) 
  {
    Serial.print(packet[1]);
    Serial.print(packet[2]);
    Serial.println(packet[3]);
    man.beginReceiveArray(4, packet);
  }
}

Glad you got it working. That was a very significant change to the library that could have done with some big red text explaining it.

Thank you for insisting and pushing me the right way! :wink: