If no mesage is received for 10 seconds it alerts you. So from the PC send an MQTT message every 2 seconds.Ī device, could be the Raspberry Pi,"subscribes" to the messages. Let's say you need to know within 10 seconds of disconnection. Another possibility is a Raspberry Pi (a Zero 2W is fine) running Node-red & mosquitto and connected to one or other LAN. Cloud based services exist or I believe you can run your own Mosquitto broker on a Synology NAS. To monitor the connection, you can use MQTT. You can configure it so that the traffic all goes via Zerotier, which might give faster response when the IP changes. The changing public IP address doesn't matter because each device reaches out to Zerotier to join your virtual network. It sets up a private virtual LAN so for example the PC has IP address 192.168.192.10 and the NAS has address 192.168.192.11. Therefore you need a VPN of some sort to connect them together. OK so your PC and NAS are on different LANs. The question is do you know a program that i can run on my pc that is connected to a external server that can show me via some API the status of the said pc? I've tried with Spotify API but for a novice like me is a mess. I've tried ZeroTier API but it updates every 2-3 minutes, and that's too much. I've tried with Steam API, but even when the pc was shut down the status was always Online. I've tried using the teamviewer API to see wether the device is online or offline, but it updated my online status every 20 seconds circa (that's the time my pc in case of a short power outage needs to restart) so every time the pc shuts down for a second i see the status online and then the next request was made once the pc was already restarted, so useless. I have on my synology NAS a docker with Node-Red on it that every 5 second makes a GET request to a specific service that is running on the PC in question. Ok, the title may be confusing or not, but i have my PC that currently is in an appartment connected to the internet with a mobile router, so the IP is always changing, i've tried several methods, that kinda worked but not in the way i want.
0 Comments
Leave a Reply. |