Manually set the Downlink timing information

Hi all,

I have a unique situation where I’m using a 2.4GHz sensor to connect to the Chirpstack LNS using 2.4GHz packet-forwarder.
The thing is I want to sent data faster than the existing LoRaWAN specified Rx1 window limit of 1 second and thus I’ve coded the sensor to act as Class-A with an Rx1 window duration of 100ms and also on the Chirpstack Application server I have configured the profile to support Class-C.

Now while the transmission is going on, I have noticed that in the packet-forwarder I’m able to see the “immediate” flag set as false, whereas I need it to be true.
In order to achieve this, I looked into the source code and I came across this:

async fn _handle_response(
        ufs: UplinkFrameSet,
        dev_gw_rx_info: internal::DeviceGatewayRxInfo,
        tenant: tenant::Tenant,
        application: application::Application,
        device_profile: device_profile::DeviceProfile,
        device: device::Device,
        device_session: internal::DeviceSession,
        must_send: bool,
        must_ack: bool,
        mac_commands: Vec<lrwn::MACCommandSet>,
    ) -> Result<()> {
        trace!("Downlink response flow");

        let network_conf = config::get_region_network(&device_session.region_name)
            .context("Get network config for region")?;
        let region_conf =
            region::get(&device_session.region_name).context("Get region config for region")?;

        let mut ctx = Data {
            uplink_frame_set: Some(ufs),
            tenant,
            application,
            device_profile,
            device,
            device_session,
            network_conf,
            region_conf,
            must_send,
            must_ack,
            mac_commands,
            device_gateway_rx_info: Some(dev_gw_rx_info),
            downlink_gateway: None,
            downlink_frame: gw::DownlinkFrame {
                downlink_id: rand::thread_rng().gen(),
                ..Default::default()
            },
            downlink_frame_items: Vec::new(),
            immediately: false,
            device_queue_item: None,
            more_device_queue_items: false,
        };

        ctx.select_downlink_gateway()?;
        ctx.set_tx_info()?;
        ctx.get_next_device_queue_item().await?;
        ctx.set_mac_commands().await?;

        if ctx._something_to_send() {
            ctx.set_phy_payloads()?;
            ctx.update_device_queue_item().await?;
            ctx.save_downlink_frame().await?;
            if ctx._is_roaming() {
                ctx.save_device_session().await?;
                ctx.send_downlink_frame_passive_roaming().await?;
                ctx.handle_passive_roaming_tx_ack().await?;
            } else {
                // Some mac-commands set their state (e.g. last requested) to the device-session.
                ctx.save_device_session().await?;
                ctx.send_downlink_frame().await?;
            }
        }

        Ok(())
    }

If I change the immediately: false to immediately: true, will it be enough?
Also second question, in order to build this modification using the Dockerfile, what commands should I be using apart from the “sudo docker build -t my_custom_server:latest .” command?

Also have a look at the set_tx_info method :slight_smile:

in order to build this modification using the Dockerfile, what commands should I be using

Please see Contribute & source - ChirpStack open-source LoRaWAN® Network Server documentation