I am trying to turn off/on switches, etc. via my RPi at home.
I have a modem which supports port forwarding, but have failed with many attempts, due to having to have my main development device and RPi being on an IP address given to by my wifi router(and just having difficultly with routing). I originally wanted to simply run a bash command or similar to ssh and run a command on my RPi directly.
Coming from a PHP background, I have switched to a method of my RPi checking predefined Rest APIs on my remote server every few seconds, with me having the ability to interact with this API through my phone. When the RPi checks the API, if there are diffs compared to the locally stored values, it will consume those and act according to the new values.
Would you suggest I go back to the port forwarding, and risk the potential of getting my other devices compromised, or stick to this scheduled checking method?