OTAA woes TTN Gateway and Lopy

I think my gateway is bad. I used a directional coupler and spectrum analyzer. When it boots up, I see two transmissions, one at 903.7 MHz, the other at 905.3 MHz, so down at the bottom of the band. They are very low in level, -25dBm. Since the output is supposed to be more in the +30dBm range, this is getting on for a million times too low in power… And that is really all I see.

I checked all the cables, right to the PCB, so it included the U.FL connector, and they are all okay. I guess it must be the Microchip module.

Why would you even expect any transmission? A LoRaWAN gateway only transmits when the backend server tells it to: for downlinks, including OTAA Join Accept messages. You should see it transmit a Join Accept 5 seconds (RX1) or 6 seconds (RX2) after the node has sent its Join Request. But then you should also see that information in TTN Console.

I really don’t know! I don’t see anything when the node does it’s join request. But every time the gateway boots I see those two transmissions at the bottom of the band. The lower one about 2-5 seconds after power up, the other one after about 30 seconds, and then nothing. Doesn’t the node need timing information? I guess I need to find out more about the physical and link layer stuff!

Nope. LoRaWAN is really about low power: a node transmits an uplink when it wants to, then goes into a lower power state and after a delay of RX1 (typically 1 seconds) tries to detect a downlink. If detected, it listens for the full downlink, if not it delays until RX2 (typically 2 seconds) and tries to detect a downlink again. If received or none detected, it goes to sleep (if your code is smart enough) until it wants to transmit again. More details at https://www.thethingsnetwork.org/docs/lorawan/

For OTAA, it sends a Join Request (uplink), hopes one or more gateways receive it and forward it to the TTN backend, and then expects a Join Accept response (downlink) after either RX1 (5 seconds for OTAA) or RX2 (6 seconds). Only if the backend has received and accepted the Join Request it will tell one of the gateways that received the Join Request to transmit such Join Accept.

For Class A devices, there are no other radio transmissions except for uplinks and optional downlinks at a specific interval after such uplinks.

Be sure to leave at least a few meters between node and gateway.

Yes, I left some space between them! I am not sure what to do next. If there was another gateway around, I could test with that, but I am a ways off from anywhere out here. When I received the gateway, about a year ago, I tried very hard to get it going, and had these sort of problems, so put it aside and I am only getting back to it now. I thought initially it was my lack of understanding, but maybe the gateway has been bad all this time.
I guess a lot of folks are at the conference right now, so not a good time! I’ll have to think for a while if I want to put out $$ for a second gateway… Looked around a bit, but I did’t see a source for the Microchip module.
Thanks for all the suggestions.

So what happened in Mar 2018?

Just to be sure: you looked at the gateway’s Traffic tab in TTN Console? (That’s different from the application/device’s Data tab.)

You’ll want two browser windows open, for both the application/device’s Data tab (which if TTN accepted the DevEUI, AppEUI and AppKey should show the Join Request, plus the assigned DevAddr, with an orange icon), and the gateway’s Traffic tab (which should show the Join Accept along with a green icon). If you see any output, clicking an item will show more details.

The gateway’s serial port output should also show things like:

LORA: Accepted packet
MQTT: Sending UPLINK OK

…and for the OTAA Join Accept, in the gateway that has been selected to transmit it:

MQTT: Received DOWNLINK

Or failures like:

LORA: Packet dropped! Bad CRC

(Which might certainly happen for radio packets from some other device.)

In 2018 the power supply died, I replaced it.

I have been watching the debug for a while occasionally see MQTT messages:
MQTT: Sending status packet
MQTT: Sending status succeeded: 7

The number is increasing… 7,8,9… etc.

And occasionally:
LORA: Kick LoRa module with ACK after not acked it for 60s

Apart from that the messages are all about stack and heap size etc., except for very occasionally:
LGMD:Rejected packet (0x11)

I haven’t seen a bad CRC yet, that would be something.

There must be something intermittent- it just started working:
image

And I now see huge transmit signals from it on my analyzer. I happened when I moved it from one bench to another- I had left the node running it’s join script. I did nothing except power the gateway down, move it, and power it up again- so all the EUIs etc were correct. It had to be something physical.

Just for completeness, this is the spectrum. It appears the node uses the upper half and the gateway the lower half of the band:
image

If you’re in the US, thats backwards. The node should be down around 904-905MHz and the gateway should be around 923-928Mhz. This is the channel layout for US915:

US902-928

Used in USA, Canada and South America

Uplink:

  1. 903.9 - SF7BW125 to SF10BW125
  2. 904.1 - SF7BW125 to SF10BW125
  3. 904.3 - SF7BW125 to SF10BW125
  4. 904.5 - SF7BW125 to SF10BW125
  5. 904.7 - SF7BW125 to SF10BW125
  6. 904.9 - SF7BW125 to SF10BW125
  7. 905.1 - SF7BW125 to SF10BW125
  8. 905.3 - SF7BW125 to SF10BW125
  9. 904.6 - SF8BW500

Downlink:

  1. 923.3 - SF7BW500 to SF12BW500
  2. 923.9 - SF7BW500 to SF12BW500
  3. 924.5 - SF7BW500 to SF12BW500
  4. 925.1 - SF7BW500 to SF12BW500
  5. 925.7 - SF7BW500 to SF12BW500
  6. 926.3 - SF7BW500 to SF12BW500
  7. 926.9 - SF7BW500 to SF12BW500
  8. 927.5 - SF7BW500 to SF12BW500

Ah, were node and gateway very close to one another earlier? That could cause problems too (including receiving a single Join Request multiple times on different frequencies, where TTN might choose the wrong one for the Join Accept); keeping them a few meters apart is usually recommended.

@afremont: Yes, I was just coming to that conclusion too. I wrongly assumed the higher level one was from the gateway! In fact I believe the power output from the gateway is very low. As you can see from the spectrum, some 40 dB or so less than the node. It should be at least 20dB more, I think. I think a lot (most?) of my problems over the last year have been due to the poor RF performance of the gateway.
I don’t see anything on the forum or the web more generally about getting the gateway repaired. I also could not find a source for the Microchip RF module that is in there, I assume it is the problem. So I guess if I want to continue on with this, I will have to put out the $$ for another gateway. The question is whether to risk another TTN gateway or go for a more expensive one… It seems Element 14 has the TTN gateway in stock.
I wonder if there is a simple procedure somewhere for verifying that the RF performance of a gateway is what it should be? Something like set up the gateway and node with standard whip antennas vertical, separate them by 100m with nothing in between them, and try to connect. Can the node report signal strength? Otherwise you need a spectrum analyzer with another antenna. Knowing the distances, one can calculate what the signal strengths should be. Is there a way to change the “Fair use policy” for commissioning/test purposes? Especially in an area with little activity.

Hopefully, you aren’t a victim of SMA vs SMAr connector issues. Not all SMA connectors are as simple as male vs female. Power down your gateway and remove the antenna. Make sure that you have a pin that is mating into a hole with the center connection. It’s possible that the antenna and gateway are without a pin meaning that it’s not actually making a connection, or that both have pins that are jamming into each other and creating a short with ground.

Yes, I thought of that. I carefully examined them, I have good stock of RP-SMA to SMA adapters and I have been bitten by that before! I also used an ohm meter to verify that the center conductor was continuous all the way back to the PCB where you can just probe the tab of U.FL connector on the Microchip module. I also verified it was not shorted to ground. But you are correct, it is about the right amount of signal loss you would expect from that.

I was looking at some GitHub issues and there are some complaints about the things gateway suddenly losing range. It seemed like it was more of an issue of sudden deafness and not reduced output power though. Do you think there is a possibility that it ever transmitted with no antenna installed? They always make a big deal about never powering up the SX1276 module with no antenna connected, but I don’t know why it would ever transmit without bring commanded to do so. Regardless, I follow their advice with all the node thingys that I’ve been working with and so far, it all seems to be working. I am using a Rak831 based gateway with a raspberry pi. That may be something you wish to consider if you’re going to start over. I think you can get a module from Amazon for a decent price, though you’ll likely have a hard time locating the adapter if you want to stack it straight on top of a raspberry pi without buying a whole kit that includes the pi.

I suppose I can’t rule out that it transmitted into an open circuit, although as an RF engineer I am usually very careful about that. Yes, the module does seem to be very deaf, I think I have established that. I am in a high lightning area and although there hasn’t been a strike close by in the last year or two, I suppose there could still have been enough of a transient induced on my antenna to damage the unit. I have a big external Laird antenna about 10m up in the air. I will re-check its swr before I connect anything new up to it.
Was your setup difficult to get going? I want to try and focus on applications rather than spending a lot of time getting a gateway functional. Originally I also wanted to help TTN with their Kickstarter campaign, I think they are trying an amazing venture. But I am a bit worried about the ruggedness of the gateway now.

Sounds like a lot of coax between the gateway and the antenna, what are you using for feedline? Getting me neither up and running correctly took longer than I wanted, but most of that time was learning curve as I’m new to the LoRa thing. It would appear that their (RAK) latest installation script might make things easier for a newbie because it factors in the intended region. Since I bought the US915 “kit”, I was a bit surprised to find it preconfigured for EU spectrum.

Most of the tutorials you find seem to make the same assumption. The whole key is getting the global and local json files right, and I can help you with that. I ended up not using the SD card that cane with the kit, so I had to download raspbian stretch light and go through that process. You gotta get the reset script toggling the right gpio pin too.

Kersing has a GitHub repo with a modernized packet forwarder, but I haven’t experimented with that yet. It helps if you have some Linux command line skills, but I’ve been using Linux for over 20 years, so… I think there are some other forks of the semtech stuff that have good setup scripts that ask questions helping you get everything right.

Once I got it figured out, it’s really pretty simple. You have basically two processes running, an interface to the gateway hardware and a somewhat abstracted packet forwarder. The install script sets them up to start as a system daemon.

I had the same intentions of concentrating on nodes, not getting the gateway working. In retrospect, I’m glad that I went through the pain as it helps me understand how all this works. I’ve played with a couple of different types of nodes now. I’ve gotten a bsfrance lora32u4 working and the Rak wisnode successfully sending and receiving. You’re going to find that’s not quite as straightforward as you’d think. I believe the firmware for the wisnode has been upgraded to better handle a us region, mine set the wrong channel mask, so it was way off frequency. I’ve only done activation by personalization (ABP) so far. I’m ready to step up to OTAA now, but I’m still experimenting, so ABP is easier for me. To get OTAA working, you have to have transmitting and receiving working, but ABP will let you get packets to the application without struggling with reception initially.

Using a Linux based gateway let’s you monitor the log files which helps a lot. I also recompiled the software with more debugging messages enabled.

Problems I had with the bsfrance board included having to struggle with the bootloader when trying to upload sketches (it likes to use two different com ports in windows), soldering up DIO1 (the default solder pads are fine, but most people seem to be obsessed with moving it to D6 instead of just jumpering the pads). They have reasons, but it’s not important enough to me to worry about it; I don’t mind losing Serial1. I will start using ISP from now on though as I’m tired of trying to time pushing reset at just the right time to get an upload via the bootloader working. As for the wisnode, don’t jump to the “obvious” conclusion that it’s an Arduino shield. You can use it that way, but you have to fiddle with jumpers every time you want to upload to the Uno or use jumper wires to get Serial debug messaged out. I’ve only used it by typing AT commands manually. It does work, but it’s not a panacea when you want to hook it to an Arduino Uno. It seems that most of the LoRa/Arduino boards have unique quirks to get them working. You almost always have to find some manual way to hook DIO1 to a pin before it will receive packets. I’m digressing, so I’ll likely get chastised for being off topic by discussing nodes in the gateway area, but I sure wish I’d have been able to find this information all in one place when I was learning it the hard way. :wink:

Well, that’s quite a bit to chew on! I will have to think if it mightn’t be easier to get another TTN gateway and see if it is any different from my current one. That has some attractive features, because I could move the Microchip board from one to the other, I guess. But having control of the code would be nice. What I would really like is some sort of test mode where the gateway chirped on each of its channels in turn so I could measure the power.

As for the coax, no, the gateway is right up in my walk-in closet! The coax goes pretty much straight through the dry wall to the gateway. So there is about 2m of LMR400 coax. (plus a gaggle of adapters to get from the N on the coax to the RP-SMA on the gateway!).

Antenna%20close

So far I’m satisfied with the rak831 based gateway. It might be overkill to have a raspberry pi dedicated to driving it, but I’m thinking that will come in handy with the new TTN V3 stuff coming. I’ve been completely satisfied with it’s reliability. It was up almost 3 weeks straight before I rebooted it because it wasn’t showing up in the console, but that turned out to be a problem with the web interface, not my gateway. It was forwarding packets to the application just fine.

There are some utilities included with the software, but I haven’t played much with them. One, I believe, is for doing what you mentioned, forcing the transmitter to put a signal out.

Rak has some new stuff out that looks appealing. One is a kit for outdoor use. It’s waterproof and has a LoRa module that appears to put out a more powerful signal.

I find their web site a little hard to navigate! I don’t think it will work, it looks like they require a physical LAN connection. From where my gateway is I need it to connect via wifi, which the TTN gateway was able to do with no problem. In fact, their web based setup was super easy. So I am leaning with going with another TTN one. I was looking, it has actually been two years since I put it up first. Time flies.
I would like to hear how your flood project goes. My email is w0run dot gordon at gmail dot com.