TTIG - unable to setup

After numerous attempts and plenty of wasted days to setup a Nono-Gateway based on LoPy4 I finally ordered and received a “real” gateway. I took it out of the box and connected to my laptop with supplied USB cable.

Then I found and I follow the documentation:
https://www.thethingsnetwork.org/docs/gateways/thethingsindoor/

It says:

Activate your gateway in under 5 min

  1. Press the reset button (small button at the back of the gateway next to the USB-C port) for 5 seconds until the LED blinks rapidly GREEN<->RED for a couple of times.
  2. Hold the SETUP (button at the top of the gateway, next to the LED) for 10 seconds until the LED blinks rapidly in RED.
  3. The gateway now exposes a WiFi AP whose SSID is MINIHUB-xxxxxx where xxxxxx is the last 6 digits of the gateway ID.
  4. The password for this network is printed on the back panel of the device under WiFi PW .
  5. After connecting to this network go to 192.168.4.1 using a web browser to access the WiFi config page.

I do exactly that and after step 2 when the light is rapidly blinking I try to connect to 192.168.4.1 in my browser…However, at no avail - I am getting:

This site can’t be reached

192.168.4.1 took too long to respond.

…and the indicator light is blinking red (not fast blinking). This blinking is not even documented…

Is there anything I am missing? If not, that would be the worst $70 I spent this month…
Is it defective device? Should I return it?
Anybody?

see The Things Indoor Gateway - TTIG part 1 - #13 by Jeff-UK

did you find / understand this ?

In this set up the connection to the Laptop with the USB - C cable only serves to provide power. You might as well connect to an external USB power adapter or a USB Power bank. You cant browse directly to the device from the laptop over the cable.

Once you initiated config mode (SETUP) - with the blinking RED LED, did you then use the wi-fi on your laptop to search for the Mini-Hub AP Wifi connection and join that service using the PWD? Once connected to the GW over WiFi you then open browser window and load the 192.168.4.1 address…that should then load the configuration page for the device…from there search for your normal Wi-Fi service, select, load the appropriate password/key for that network (if applicable) then select save and reboot…the GW will then restart and go through process of joining your normal Wi-Fi connection, contacts the CUPS server and load its config and start running normally (solid Green LED)…reconnect your laptop to your normal Wi-Fi connection and if you have registered the GW in the TTN console you should then see it live and start to see any traffic from nearby nodes (if any running/in range)…

1 Like

You are skipping steps. In step 3 and 4 there is information on how to connect your laptop to the Wi-Fi accesspoint that is active when the red led is blinking.

Yes, that’s exactly what I understood that I am connected with USB for power only - never imagine any other connection with USB.

Oh, I see - somehow it did not occur to me from the documentation that I need to look for WiFi network with MINIHUB-xxxxxx name…

EDIT:
OK now, I have solid green light and also registered GW in TTN.
When should I expect to see the GW status in TTN changes to Connected?

If you check the GW console you should start to see the ‘Last Seen’ updating once it receives traffic. As the TTIG uses a Websockets interface if there is no traffic it will drop the connection if no traffic seen for a time to conserve server resources and will appear to drop off line - read the threads on Forum relating to TTIG per @Borroz link.

As for showing in the TTN Map that may take typically anywhere from 10 mins to 6hrs depending on how often the site update scrapes the data to display map updates…have seen it take longer…

DO you have a node running?..recommend .keep it >3m away from the TTIG to ensure reliable reception…

  • The “Last seen” on the TTN GW Console is empty so far…
  • I do have PySense+LoPy4 node active but so far reporting “Not joined yet…”
  • I just re-plugged the GW into a power socket that is at least 4m from the node…will see what happens in a few minutes. BTW, do I need to add in the node code 8 channels now (instead of 1 that was for Nano-Gateway)?

EDIT:
It might be that the GW ID I used in registration is incorrect. It is so small on the label (even through zoom glass) that it looked to me as 5B instead of 58…going to fix it now…

EDIT:
The incorrect GW ID was the culprit…
image

yes that would be smart

Unfortunately my node won’t join…

from network import WLAN
import machine
import time
import ussl

# For LORaWAN
from network import LoRa
#from pysense import Pysense
import socket
import binascii
import struct
import os
os.uname()

wlan = WLAN(mode=WLAN.STA)
wlan.antenna(WLAN.EXT_ANT)
wlan.connect("SoftDev", auth=(WLAN.WPA2, "MySecret"), timeout=5000)

while not wlan.isconnected(): 
    machine.idle()

print("Connected to Wifi\n")

def lora_cb(lora):
    events = lora.events()
    if events & LoRa.RX_PACKET_EVENT:
        if s is not None:
            frame, port = s.recvfrom(512) # longuest frame is +-220
            print(port, frame)
    if events & LoRa.TX_PACKET_EVENT:
        print("tx_time_on_air: {} ms @dr {}", lora.stats().tx_time_on_air, lora.stats().sftx)

dev_eui = binascii.unhexlify('CCCCCCCCCCCCCCCCCC')
app_eui = binascii.unhexlif('BBBBBBBBBBBBBBBBBBB')
app_key = binascii.unhexlify('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')

LORA_NODE_DR = 4
LORA_CHANNEL = 0 # zero = random
LORA_FREQUENCY_9039 = 903900000 

lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.US915)

# remove all the non-default channels
for channel in range(0, 72):
    lora.remove_channel(channel)

print("Non-Default channels removed.")

# set the 8 channels to the same frequency (must be before sending the OTAA join request)
for i in range (8):
     lora.add_channel(i, frequency=LORA_FREQUENCY_9039, dr_min=0, 
dr_max=LORA_NODE_DR)
 print("Added channel %s" % i);


print("Issuing Join request to LoRaWAN...\n")
# join a network using OTAA
lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0, dr=LORA_NODE_DR)

# wait until the module has joined the network
while not lora.has_joined():
    time.sleep(2.5)
    print('Client Node: Not joined LoRaWAN yet...')

print("Successfully joined the LoRaWAN network")

lora.callback(trigger=( LoRa.RX_PACKET_EVENT |
                    LoRa.TX_PACKET_EVENT |
                    LoRa.TX_FAILED_EVENT  ), handler=lora_cb)

print("Set the RX, TX, FAILED events callback")
time.sleep(4) # this timer is important

# create a LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)

print("Created LoRaWAN socket")

# set the LoRaWAN data rate
s.setsockopt(socket.SOL_LORA, socket.SO_DR, LORA_NODE_DR)
print("Set LoRaWAN DataRate")

# make the socket non-blocking
s.setblocking(False)
print("Set socket to non-blocking...")

time.Sleep(5.0)

counter = 0;

s.send("My 1st message")

while True:
     try:
           counter += 1
           time.sleep(1)
           s.send("msg %s" % counter)
           time.Sleep(1)
           rx = s.recv(256)
           if rx:
                print(rx)
           time.sleep(1)
     except OSError as e:
          print('Error in check_msg function')

EDIT:
I realize now that the above code - although seem correct - just tells half of the story…I eliminated the part that connects to a MQTT Broker on a different WiFi network…I always assumed that there is a single WiFi network and now see that I need to connect to 2 different WiFi networks…I still don’t know whether LoPy4 is able to do so…

:+1: Glad to see GW online…welcome to the club!

Still struggling with the node.
Is this the correct code to connect the node?

wlan.connect(“MINIHUB-80161B”, auth=(WLAN.WPA2, “networkPassword”), timeout=5000)

The bottom line - it wont connect with this while I am sure that the network name and password are correct…

:shushing_face: :roll_eyes:

Your TTIG is working (?) and for your pycom node problems I sugest have a search on their forums (or here)

Did you have a look at your TTN console… ? is there data coming in when you transmit ?

Why are you using WLAN connection commands when you are working with LoRaWAN? You should look at the LoRaWAN example code for the PyComm products. (And probably read up on LoRaWAN)

WLAN in the gateway is just for setup. After the gateway has been configured it is disabled.

Yes, I did - the device shows on the Console as “never seen” and there is no data…When I debug the node script it never connects to the WiFi network…I wonder if I am trying to connect to the right one. The MINIHUB-80161B is no longer in the list of WiFi networks…but there are couple of Hidden WiFi Networks…

So you think your LoRaWAN node should connect to wifi …

@kersing we have a winner :partying_face:

Right, is your TTIG connected to TTN, if not restart with the setup of your TTIG. Read all the steps carefully and make sure the TTIG connects to your Wi-Fi network.
After these steps your gateway should show connected in the console. If it does not, stop and restart by reading the instructions and execute them again.

Next create a node program that does not do anything with Wi-Fi as a node does not connect to a gateway. Like I mentioned before, get LoRaWAN example code, it is available on the pycom site.

My TTIG indeed shows now as “connected” in the console.

My problem was that my LoPy Node was not connecting to TTN.
Apparently I had to change the channels: setting a different frequency for each of 8 channels.
So now I can see the device in TTN Console. However, connecting to LoRaWan is a bit flaky - I can connect 50% of the times I start the code with Update. The TTIG is 4m-4.5m away across the room…

My code is based on a few Pycom samples…In my particular case I have to connect to my WiFi network - I get the positioning data from MQTT Broker that runs on Raspi on my WiFi network and push it to LoRaWAN…

I have slightly different issue here. I was able to setup wifi correctly (verified by the IP address in my arp table) and now the TTIG has a fast green blink. Every couple of minutes it does red/green and then goes back to fast green blink.

Seems that it’s trying to contact the CUPS or something similar? We’ve reset it a few times, tried different networks (one that has a public IP address and not NAT’ed behind a router). We actually have two TTIG’s and they both experience the same issue (setup with two different people).

Any ideas on how to troubleshoot?

I do have a single channel gateway running on an RPI and that works just fine - so connectivity to TTN is working ok.

You’re not alone… So not related to setup but to network issues.
That your single channel is working is not related, TTIG uses a different system.

for further updates/info/experiences :

and watch the network status: