Azure / iotedge-lorawan-starterkit

Sample implementation of LoRaWAN components to connect LoRaWAN antenna gateway running IoT Edge directly with Azure IoT.
https://azure.github.io/iotedge-lorawan-starterkit/2.2.1
Other
184 stars 61 forks source link

SPI - how does it fit into the architecture #275

Closed donniekerr closed 3 years ago

donniekerr commented 3 years ago

I'm not an electronics guy. I think I understand how it works on the device to chain slaves, etc. https://www.makeuseof.com/tag/enable-spi-i2c-raspberry-pi/ Given that, I can understand how many sensors can connect to a Lora Module chip using it before sending the data to the Gateway.

My question is, how does it fit into the gateway side architecture? @gerfen gave me instructions on how to add the files for it to my AAEON gateway. But I'm trying to get educated on how it is used in the data flow through the gateway. Does it interface with the packet forwarder? What is the role of SPI on the gateway?

donniekerr commented 3 years ago

I think i get it now.
SPI, running on each Lora Node integrates data from multiple sensors. SPI, running on the Gateway integrates data from multiple Lora nodes.

Since the Concentrator is software in the edge module, it isn't clear to me how it uses SPI though.

gerfen commented 3 years ago

Are you trying to determine how many devices can be supported by your gateway?

From: Donnie Kerr notifications@github.com Sent: Thursday, November 19, 2020 9:48 AM To: Azure/iotedge-lorawan-starterkit iotedge-lorawan-starterkit@noreply.github.com Cc: Michael Gerfen gerfen@hotmail.com; Mention mention@noreply.github.com Subject: Re: [Azure/iotedge-lorawan-starterkit] SPI - how does it fit into the architecture (#275)

I think i get it now. SPI, running on each Lora Node integrates data from multiple sensors. SPI, running on the Gateway integrates data from multiple Lora nodes.

Since the Concentrator is software in the edge module, it isn't clear to me how it uses SPI though.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Azure/iotedge-lorawan-starterkit/issues/275#issuecomment-730535730, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIJFZDCEDVBJJXE6Q2E24DSQVK6ZANCNFSM4T2U5XFA.

donniekerr commented 3 years ago

@gerfen , no I'm just trying learn about SPI, in general. One question I had was how SPI fits in under the hood on the gateway. Is the packet forwarder (concentrator and SPI) all done in software? Or is there a physical concentrator board on the AAEON where SPI is used?

gerfen commented 3 years ago

My understanding is SPI is used by the OS to "talk" to the concentrator hardware - I believe that AAEON uses the Semtech SX1301 concentrator. This link is helpful.... https://static6.arrow.com/aropdfconversion/d45a99f75ae1eaf8862dd031e5016b050158f561/sx1301.pdf

donniekerr commented 3 years ago

Ah ha! That's the piece I was missing. I see the reference to SX1301 here too https://github.com/Lora-net/packet_forwarder/tree/master/lora_pkt_fwd#lora-gateway-packet-forwarder

Makes sense now that the hardware uses the SPI bus to move the data to the software in the packet forwarder and then on to the network server.

Thanks!

ronniesa commented 3 years ago

SPI is a bus like PCI on embedded systems. The radio HW and firmware (Semtech chip) talk over the SPI bus with the PacketForwarder that he then format the packet and forward to a UDP endpoint where our NetworkServer module picks it up and do all the processing including impersonating the device against IoT Hub, decrypt, ev. decode and send the message upstream

donniekerr commented 3 years ago

Thank you @ronniesa . Might be good to add the Concentrator Hw and SPI to this diagram https://github.com/Azure/iotedge-lorawan-starterkit/blob/dev/Docs/Pictures/EdgeArchitecture.png . I think I was just trying to figure out what was happening inside the packet forwarder box. i.e. was it all software or some hardware. Now it is clear to me. Appreciate the education guys!