Integration to Milesight SG-50 with MQTT.


Thank you for maintaining this great software.-
We have recently acquired an amazing Milesight SG50 with external 45W solar panel.

We are facing an integration problem :

Milesight SG50 does not support Chirpstack > v4.0.0 when using MQTT regional topic f.e. “eu868” topic prefix.

The possible solutions and drawbacks.

1.- Implement a service which republishes everything bellow gateway/xxxxxx to eu868/gateway/xxxx. This solution add an extra service with additional costs and maintenance requirements.
We have implemented the microservice but we can’t still see the gateway ONLINE.

This is a WORKING kerlink gateway STATS Message :

eu868/gateway/7076ff005606xxxx/event/stats {“gatewayId”:“7076ff005606xxxx”,“time”:“2024-06-05T14:43:08+00:00”,“rxPacketsReceived”:76,“rxPacketsReceivedOk”:72,“txPacketsReceived”:1,“txPacketsEmitted”:1,“metadata”:{“mqtt_forwarder_version”:“4.2.0”},“txPacketsPerFrequency”:{“868300000”:1},“rxPacketsPerFrequency”:{“867900000”:1,“868500000”:2,“868100000”:18,“867100000”:1,“868300000”:50},“txPacketsPerModulation”:[{“modulation”:{“lora”:{“bandwidth”:125000,“spreadingFactor”:7,“codeRate”:“CR_4_5”,“polarizationInversion”:true}},“count”:1}],“rxPacketsPerModulation”:[{“modulation”:{“lora”:{“bandwidth”:125000,“spreadingFactor”:12,“codeRate”:“CR_4_5”}},“count”:3},{“modulation”:{“lora”:{“bandwidth”:125000,“spreadingFactor”:7,“codeRate”:“CR_4_5”}},“count”:69}],“txPacketsPerStatus”:{“OK”:1}}

Notice : SG-50 is sending the gateway id in protobuf format.

This is a FAILING Milesight SG-50 gateway STATS Message processed by topic switch microservice :

eu868/gateway/24e124fffef9xxxx/event/stats {“gatewayID”:“JOEk//75APk=”,“ip”:“”,“time”:“2024-06-05T14:41:36Z”,“location”:{“latitude”:88.0xxxx,“longitude”:2.1xxxx,“altitude”:88.0,“source”:“GPS”},“configVersion”:“”,“rxPacketsReceived”:12,“rxPacketsReceivedOK”:9,“txPacketsReceived”:0,“txPacketsEmitted”:0}

2.- Connect using semtech udp/1700. This solution is not feasible as gateway uses celular network with CGNAT (carrier grade nat) , no public IP , no able to reach gateway udp/1700. unsecure , unencrypted.

3.- Downgrade to <4.0 chirpstack version.

Could you provide .deb pas for <4.0 chirpstack version ?

Milesight SG-50 for > 4.0 chirpstack with MQTT integration is not going to be supported till 2024 Q4 !!


Santi .-
Many thanks for your help .-



I don’t know anything about the SG50 but can you SSH into it? If so you could install the gateway-bridge or mqtt-forwarder on to the device and then use UDP → gateway bridge locally, avoiding any security risks of UDP. Alternatively does the gateway support a basic-station packet forwarder? You can secure basic-station using self-signed certs to a gateway bridge on the server.

Milesight gateway supports UDP packet forwarder.
You need to install ChirpStack gateway bridge on Ubuntu too.

Then Milesight will not care if you use Chirpstack v3 or v4 or v4.8.

1 Like

I finally fixed the issue by using SEMTECH on udp/1700 but I needed to setup a VPN gateway to the SIM provider to have bidirectional communications.

1 Like