Send local gateway data as payload to TTN

We are attempting to send the gateway’s temperature, battery voltage, and a few other “sensor” style data via as LoRaWAN payload to the TTN network and preferable have it show up as a device.

Is that possible without adding a 2nd LoRa radio module to the gateway, just to have it send to it’s self.

We are using the Semtech Packet Forwarder.

Can you do it, yes with additional software. Should you do it, no. TTN is meant to handle LoRaWAN data packets, not other IoT traffic. TTN is not an end point anyway so why not send the information directly to the real end point where it can be processed.

If you decide to use a second radio module (making the gateway also a node) then make sure to place the antenna for that part at least 3 meters away from the main antenna as it will otherwise have huge impact on the performance of the gateway.

3 Likes

I’d agree that generally you shouldn’t send this gateway metadata via TTN.

A “real” gateway deployment should include a remote management solution anyway, and that’s probably a better place for your monitoring feed. Especially as you have a chance of using an independent feed of information to get an idea of the nature of the failure, if you stop getting any node data through TTN servers (ie, the servers might be the problem).

If you really wanted to make the gateway be a node, rather than messing around with a second radio you could just calculate a packet as if it had come from a send-only ABP node (at a fast spreading factor and moderate power) and inject it into the backhaul scheme. Arguably slightly abusive, but in no practical sense any moreso then having the box send data to itself by radio. In any practical sense, less abusive as it won’t consume any shared radio-related capacity. (If you were going to use a radio chip, have it feed a 50 ohm resistor instead of an antenna)

But you’re probably not going to find much willingness to help with doing this, as it looks too much like (and practically helps with) the misguided question posted about every other month of “how can I make the output of my Ethernet connected sensors look like it came from LoRaWAN nodes” and we definitely do not want people doing that.

So, report your gateway status through an independent channel, probably connected to whatever you chose to use for remote administration.

2 Likes

I think very often folk are wanting to put a gateway in a location where they also want sensors. Duplication of the hardware is ludicrous and abusive (waste of RF time, waste of power/carbon footprint). They may also not want to have the overhead of an independent channel, the software and problems associated with that. So injecting packets is the logical, if service-abusive way, to do this. If my application is to map location temperatures, and one of the locations is the gateway, and my sensors are normally porting data via an MQTT output, of course I’ll make use of that rather than SSH in, run a web server and open more ports, or write another app for it.

It is not as it requires the overhead of a LoRaWAN compliant node stack (receiving, transmitting and MAC command parsing) to be able to do so. You also need to modify the gateway software to recognize the ‘special’ nodes and to redirect downlink data to them in stead of transmitting it into the ether.

A waste of engineering efforts as there are far better ways to move IoT data over IP without the need to open any additional ports on the gateway.

Part of the problem is there’s a distinctly prickly response (as I see it) on these forums rather than guidance, or examples. “Find a better way” rather than “here’s how others have achieved what you’re looking for”. TTN claims to be friendly to non-professional users and for building communities, but the community can be distinctly hard to bother with at times.

1 Like

The idea is interesting, but it just feels a bit weird to “shoe-horn” this into a LoRaWAN stack.
A gateway is already connected to the internet. I would just send it over the internet and bypass LoRaWAN/TheThingsNetwork entirely.

Something like the myDevices Cayenne dashboard has a HTTP REST API too.
You could write an application (that can be run basically anywhere there is internet connectivity) that forwards the data to myDevices Cayenne. I have (Java) code for that at:

You could also do the same in Python, perhaps even run it directly on the gateway itself.

You’re welcome to share your experiences and add any guidance for others.

The TTN forum is by users for users.

There’s no paid staff doing product support or writing articles and guides here, everything is done by volunteers, which includes the moderators.

Unfortunately most users only come to take. A much smaller group actually shares and contributes.

Often takers hardly do any reading but do expect instant answers and good advice from other users, because they have an ‘urgent problem’.

Very often the same questions are asked over and over. Questions that have been answered many times elsewhere on the forum already (and hence become tiresome). Asked again and again because those users don’t bother to read and search for information that is already available and answers already given. Sometimes they are even too lazy to read the post right above their own.

Based on your above remark I wonder, are you a taker or a contributor? (“These forums” tends to the first.)

1 Like

There’s a reason for that - no one has - because it’s not just non-trivial, it’s very complex.

The quick win for your need to put the data through the gateway is a low cost device without an antenna (put a 50Ω resistor in place). For more comprehensive sensing, as observed, you have an internet connection, so send the data straight to your endpoint.

To hijack the LoRaWAN feed you will need to build some software that replicates being a device with all the authentication & encryption as well as the protocols for command & control. You’ll then need to feed that in to the right point of the gateway software such that it thinks it has come from the radio. And have the gateway store enough information so that it knows to relay any downlinks to this faux-device.

Here’s some code you can adapt for a device:

And here’s some code you can adapt for a gateway:

And here’s the specification for LoRaWAN 1.0.4 which is what will be in vogue by the time you’ve got something working:

https://lora-alliance.org/resource_hub/lorawan-104-specification-package/

You may spot that one of the posts above about adapting the gateway software is by someone who has actually written gateway software, so it would be fair to say he’s well informed on that area.

So whilst it may seem we are being a bit snooty about the idea, but this is a bit of a recurring theme which, sadly also has the recurring theme of no-prior-research.

If you came back to ask a specific question I’m sure we will be happy to help, but until we know that you know what you are getting in to, those that do know what you would be getting in to have more practical questions to answer on here.

We’d be happy to see you prove us wrong if you want to get started and give us progress reports.

That is probably directed at my response so I’ll reply.

Do you think your message is encouraging to someone who’s trying to help and support this community for over 5 years? And has been answering basically the same questions for about the same amount of time? Including ones on injecting data into the packet forwarder?

Thank you for seeing that the attitude was the problem.

I was pretty turned off by the “find a better way” response, since I was only asking a question. A suggestion of what that better way was, would have been nice, but you can’t expect help from response like that.

This response turned me off from the TTN community until the last week or two.

Well to be honest with you I searched and didn’t find a solution. You could have given me a solution but instead you decided not to!

Next time, please try to help people and not be snarky. If you have seen the same question over and over again, then just skip it and move on to the next one.

Could you change that to perceived attitude? I posted a honest reply while busy and not being able to spend more than a minute on it, trying to help you.

Sorry for not taking half an hour out of my busy schedule to help you out more. Yes, that probably rates another ‘snarky’ qualifier, however you can’t image the amount of time the few volunteers taking time to try and answer questions (in stead of asking and lurking) spend on the forum.
By keeping replies short and expecting people to come back with targeted questions I try to help out more people than I would otherwise be able to. The alternative is questions going unanswered which gets people upset with the community (forum) as well.
In the end whatever I do there will always be people that take offense so I rather try to help. I’m sorry if that wasn’t the message you received.

You asked a question and a subject matter expert gave his response - which included what the better way was (TTN is not an end-point or dashboard, so send the data over the internet to your end-point/dashboard) - so what’s the beef here? Is it that you didn’t get the answer you wanted, which was a gift wrapped GitHub URL to install?

No, actually, Jac couldn’t give you a solution as one doesn’t exist that fits your requirements, so he didn’t choose not to give the solution. But even if he did have a solution, who are you to expect to have one provided free, gratis & for nothing?

You may well find that the moderators spend an awful lot of time answering questions and, as moderators we sort of have to read all the posts and for topics that re-occur we do tend to answer them, sometimes with a slight rebuff of “search the forum”, so we don’t end up with lots of posts about the same damn thing because no one has searched the forum or has the faintest clue about what they are asking for.

As @bluejedi alluded to, this is a community - you wouldn’t turn up in a new town, go “Ta Da” and expect free drinks in all the bars without someone saying “that’s not really how we get acquainted round here”.

I can’t see how this can end well so I’ll call time on this.

I’ll add my 2¢:

I’m a bit more direct than my patient co-moderators, so fasten your seatbelts…

First, we do not tolerate such mood-making (your above response and the one you responded to) here on the forum.

Dude, get a life…

If you would have paid € 200 hourly consultancy fee, together with a clear agreement, then maybe there would have been something to demand from your side.

You already got much more information than what you asked for.

Is that possible without adding a 2nd LoRa radio module

The only good answer here is: No, not possible. (no more, no less).

A: Better work on your attitude and don’t tell others what to do.
B: You appear to have a problem differentiating between an honest factual answer to your question and a snarky response. Possibly because you did not get the information that you did not ask for.

If you have seen the same question over and over again, then just skip it and move on to the next one.

You appear not interested in the monthly most valued user contest. Tip: don’t push it.

If an honest factual answer to your question already turns you off for 9 months then be prepared for more disappointments.

You could have given me a solution

We don’t provide solutions but help steer people in the right direction.
This however is only possible when the following requirements are satisfied:

  • You need to ask the right (specific, targeted) questions.
  • You need to provide sufficient information about your case.

We don’t do miracles and we don’t have crystal balls.