pkauf Posted November 7 Posted November 7 I think this has been discussed before, but when Blue Iris server is auto updated and restarted, the Node Server stops working. A restart of the node server for Blue Iris fixes this. There was a solution to add code to possibly make it fix itself on a disconnect on a previous thread. I tried it, didn't seem to work (adding the suggested line makes the node server stay in disconnected state and won't connect). It appears this node server isn't actively being maintained. @bpwwer - I have seen you comment on others who would like the functionality of being able to restart a single node server either by a schedule or command line. I do understand your comments that it's just a band aid, but it would be nice to either have a real fix here, or this ability. You also indicated you are willing to help when the author might not be responsive or can't help (I believe the author here indicated they don't use Blue Iris anymore and can't test). Bottom line, any help here would be appreciated. I do code alot, I just don't use python, so I don't think I can easily figure out a solution . . . Thanks! Quote
Solution bpwwer Posted November 7 Solution Posted November 7 First off, my comments and reasons for not wanting to allow for automated restarts of node servers/PG3 are really because that tends to be used as a band-aid to handle poorly behaving node servers. The right way to do things is to get the node servers to not behave badly. In this case, the node server isn't really behaving badly, it's behaving mostly as intended. When it can't communicate with Blue Iris, it goes into a disconnected state and waits for someone to take action to resolve the issue. Now it could and should handle this better. It should try to re-connect, the code is mostly there, just not the logic to attempt that. In cases like this, where the author has pretty much abandoned the node server, I'll typically take a look if I have time. Unfortunately, I don't always have time to dig into someone else code to figure out how it works and what can be done to resolve any issues. You happened to ask at a time when I'm not real busy so I'm going to try and make some changes. Version 2.0.3 should try to re-connect when it fails to query the Blue Iris server. I have no way to test this. 1 Quote
pkauf Posted November 7 Author Posted November 7 I can test, just saw the new version - I will upgrade and let you know how it goes. THANK YOU VERY MUCH!!! I am like you, if I had a little time to understand python better, I would try to figure out what its doing. And, I TOTALLY agree with you on the band aid stuff, I hate at work when we don't find the real fix, I much prefer that as opposed to "we have a memory leak, let's reboot". 🤣 Quote
pkauf Posted November 7 Author Posted November 7 Hey, just curious - I installed new version , but on details it still shows 2.0.2 - but on the store, shows installed. Quote
pkauf Posted November 7 Author Posted November 7 I see this in the git.log file . . . error: remote origin already exists. fatal: a branch named 'master' already exists From https://github.com/UniversalDevicesInc-PG3/udi-blue-iris-poly * branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: blue-iris-poly.py Please commit your changes or stash them before you merge. Aborting ~ Quote
bpwwer Posted November 7 Posted November 7 Did you make changes to blue-iris-poly.py file at some point? The update process is failing because it sees that someone changed that file and it doesn't want to nuke those changes. There's a couple of things you can do - 1) revert the file back to it's original using 'git' commands. git checkout blue-iris-poly.py or rm blue-iris-poly.py; git checkout and then do the re-install via the GUI 2) delete the node server and then re-install 3) install the new version to a different slot 4) force git to update the files - git fetch origin master; git reset --hard origin/master The safest way is delete and re-install. Running git commands manually could end up causing problems for future updates unless you also make sure all the permissions/file ownership is correct. Quote
pkauf Posted November 8 Author Posted November 8 Yeah, there was a post to add a line at 122 to fix the issue. It didn't work (seemed to break the script). So I reverted it. I should have saved off the original to be smart, but I didn't. Ran the checkout, got this error (see below), but ran the suggested command, then the git checkout worked. Reinstall of 2.0.3 worked! Thanks for all of your help. I'll do some testing to see if it stays up now. [root@eisy /var/polyglot/pg3/ns/0021b9026669_2]# git checkout blue-iris-poly.py fatal: detected dubious ownership in repository at '/var/polyglot/pg3/ns/0021b9026669_2' To add an exception for this directory, call: git config --global --add safe.directory /var/polyglot/pg3/ns/0021b9026669_2 Quote
GTench Posted November 9 Posted November 9 @bpwwer Many thanks for doing this. Update did not work for me. I had to delete then reinstall to get your new version. I restarted IoX and the blue iris entry was there but I had to restart the plugin before it displayed a server status (green) I then updated blue iris to its latest version which forces it to shut down and restart. IoX plugin status then showed disconnected. I waited for a few minutes (maybe not long enough?) but no automatic reconnect, then clicked on the rediscover button in IoX. The plugin status then showed green. This was good because I can now hopefully use a program to do a rediscover if the plugin becomes disconnected. The rediscover button in IoX did not work for me in the older blue iris plugin. thanks Again Gary Quote
pkauf Posted November 11 Author Posted November 11 Seems to be working so far. My motion counts are now working, and is staying connected so far. @bpwwer - thanks again for doing this!! Quote
pkauf Posted November 15 Author Posted November 15 Well, it appears the fix didn't work. Blue Iris updated a day ago, and connects started failing. Waited a bit, but had to restart to get it working again. Quote
GTench Posted November 15 Posted November 15 I also noticed that the node server did not automatically reconnect but since the rediscover button now works, I use a program to do a rediscover if the node server becomes disconnected. I put a 1 minute wait in the program to allow the blue iris update process to complete Gary Quote
pkauf Posted November 15 Author Posted November 15 23 minutes ago, GTench said: I also noticed that the node server did not automatically reconnect but since the rediscover button now works, I use a program to do a rediscover if the node server becomes disconnected. I put a 1 minute wait in the program to allow the blue iris update process to complete Gary Will the program trigger when status is disconnected or failed or do you have to schedule it to check the status? I just know sometimes status aren't triggering events . . . Quote
apostolakisl Posted November 15 Posted November 15 Just now, pkauf said: Will the program trigger when status is disconnected or failed or do you have to schedule it to check the status? I just know sometimes status aren't triggering events . . . status is always a trigger when the status changes. Quote
pkauf Posted November 15 Author Posted November 15 6 minutes ago, apostolakisl said: status is always a trigger when the status changes. I agree it should be, but I know I've seen cases when it doesn't seem to work. Just making sure in this case. Thanks! Quote
bpwwer Posted November 15 Posted November 15 I had left a comment in the code wondering if it needed to perform a discovery after the reconnect. So maybe the answer to that is yes. I did add a log message that says it's trying to re-connect and it should log that every 30 seconds while disconnected. Do either of you know if that's happening? Quote
GTench Posted November 15 Posted November 15 @bpwwer don't know if this will help but I did a test where I stopped Blue Iris then restarted it. I attached the log file. Not sure if your message is there or not. Watching the AC blue iris screen, I noticed that the Server Status went to from Green to Disconnected after about 10 to 20 seconds or more. My program noticed this and after 1 minute the program did a rediscover. I noticed that the AC showed server status as green then went to disconnected than back to green 8 times and I got 8 emails saying it was reconnected. After that it stayed in the green state. Here is the program that I use to check for a disconnected state: Blue Iris Disconnected - [ID 002C][Parent 0001] If 'Blue Iris' Server Status is Disconnected Or 'Blue Iris' Server Status is Red Then Wait 1 minute Send Notification to 'Gary' content 'Blue Iris Disconnected' Set 'Blue Iris' Re-Discover Else - No Actions - (To add one, press 'Action') Here is the program that checks for reconnection: Blue Iris Reconnected - [ID 0052][Parent 0001] If 'Blue Iris' Server Status is Green Then Send Notification to 'Gary' content 'Blue Iris Node Server Reconnected' Else - No Actions - (To add one, press 'Action') Here is a screen shot of the connected server: BlueIris_11-15-2024_24248_PM.zip 1 Quote
bpwwer Posted November 15 Posted November 15 The log helped. I think I understand what's happening and I made another change to better detect the dropped connection and attempt to re-connect automatically. This change is in version 2.0.4 Quote
GTench Posted November 16 Posted November 16 @bpwwer I just installed that version by doing an update. It says version 2.0.4 but it says disconnected. A restart or start did not help. Should I delete and reinstall? Gary Quote
GTench Posted November 16 Posted November 16 Tried a Delete and Reinstall but still shows disconnected Quote
btreinders Posted November 16 Posted November 16 (edited) I am seeing the same with 2.0.4, just stays disconnected. The logs do not scroll anything either. Edited November 16 by btreinders Quote
bpwwer Posted November 17 Posted November 17 My fault, I added a syntax error which causes it to crash on start. Version 2.0.5 should fix that. 2 Quote
GTench Posted November 22 Posted November 22 @bpwwer the automatic reconnect works well for me now. Did a blue iris update which shuts it down, installs updates, then restarts it. The AC showed node server to remain connected through out the process. The AC server status went to disconnected then back to green when blue iris restarted after the update install. Thanks again for this. Gary 2 Quote
pkauf Posted November 22 Author Posted November 22 Awesome to hear. I'm out this week, but will install new version when i get back Monday. @bpwwer - really appreciate your help on this! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.