That’s not up to him, it’s up to the people writing Basic Station, which could be you …
Reason for asking. I along with others have asked that question in the github issues and no response. Just wondered if htdvisser may have some idea. Not looking for any action on his part.
I would have a go but I’m not sufficiently versed in C to do this. I have looked a few times but could not figure out its architecture to understand how it would be added. I also came to the conclusion it’s not easy and the code may need some restructuring, otherwise it most likely would have already been done by now.
- Lean Design
- No external software dependencies (except mbedTLS and libloragw/-v2)
- Portable C code, no C++, dependent only on GNU libc
- Easily portable to Linux-based gateways and embedded systems
aka:
We kept things simple by omitting any design documentation and made all the filenames somewhat cryptic.
I think we can be almost 99.999% sure TTI have their hands full so any addition would be a community effort and it would be rather gateway specific as to what attributes it could send. It would certainly be nice to know if your gateway is cooking or has enough battery life when running on solar.
Maybe @Jeff-UK could make enquiries, particularly as he’s in to solar and a bit of status info may help him too.
There are other software options available…
Is that the one with the ‘challenged’ install script?
Exactly what I do. I have decided not to move to Basics Station until “status” is available.
Even though I bumble my way through writing C, I also send additional gateway data direct from the gateway to a database. Data elements include lorawan traffic (status) data, voltages & temperatures etc inside the gateway and environmental sensors located in close proximity and connected to the gateway.
Great feedback on Github, there is a way in Basics Station to create the “stats” message.
There is a more generic feature where a string of data can be injected from outside Basics Station into the gateway-server link.
For gateway status, all that is needed is another application to append an appropriately formatted string to a file name cmd.fifo and Basics Station will inject this.
Refer:
Health Status Messages? · Issue #46 · lorabasics/basicstation (github.com)
and
The discussion above got me thinking. Since the current default configuration for Basics Station does not send a regular status message, then I assume the load on the Network Server will reduce as gateways move to Basics Station.
Based on the operating experience of the public network, is there now a recommended (or optimum) time period gateways should use between each status message?
The move to V3 is an opportune time for this parameter to be adjusted on the existing gateways.
The same timing would apply to gateways running Basics Station where the stat packet is injected into the gateway-server link
I wouldn’t say the load on the backend reduces with more gateways on Basic Station. Maybe we don’t have to handle as many status messages as before, but with Basic Station gateways we now have to maintain TCP sockets and WebSocket connections. So the load is just different.
Handling status messages isn’t very resource intensive, so my recommendation would be: send it as (in)frequently as you need. If you just need to monitor when the gateway connects/disconnects, you don’t need to send anything, because the Gateway Server knows when the connection breaks. If you want to keep track of message counts on the connection, then that’s also already done by the Gateway Server (although it doesn’t aggregate message counts between different (re)connections for the same gateway). If you want to measure temperature or something, think about how frequently that would change, and find an interval that works for you.
I guess that for most gateways it will be fine to send such status messages every 1-15 minutes.
getting this error message on TTNv3 :
{“code”:7,“message”:“error:pkg/auth/rights:no_gateway_rights (no rights for gateway
eui-1234567890@ttn
)”,“details”:[{“@type”:“type.googleapis.com/ttn.lorawan.v3.ErrorDetails",“namespace”:“pkg/auth/rights”,“name”:“no_gateway_rights”,“message_format”:"no rights for gateway{uid}
”,“attributes”:{“uid”:“eui-1234567890@ttn”},“correlation_id”:“e658a0fff97e49d6bdeb94280a73e684”,“code”:7}]}
after launching the command for getting all the stats :
curl -i -H "Authorization: Bearer NNSXS.XXXX.YYYY" https://eu1.cloud.thethings.network/api/v3/gs/gateways/eui-1234567890/connection/stats
the API key has full privileges. It has been generated in the gateway page. I forgot to mention that I am working with a semtech pico gateway…
Is the Gateway ID the EUI?
Because it’s whatever you put in the Gateway ID field that’s needed, as per post above:
GET
/api/v3/gs/gateways/{gateway_id}/connection/stats
https://www.thethingsindustries.com/docs/reference/api/gateway_server/
thank you very much @descartes. I don’t know how I didn’t catch at the very first attempt…after replacing the EUI with teh actual gateway ID i was able to retrieve the curl call and to nest it in my existing script for checking the online status…
Kind Regards
@artynet are you able to share your curl script (and is it for windows?) as i heed to check the online/offline status of my gateways for my PhD project
Thanks
Hi,
I am looking for End device API - which would give the last seen of the device. Can someone please help if there is any such API?
Best regards,
Ganesh
Scroll up for a link to the docs or use the link bottom right corner of every console page.
I realize this is an older post, but I found it as I’m getting started with the REST API.
One basic piece of information I couldn’t find anywhere is the base URI when using your own Tenant with TTI. If it helps anyone else the base is: https://tenantid.nam1.cloud.thethings.industries/api/v3/
It makes sense this is what it would be, but when you are getting started you just want to confirm everything rather than guess and check.
Of course, my tenant is hosted in North America, so the nam1 part of the URI will change accordingly.
I’m using C#/RestSharp so my call is:
public class GatewayAccess : BaseClient
{
private RestClient _client;
public GatewayAccess()
{
_client = new RestClient(ApiBaseAddress);
}
public async Task GetGatewayStats()
{
try
{
var request = new RestRequest($"gs/gateways/{TestGatewayId}/connection/stats");
request.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(GetTTIApiKey(), Bearer);
request.AddHeader(HeaderAccept, MediaTypeAcceptJson);
var result = await _client.GetAsync(request);
Debug.WriteLine(result.Content);
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
}
You probably were looking for this:
https://www.thethingsindustries.com/docs/the-things-stack/concepts/server-addresses/
Includes handy entry of tenant id and region to give all the addresses in use.
Hi,
How can I check from a gateway eui (which is not mine) if the status is online? Like in the https://noc.thethingsnetwork.org:8085/api/v3/gateways back in the days?
A query like
Will give you a detailed set of stats including online status (true/false)
Just change everything after the =ttn,id= “toyourtargetname”
Other Forumites may give you a more narrowly crafted query just for the status, but I find this one useful on a regular basis
Many of which can be found with “packetbroker.net” in the forum search if you want to see some other combos now!