Unable to Connect to Aws IoT Core, has anyone implemented it

Hi,

I am only getting started to use the setup it fits our requirement very well.

I was wondering if you could guide me how to connect to aws iot core over Matt.

Thanks

@rini

I have tried connecting it. Let me share how I did.

  1. Register thing in AWS IoT Core, you will be getting certificates after the registration. Keep it safe.
  2. After registration, you will be getting an https endpoint too in a registered thing.

Gateway Side Configurations:

  1. Install Lora-gateway-bridge
  2. Configure gateway bridge using AWS IoTcertificates and the endpoint( * /etc/lora-gateway-bridge/Lora-gateway-bridge.toml)
  3. Run your packet forwarder and Lora-gateway-bridge service. That’s it!

AWS IoT:

  1. Go to AWS IoT Core and then click test
  2. You will be getting an MQTT client console and then you can try the MQTT topics there, by subscribing to it.

If you have clarifications, please let me know.

Thanks
Praveen Kumar R

Thank you @Praveen_Kumar_R , I will have to update my gateway and then try this.

Hi Praveen,

Thank you for the inputs. I was wondering that if I configure the gateway bridge , will the messages still need to be interpreted by lora server?
I mean won’t I need lora server to handle message coming from the packet forwarder.

So the packet forwarder on gateway still needs to point to loraserver right at port 1700?

Thank you,
Regards,
Revathi

Loraserver doesn’t handle messages from the packet forwarder directly, there’s always a gateway bridge in the middle, either on the gateway itself or remotely. So the packet forwarder must always point to where the gateway bridge is.

I have set it up , i keep getting this error even though nothing else is running on 0.0.0.0:1700

FATA[0010] could not setup gateway backend: listen udp 0.0.0.0:1700: bind: address already in use
00: bind: address already in usenot setup gateway backend: listen udp 0.0.0.0:17

Only the lora-bridge-gateway is running on this port and ip.

here is my setup:

  1. On gateway (packet forwarder mode) the ip and port is set as “localhost” “1700”.
  2. The aws certs are provided in the lora-bridge-configuration file".

Is there anything else that I am missing.

Appreciate your help , thank you

ok, does that mean when the lora-bridge is setup on the gateway does it by pass the lora server and directly connect to aws iot core ?

Just to clarify, I’ve never used Aws IoT Core (let’s call it AIC for short), so I have no idea what it does. I was just pointing out that a packet forwarder never directly forwards packets to loraserver.

Now, if AIC has proper lorawan capabilities (network, join and application servers) and is compatible with gateway bridge’s output, then sure, you just make the bridge point to wherever your AIC mqtt broker is. If not, loraserver and lora-app-server may be used to manage everything and publish end user data (i.e., decrypted and decoded) through mqtt (or an http extension). I guess AIC could subscribe to the relevant topics.

ok thank you got much more clarity,

that error which I have posted is still there but I can see gateway message on topic “gateway/+/rx” on the aws IoT core.

However, how to I see end device messages? To which topic do i subscribe to see the data coming form the end device on aws iot core.

Sorry for updating things back to back

Hope to hear from you soon, thank you

If you mean the bind address error from other topic, keep that discussion there.

If you are not using loraserver, only a gateway bridge, check this for data format: https://www.loraserver.io/lora-gateway-bridge/use/data/. Specifically, the uplink frame has a field named phyPayload which is a base64 encoded LoRaWAN packet. The device data is contained in that message, but of course, it’s encrypted at network and application level.

If instead you use this project’s infrastructure, lora-app-server makes unencrypted device data available through a number of methods. In particular, there is MQTT integration which can be seen here: MQTT - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server.

@rini

mosquitto_sub -t “application/[applicationID]/device/[devEUI]/rx”

you can use the above topic to subscribe to the particular end device.

Sorry for the late reply.

Thanks

Following your explanation (well explained thank you), I looked up the lora-app-server mqtt integration. Attached is the diagram to show what I’m trying to do

trial 1

  1. Have installed lora-gateway-bridge on the gateway (in packet forwarder mode) and is configured to publish messages to IoT core(an mqtt broker essentially).

  2. Then I have changed settings in loraserver.toml and has provided awsiot mqtt server address and necessary device certs. I ran the loraserver and this is what Im getiing

  3. If my understanding is correct , as per architecture the loraserver then point out to lora-app-server as the next flow. That means I should be seeing device messages on the GUI or by subscribing to (mosquitto_sub -t “application/1/device/xxxxxxxxxxx/rx”).

Either way I cannot see the end device messages.

trial 2

  1. I have also configured the app-server (lora-app-server.toml) with the aws broker address and certs and ran it.

This didnt work either, I have nothing in crash log or debug log or error log.

Could you please suggest where am I wrong and how could I achieve this.

As I don’t know AIC, all I can say from your image is that the loraserver’s connection to the broker has an error. Why? No clue. You’ll need to check your logs.

I do wonder what does AIC provide that you need for this, as any broker works fine.

alright, I see nothing in logs. I will check with the other user here. Thank you for your time and answers.
Just if you are curious
AIC would allow you to securely connect to devices and devices to other aws service which is need for me.It also allows offline interaction with device.

1 Like

The topic works when I use this platform as it is, but by integrating IoT core it does not work.
You have mentioned earlier that you have tried IoT core, may i know what was your flow.

like I am trying or this:
gateway -> aws IoT core ->lora server -> lora-app-server -> final output
1 2 3 4

I have finished step 1, 2 (as you pointed out) and is working fine. Then for step 3, have configured lora server to subscribe to aws iot broker, do not know what to expect here. I would expect the messages are further sent and decoded by the lora-app-server.
On step 4 , device is configured and but I am not seeing any device frames.

your help is much appreciated. Thank you

Sorry for late reply.

As a prefix to your server address ,may i know which protocol you are using out this “tcp, ssl or ws”

Thanks,
Praveen

I’m sorry too for my late response, its ssl