Setting up your gateway
Setting up the gateway is fairly simple. All you need is a LoPy, a LoRa antenna, a Wi-Fi antenna and an expansion board. Place the LoPy in the expansion board with the LED on the same side as the microUSB connector. Remove the jumpers from the BAT and CHG headers. Attach the LoRa antenna to the connector near the LED, and the Wi-Fi antenna to the connector on the opposite end of the board. Plug the USB in and test the connection in Atom, and begin the firmware update process. Now that you’ve got the board set up we need to get its Gateway ID. In Atom’s terminal, run Then in TheThingsNetwork console go to the Gateways page and then “register gateway”. Check “I’m using the legacy packet forwarder” and paste the Gateway ID we retrieved in the Gateway EUI field. Set the Frequency Plan and Router fields to match your region.
Finally, copy the gateway folder from the DVD and open a new Atom window. Open the gateway folder as a project. Edit the WIFI_SSID and WIFI_PASS variables to match your Wi-Fi, and the SERVER variable to the one you selected in TheThingsNetwork Console. That’s it – the gateway is now ready. >>> import machine >>> import ubinascii >>> WIFI_MAC = ubinascii.hexlify(machine. unique_id()).upper() >>> GATEWAY_ID = WIFI_MAC[:6] + “FFFE” + WIFI_MAC[6:12] >>> print(GATEWAY_ID)