Closed Adammantium closed 5 months ago
Lets try something in the log there is a push notification UID: [PUSH_NOT_ID_2]
that UID is something we generate when registering
Can you run this command in the terminal (assuming you have curl installed)
curl -X GET 'https://pushx.reolink.com/listeners/[PUSH_NOT_ID_2]/devices' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept: */*' -H 'Accept-Language: en-GB,en; q=0.9' -H 'Cookie:'
It will ask reolink to report on all cameras registered with that push id, so we can see if reolink unregistered it
Success should look something like this
{"status":{"code":0,"detail":"OK"},"data":[{"uid":"UID","secret":"CHARS"}]}
Seems to work fine:
{"status":{"code":0,"detail":"OK"},"data":[{"uid":"uui of cam 1","secret":"..."},{"uid":"uuid of cam 2","secret":"..."}]}
I can send you the uncensored stuff via mail if you need it.
I just checked pi hole and i can see the server is definitely doing something: Nothing in the neolink log, but its pulling the pushx domain.
Edit: nvm... it was the command i executed, but at least the domain isnt blocked.
Then I'm not quite sure. Perhaps I am meant to reregister the FCM from time to time, but I havent seen anything to indicate that I should do that
If you send me like a curl command i can try sending it manually via cron and ill see if that helps. The google domains are contacted successfully when starting:
Most of this I just delegate to https://github.com/RandomEngy/fcm-push-listener
Can you tell if the socket to mtalk.google.com:5228 is kept open?
Seems like its open:
tcp ESTAB 0 0 192.168.178.10:52676 108.177.15.188:5228
tcp ESTAB 0 0 192.168.178.10:52690 108.177.15.188:5228
Do you know if you are in the connected or disconnected state? When you get a push notfication, perhaps it dosent' send if the camera says we are connected to them
I will check it again, we just got some new cameras, i will try it with them so i dont have to run outside the whole time :)
Okay, so, i just did some testing, the notifcations didnt work at first while it was connected, it looked like motion stayed off, wenn the cameras disconnected and i waved infront of cam 3, it reconnected cam 1 and updated the notification on there, cam 3 stayed disconnected with the old notification.
Okay, now its not working anymore at all, i left it disconnected for 30 minutes. No camera is waking up now, but the notification on the phone still works. The sockets are still open and connected as well.
So basic things to ask.
neolink/camname/query/preview
message
- Has the last will been sent (offline on the neolink/status)
neolink status is on connected
- is there anything in the log about any threads stopping?
Nope, nothing, last message is the shutdown stuff:
Okt 05 14:09:04 srv neolink[1511486]: [2023-10-05T12:09:04Z DEBUG neolink::common::neocam] reolink3: Idle
Okt 05 14:09:04 srv neolink[1511486]: [2023-10-05T12:09:04Z DEBUG neolink::common::neocam] reolink3: Disconnect On Request
Okt 05 14:09:04 srv neolink[1511486]: [2023-10-05T12:09:04Z DEBUG neolink_core::bc_protocol::connection::bcconn] BcConnection::shutdown Cancel
Okt 05 14:09:04 srv neolink[1511486]: [2023-10-05T12:09:04Z DEBUG neolink_core::bc_protocol::connection::udpsource] UdpPayloadInner::new SendToSocket Cancel
- does it reconnect when you use mqtt explorer to post the
neolink/camname/query/preview
message
Yes, this works perfectly fine, will immediately connect the camera and update the preview. It wont update the notification nor will it fix the issue with waking up, it will still not wake on notification as soon as its disconnected again.
Sure I just wanted to check if the wake up was broken, these sort of question help narrow down the source. So if I an understanding this right it just wakes up one of the cameras? Perhaps I need to change the push UID to be unique for each camera or do it from a central interface
So in summary:
neolink/reolink3/query/preview
it will wake up the correct camera and update the preview.Maybe you dont need different UIDs for each camera and the push notification. It seems like the notification itself contains the UID already, so you can probably determine the camera this way. I dont know if its already using that.
Yes thats the alternative to create central fcm receiver and pass the messages to the right camera. Would be a larger refractor though and would mean also storing the UID somewhere in the camera data which I don't actual do atm. So going to make them unique first
Do you think it might have something to do with my setup? If you want i can do some more testing before you rewrite your code, just to be sure.
I just restarted neolink and tested again, now camera 2 reacted to motion of camera 3. So its probably the last socket that got connected for push notifications that will handle all notifications.
Im going to put in the work to make a central push notification receiver since I want only the one config file and having it read/write by three different threads at once is just asking for race errors.
I really appreciate the effort
Can you see if this one works for the push notifications I think it is but need extra tests
It seems like I can't download the builds anymore. The builds on the buttom don't let me click them anymore. Can you send me a direct link to the amd64 linux file?
Okay, i was able to download it from my phone. I will test it later today :)
Have to be logged in to see a download link so maybe it was that. Or maybe it wasn't built yet. Sometimes I send a link while building, usually when I need to do something else and don't have time to follow up.
Yeah, i wasn't logged in. That was probably it.
I tested the version, and the issue seems to be the same. After about half an hour the cameras dont wake up again, no messages in the console. I'm currently not at home so I can't check MQTT directly.
I will do some more testing in about 6 hours.
I haven't completely tested if its waking up the correct camera yet. But from what i was seeing inside the log, it seems to be working.
Okay, i tested it some more. So its waking up the correct camera that triggered the notification and its only updating the notification on that specific camera in MQTT. But its still not waking them up if they have idled for like 30 minutes. No messages inside the log as well.
Just tested the Neolink 0.6.3-rc.1. It seems to be working and is waking up the cameras on notification now. But it also wakes them up every few minutes draining the battery. Is there a option im missing?
I noticed that too. I think it's the re-re-registration of the push notifications. Think of got it fixed on my testing branch but haven't had a chance to actually test it.
Let me know if you need someone to test it
Sure try this build
Just tested the build, it still wakes up the camera every few minutes without a notification. Seems like the reregistering of the notification will receive the last notification the camera send. So its waking up the camera again, maybe you need to remember the timestamp or something from the last notification and only wake up from a notification if its not the same as the last one.
We cache the uid of the notification to filter them. But Perhaps it's in the notification part further down if it's restarting because of an error.
I checked the log, I can't see any errors. I'll send it later
Any update on this? Seems like the current master branch is pretty solid. Sometimes I'm having the issue that a few cams keep getting activated. It seems to happen as soon as the first notification comes in, it will always trigger with the same notification, even hours after the specified Alarm Time inside the notification. It just seems like its getting stuck with that one notification. Maybe it's not getting dismissed and it keeps to be sent to neolink? Is there a way to clear the notifications?
Edit: Seems like its the same issue as in #235. I wouldn't mind waking up my cameras every hour or so, maybe we can make the delay configurable for now?
I actually have a fix in on another branch. I'm just waiting on some reports from other users about stability
What branch is it? I would be happy to test :)
Edit: I will be using the fix/argus3_disc
branch, just has a lot of logging :D
I think the argus3_disc does indeed have it. Just be aware that the docker on that one has been modified to record memory profile data and only runs for half an hour on docker at a time.
For the last day it was working flawlessly. The cameras woke up on movement and my push notifications through home assistant where pretty much on point. There was no high battery drain, they even charged by 2-3%. I will reopen this ticket if the issue comes back, but for now i consider it solved!
Thank you 👍
Update: Still running perfectly fine, no restarts needed, no battery drain
Describe the bug Hello, its me again, sorry to bother you again. I had a issue with the cameras not going to idle a few days ago, now i have to opposite issue. The notification waking doesn't seem to work properly. If i start the program it will work for half an hour or something, but then it wont wake up again. I also tried resetting the
neolink_token.toml
with no change in behaviour.To Reproduce Steps to reproduce the behavior. Example:
[mqtt] broker_addr = "127.0.0.1" # Address of the mqtt server port = 1883 # mqtt servers port credentials = ["main", "qnuVMFNj0sfkGOgUhCgmJnGNofAYQV"] # mqtt server login details
[[cameras]] name = "reolink1" username = "admin" password = """ uid = "" address = ""****.151" stream = "both" idle = true discovery = "local"
[[cameras]] name = "reolink2" username = "admin" password = """ uid = """ address = ""****.157" stream = "both" idle = true discovery = "local"
[cameras.mqtt.discovery] topic = "homeassistant" features = ["camera", "ir", "motion", "battery"]