Gateway Mesh fails to relay downlinks to Class C devices.

I eventually got around this by making a tiny patch to the relay_downlink_lora_packet function.

The line (396) that was raising an error in the original code was here:

let delay = match &timing.parameters {
     Some(gw::timing::Parameters::Delay(v)) => v
         .delay
         .as_ref()
         .map(|v| v.seconds as u8)
         .unwrap_or_default(),
      _ => {
         return Err(anyhow!("Only Delay timing is supported"));
     }
};

And this is how I modified it:

let delay = match &timing.parameters {
      Some(gw::timing::Parameters::Delay(v)) => v
           .delay
           .as_ref()
           .map(|v| v.seconds as u8)
           .unwrap_or_default(),
       Some(gw::timing::Parameters::Immediately(_)) => 1,
       _ => {
          return Err(anyhow!("Only Delay or Immediately timing is supported"));
       }
};

This is a really quick and dirty solution so It’s not worth doing a pull request on it. There must be a better way to handle relaying downlinks with Immediate timing . One issue that this will cause is that these relayed downlinks will have an delay of 1 seconds which is fine for my project.

2 Likes