Any suggestion on how to monitor and log the operation of a Pygate?
Would it be an option to monitor the operation of the Pygate by running a script on it that sends every minute or so a small message to a ThingSpeak channel (over the internet)? Will that interfere with the Pygate gateway script that is running in the background? Or is there any other way to monitor and log the operation of a Pygate?
That would help in two ways: (1) It helps to find out if LoRa messages are lost because the gateway (or its internet connection) failed, and (2) it would allow an easy monitoring of several gateways (e.g. by plotting in ThingSpeak the received ‘check’ messages received from the gateways the past 24 hours (or longer) versus time, one can get an overview at once).
When running tests with a lopy4 end node that is sending every 20 minutes a payload through a nearby Pygate that is connected via an Ethernet cable to the internet (with messages forwarded to ThingSpeak via TTN), I noticed that some messages never arrive in ThingSpeak. That shouldn't be the case as end node and gateway are only 5m away from each other. It could be that the internet connection failed for some time. But there are of course many other steps that can fail (script on the lopy4 end node, or problems at TTN or at Thingspeak). So I need to find out where the problem is.
@Gijs Thanks a lot! I was now able to implement it with Node-RED querying the TTN Gateway API as you suggested, and sending a Telegram message whenever the status of the gateway changes from on-line to off-line or vice versa. The link you provided gave me the script needed in Node-RED. And the following YouTube video showed me how to set up a Telegram bot: [https://www.youtube.com/watch?v=HsM4CbMGWmU&ab_channel=ElectricalEngineering](link url).
It took me a while to also realize that you need to specify your personal chat ID in the Telegram Payload node in Node-RED. Once I did that, it worked like a charm.
what you mention could indeed be a solution.
It is also possible to use the TTN Gateway API (I made some thing for this last week, its not very polished but gets the job done) to check if the Gateway is still receiving messages. A quick google search landed me here: https://tinkerman.cat/post/monitor-your-ttn-gateways-with-node-red/