Remote access duckdns

Hi all,
I want to use duckdns to have remote access to home assistant outside my home.
I try the configuration in the duckdns website:
mkdir duckdns
cd duckdns
vi duck.sh

then I put in duck.sh this:
echo url=“https://www.duckdns.org/update?domains=exampledomain&token=mytoken&ip=” | curl -k -o ~/duckdns/duck.log -K -

then i put in the terminal:
chmod 700 duck.sh
crontab -e
*/5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1

when i test the script with the command:
./duck.sh
i receive this:
pi@raspberrypi:~/duckdns $ ./duck.sh
curl: no URL specified!
curl: try ‘curl --help’ or ‘curl --manual’ for more information

I try then to connect via http://mydomain.duckdns.org:8123 but is not working.

Any idea o another solution?

Thank you and regards.

What’s the full path to your duck.sh?

Why not use the DuckDNS component. Very little setup and it worked flawlessly for me in the past.

I also try. I think that I use hassbian and not hassio.
I put in configuration.yaml this:

duckdns:
  domain: YOUR_SUBDOMAIN
  access_token: YOUR_ACCESS_TOKEN

save, reboot and try to log via mobileto http://yoursubdomain.duckdns.org:8123 but the answer is always the same: impossible to reach the page.

Any other idea?

Thank you.

Hi,
duck.sh is in the duckdns folder in home/pi

pi@raspberrypi:~ $ cd duckdns
pi@raspberrypi:~/duckdns $ ls
duck.sh
pi@raspberrypi:~/duckdns $

Thank you

Is port 8123 open?

In theory yes, i set manually port 8123 on my router. There is a way to check?

Sorry little update, i check and correct the duck.sh now looks like better but the same if i try to connect wia http://myaddress.duckdns.org:8123 is not working. Any idea?

● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-12-04 06:18:52 CET; 12h ago
Docs: man:cron(8)
Main PID: 367 (cron)
CGroup: /system.slice/cron.service
└─367 /usr/sbin/cron -f

dic 04 18:20:01 raspberrypi CRON[6514]: pam_unix(cron:session): session closed for user pi
dic 04 18:25:01 raspberrypi CRON[9496]: pam_unix(cron:session): session opened for user pi by (uid=0)
dic 04 18:25:01 raspberrypi CRON[9500]: (pi) CMD (~/duckdns/duck.sh >/dev/null 2>&1)
dic 04 18:25:01 raspberrypi CRON[9496]: pam_unix(cron:session): session closed for user pi
dic 04 18:30:01 raspberrypi CRON[12667]: pam_unix(cron:session): session opened for user pi by (uid=0)
dic 04 18:30:01 raspberrypi CRON[12671]: (pi) CMD (~/duckdns/duck.sh >/dev/null 2>&1)
dic 04 18:30:05 raspberrypi CRON[12667]: pam_unix(cron:session): session closed for user pi
dic 04 18:35:01 raspberrypi CRON[16062]: pam_unix(cron:session): session opened for user pi by (uid=0)
dic 04 18:35:01 raspberrypi CRON[16066]: (pi) CMD (~/duckdns/duck.sh >/dev/null 2>&1)
dic 04 18:35:10 raspberrypi CRON[16062]: pam_unix(cron:session): session closed for user pi

Go to https://yourexternalip:8123 This will check if the port is open, you should reach the home assistant frontend. (note: use http:// if you don’t have ssl setup)

Use a tool like Port Scanner to check. Enter your IP and the port, it should report as open.

Sorry again, how i can find my ip or my external ip?

I go to portscanner and automaticly the webpage insert the IP/ULR. I insert the port 8123 and click check and the answer is closed.

But sure I set the port 8123 in the port mapping of my modem.

You can google “what’s my ip”

You can also google dns lookup and use one of the many dns tools available to lookup your duckdns domain and it should resolve to your IP.

Finally, some modems will have this information available but this is very specific to the device so hard to say where to look bb

Does your ISP allow you to open ports?

I try again but still with port scanner the result is port 8123 closed. I can try to contact my ISP. There is another way to use home assistant from outside?

I have a vpn setup. My router acts as vpn server using openvpn. Only way to access my system is with a device tjat have the openvpn client installed with the correct cetificate installed, in my case my android tablet.