Thursday, August 19, 2021

LoRaWAN with The Things Indoor SX1308 Gateway

I've been learning about The Things network and LoRaWAN in general and set up my indoor gateway.  

https://www.thethingsnetwork.org/docs/

https://wiki.seeedstudio.com/The-Things-Indoor-Gateway/

https://www.seeedstudio.com/The-Things-Indoor-Gateway-US-p-4710.html

https://www.thethingsindustries.com/docs/gateways/thethingsindoorgateway/

I bought it from Seeedstudio a couple months ago.  Costs about eighty bucks.  Comes in a little green paperback sized box.  Its a bit heavier than I expected; turns out its got a built in wall power supply, so it plugs into the wall like a wall wart.  The pictures online show a vast array of euro power plugs; I bought a device with the USA 915 MHz radio module, and received a US power plug, so not really any point in providing a German power connector with USA radio hardware.  Also comes with a free usb-c cable.

I assigned it a LAN ip address in my router/gw address range on netbox, then set up forward and reverse DNS for the device in my samba domain, then set up the static ip address for the wifi mac address in my redundant DHCP servers.  The MAC address is on the power input side of the device in roughly 2 mm tall text (used a magnifying glass).

https://github.com/netbox-community/netbox

Setup is the usual wifi shuffle where you reboot, enter a setup mode, it creates an access point, you connect to the wifi ap using your phone, login using the wifi password written on the device, set up to connect to the "real" wifi, save and reboot, much flashing lights later the green LED is on and its pingable on my LAN.

Note the Seeedstudio wiki is out of date and the instructions on thethingsindustries should be followed.  For example, the EUI now is two bytes longer, insert hex bytes FF FE after the first 3 octets.  Also you "claim" pre-registered gateways, not register them.  I set my frequency plan up as US_902_928_FSB_2 because it seemed correct.  I set my gateway location on the website and probably correctly enabled auto-firmware-updates on the stable update channel.  Also the instructions fail to note that after claiming the gateway, it will not be in connected status until 24 hours or manual reboot.

I intend to use this with some STM32 LoRaWAN dev boards, write some IoT software using some I2C sensor breakout boards.  I also own a commercial sensecap soil monitor (like what industrial farms use) to verify my gateway is operational.  This will all be the subject of a future post...