chirpstack / chirpstack-mqtt-forwarder

ChirpStack MQTT Forwarder is a forwarder which can be installed on the gateway to forward LoRa data over MQTT.
MIT License
21 stars 12 forks source link

Beacon Filtering (Feature Enhancement) #53

Closed ccall48 closed 3 months ago

ccall48 commented 6 months ago

Is it possible to add another filter with the option of not passing beacons heard to the LNS from the forwarder?

The device filtering works great for address/prefix range and join eui’s so far on testing.

I was hoping to see if it was possible to clamp it down a bit more for those who deploy via cellular in areas where data is expensive with the hope of saving some extra cellular data.

eg. Areas where you want some private coverage but helium is filling the RF with arial ping pong you don't care for.

brocaar commented 5 months ago

With beacons, you mean Class-B beacons?

ccall48 commented 5 months ago

Let me clarify and get back to you mate.

I think they are some kind of special frame, I will contact someone who can let me know and get back to you as soon as I can. They're a lora frame not really sure if they're lorawan or class b, but some kind of proprietary (type 0x7 iirc) frame I think.

ccall48 commented 5 months ago

Just got some clarification from a core dev. Hopefully this makes sense to you about the beacons looking to be filtered:

Helium uses proprietary frames (MType = b'111') for proof of coverage. In addition to the currently existing filters on DevAddrs and JoinEUIs it would be useful for us if we could filter certain m_type's too (https://github.com/chirpstack/chirpstack/blob/master/lrwn-filters/src/lib.rs#L33). That way we can filter m_type b'111' in certain areas with a high density of Helium hotspots.

brocaar commented 5 months ago

I would say then probably a filter_proprietary=true setting makes the most sense, as it is the only type that can't be handled by ChirpStack because the format is unknown. The other MTypes can also be filtered on DevAddr prefix or DevEUI / JoinEUI prefixes.

I think this would be a great candidate for a pull-request:

Would you like to create a PR for this?

ccall48 commented 5 months ago

I can try, rust and I don't usually play well together though :D

I will let you know how I go. If I fail, happy to wait or sponsor some of your time in the future to implement it.

ccall48 commented 5 months ago

I had a look over this for a few hours and have to admit its way above my level of rust skills, especially how to go about getting started with adding the filter on the ChirpStack side.

Also having major trouble getting nix to work correctly on the server to compile anything another hour so far on top down this rabbit hole. having trouble setting the default path so need to run nix-shell -p git every time to get a nix-shell and then there are missing C dependency errors.

I think I'll stick to my python lane and admire your work.

brocaar commented 4 months ago

If I fail, happy to wait or sponsor some of your time in the future to implement it.

@ccall48 could you let me know if this issue should be kept open? I don't have an use-case for this myself, but I'm happy to implement this for you. For sponsor options, please see https://github.com/sponsors/chirpstack/.

ccall48 commented 3 months ago

I didn't get a response, close it for now, we can revisit in the future should the need arise again. Cheers