Edgebridge

TAustin,

I was not able to make the server run using CFG file.
It works only if I do a CD into PY file before run it.

  1. CD into edgebridge.py path;
  2. python3 edgebridge.py

That is to be expected. The configuration file is looked for in the current working directory.

Perhaps a command line option to specify the config file location could be an enhancement I could make.

Or set an environment variable.

1 Like

My response comes very late, but I hope it might still help at least someone potentially in the future. I had this exact issue, and it was caused by the changed hub address. I also tried deleting the reg file and “resyncing” by changing the LAN-trigger device address in ST back and forth to create a new reg file, but it kept setting the old hub IP and PORT every time.

Removing the LAN-trigger device from SmartThings and adding it again fixed the problem.

Question to @TAustin, is it possible to sync the LAN-trigger edge driver with the new hub IP and PORT after it has been added in any way, maybe even from ST API? Or is it possible to query the new IP and PORT somehow, and then manually update the reg file (or make a script do it), to avoid needing to remove and add the device in ST and update all rules. My issue is that the router is controlled by my ISP and I don’t know how to set a static IP to the ST hub.

Just so I understand - the situation you are trying to deal with is when the IP address for SmartThings hub itself changes? What about the PC running edgebridge, is its address also changing?

No, only the ST hub IP changed. The IP of the system running edgebridge, and the system sending LAN trigger messages through edgebridge to ST remained same. Edgebridge Monitor showed “online” all the time in ST, and also the LAN trigger devices in ST showed “online” in ST all the time (because the IPs in ST (set by user) were correct.

OK thanks. Let me think about a way to address this.

Thanks, I now switched to MQTT broker + your MQTT Device edge driver. I believe that it should not have the same issue since MQTT uses publish/subscribe model, do I understand right?

Great work by the way!

Yes, using MQTT is a good way to go and will hopefully work better for you.

I have a question, though, regarding the issue you were having. Do you happen to know if your hub restarted when its IP address changed or is it possible that its assigned IP address changed “dynamically” and there was no restart? The reason I ask is because if the hub restarted, it would be restarting the drivers. In which case the LAN trigger driver would be re-registering with edgebridge. But if that’s not happening and a re-registration never took place, then I can see where the registrations could then become invalid since they are still pointing to the old hub IP.

Would you mind direct messaging me the contents of your .registrations file?

Can I see somewhere in logs if the ST hub restarted? At least I didn’t restart it and there was to my knowledge no internet interruptions or power cuts. So if it didn’t restart by itself for some reason, I think it may not have restarted. I don’t know why the IP had changed though, it hadn’t happened before.

Unfortunately, I already deleted my reg file. But I tried recreating it many times (by changing device settings) and it created a reg file with hub IP 192.168.1.12 (old one), whereas the new was 192.168.1.25 (same subnet). Recreating the device changed it to the new one. I hope this helps.

I have a QNap TS-453 with 8gb memory do you think I will be able to do what you have done and do you have any more details to share that would help with this?
I also have a smart things hub from Aeotec so I’m not sure whether this could be used instead.

@hokkanen

Not in the Edgebridge logs. If you were running in debug mode and you were using the Edgebridge monitor device, then it might be possible to infer an interruption on the hub side. With the new advanced app, it doesn’t show hub reboots like the old IDE did, which is a real bummer.

Let me know if you were able to get things going again or need some further help.