Vera - Smarter Home Control Forum

Advanced => Programming => Plugins & Plugin Development => Topic started by: tomtcom on August 05, 2018, 04:10:20 pm

Title: Code for Port Specification that is Persistent
Post by: tomtcom on August 05, 2018, 04:10:20 pm
Hello,

Using an Amcrest camera with an implementation file on this forum, it appears after luup restarts that the port does not retain. IP address is fine.

In this thread @guessed http://forum.micasaverde.com/index.php?topic=3698.0 has a reference to specifying the port. I cannot seem to lock down internet searches to do this.

The camera will not connect because the port is lost, this does not happen with regular Vera cams such as Vista cam. What can I add to the implementation file to have the port setting retain?

Code: [Select]
-- Get username, password and IP
lug_username = luup.devices[lul_device].user or luup.variable_get(CAM_SID, "Username", lul_device) or ""
lug_password = luup.devices[lul_device].pass or luup.variable_get(CAM_SID, "Password", lul_device) or ""
lug_ip = luup.devices[lul_device].ip or ""
Title: Re: Code for Port Specification that is Persistent
Post by: GaryTTirn on August 10, 2018, 05:07:07 am
Hi,

I have not used a nonstandard port (other than default 80) with Amcrest cameras but with some Foscam cameras that is needed as those listen to port 88, instead of 80.

In that case port is simply added to the camera IP address using a colon as separator.

IPADDRESS:PORT

This should also work with the current implementation file as the port becomes part of the ip-variable.
Title: Re: Code for Port Specification that is Persistent
Post by: tomtcom on August 10, 2018, 07:16:42 am
Thanks and I believe I used your instructions.

I'm well versed in the port and ip. I don't know why sometimes the port magically dissapears after a LuupRestart other times it does not.

When using the url in your pdf I add the port at the time of creation. It works for a while then the port just removed itself and I manually add it back in from the extra parameters page or even the variable tab.

I really don't know how else to explain the behavior.

When the port is there it works fine and even snapshots are saved to Vera's servers.

Sent from my VS995 using Tapatalk