RF receiver works on arduino uno but not yun

Hi all,

I am experimenting with an irrigation project which has arduino mini pros to send data to a Yun to receive it and then post it as feed via the internet.

I am working on the communication-to-yun part and decided for the RF option with some cheap 433mhz receiver/transmitter pair.
The hardware is arm mcu wl te122 (https://www.amazon.co.uk/d/7hr/XCSOURCE-433Mhz-Transmitter-Module-Receiver-Arduino-TE122/B00V4ISS38/ref=pd_lpo_vtph_23_bs_t_2?_encoding=UTF8&psc=1&refRID=W3TS99VKX14RA9B7SJDY) from xsource.
I went for the radiohead library as it seems the standard and also because i want to use it for more long distance communication with some lora transceivers later on.

My first experiment uses a mini pro to send the data and the uno to receive it.

I used standard default wiring, pin 12 on the mini pro is connected to the DATA pin of the transmitter and pin 11 of the UNO is connected to DATA pin of the receiver.

All works fine using the code below.

However when I connect the receiver to a Yun instead of the UNO then I don't seem to receive any message.

I have tried using different pins, switching receivers between the UNO and YUN and checked the wiring.

I also tried to re-initialize the driver in the main loop - basically everything else I could think of - all to no avail.

I am kind of puzzled that there are almost no examples on the internet - however the yun seems supported by the radiohead library and I could find no special instruction for the yun.

I have seen some discussions on the facts that the pin layout is different, but nothing I have seen should impact my setup as far as i can tell.

Anyone successfully got a similar receiver working on the YUN?

Or do you spot anything obvious in my setup?

Thanks in advance,

Mauro

Receiver

#include <Bridge.h>
#include <RH_ASK.h>
#include <SPI.h> // Not actually used, but needed to compile
#include <Console.h>
RH_ASK driver;

void setup() {
  Bridge.begin();
  Console.begin();
    // Wait for Console port to connect
  while (!Console);
  Console.println("Receiver started");
  // try to initialize rf receiver 
  if(!driver.init())
    Console.println("RF module init failed");
  Console.println("RF init succeded");
}

void loop() {
  Console.println("Listening again ...");

  uint8_t buf[26];
  uint8_t buflen = sizeof(buf);

  if(driver.recv(buf, &buflen))  // Non-blocking
  {
    //Message with a good checksum received, dump it
    driver.printBuffer("Got: ", buf, buflen);
    Console.print("Message: ");
    Console.print((char*) buf);
  }
  delay(5000);
}

transmitter

#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;

void setup()
{
    Serial.begin(9600);   // Debugging only
    if (!driver.init())
         Serial.println("init failed");
}

void loop()
{
    const char *msg = "Fritz says: Happy journey!";
    Serial.print("sending message: "); Serial.println(msg);
    driver.send((uint8_t *)msg, strlen(msg));
    driver.waitPacketSent();
    delay(1000);
}

Do you use the unmodified version of the library? For example you did not activate Timer2?

You raise a good point. I was thinking the library works on the UNO so it should work on the Yun just the same.
Though I uploaded the Yun and the UNO from different machines - so maybe I am not using the same version of the radiohead library.
I will run another test making sure the same version of the library is used - fingers crossed.

No luck unfortunately.
Loaded the UNO form the same laptop, IDE and radiohead library and all works well.
Virtually the same code on the YUN and I get nothing back.

Here is the receiver code for the UNO - just swapped Serial for Console and remove the Bridge and Console files from imports.

#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;

void setup()
{
    Serial.begin(9600);   // Debugging only
    if (!driver.init())
         Serial.println("init failed");
}

void loop()
{
    const char *msg = "Fritz says: Happy journey!";
    Serial.print("sending message: "); Serial.println(msg);
    driver.send((uint8_t *)msg, strlen(msg));
    driver.waitPacketSent();
    delay(1000);
}

Sent the sender code by mistake - here is the UNO receiver code:

#include <RH_ASK.h>
#include <SPI.h> // Not actually used, but needed to compile

RH_ASK driver;

void setup() {
  Serial.begin(9600);

  Serial.println("Receiver started");
  // try to initialize rf receiver 
  if(!driver.init())
    Serial.println("RF module init failed");
  Serial.println("RF init succeded");
}

void loop() {
  Serial.println("Listening again ...");

  uint8_t buf[26];
  uint8_t buflen = sizeof(buf);

  if(driver.recv(buf, &buflen))  // Non-blocking
  {
    //Message with a good checksum received, dump it
    driver.printBuffer("Got: ", buf, buflen);
    Serial.print("Message: ");
    Serial.print((char*) buf);
  }
  delay(5000);
}

You still did not answer my questions:

Do you use the unmodified version of the library? For example you did not activate Timer2?

No the library is not modified and I did not activated Timer 2.
I actually got it to work by disabling the wifi interface on the YUN - there must have some interference. Even with wifi off there's quite a bit of package drop, the UNO performs better for some reason.