Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/push notification #85

Merged
merged 8 commits into from
Oct 28, 2023
Merged

Conversation

QuantumEntangledAndy
Copy link
Owner

@QuantumEntangledAndy QuantumEntangledAndy commented May 19, 2023

This tracks the RE of the push notifications that the mobile clients use
for motion detection.

In addition it also exemplifies some of the rest api commands that mobile uses

If interested please read crates/pushnoti/README.md which has current progress
and updates

https://github.com/QuantumEntangledAndy/neolink/blob/feature/push_notification/crates/pushnoti/README.md

@QuantumEntangledAndy
Copy link
Owner Author

Success:

Finally got it to work.

[2023-05-19T08:05:44Z INFO  pushnoti] Listening
[2023-05-19T08:06:59Z INFO  pushnoti] Message JSON: {"data":{"SRVTIME":"2023-05-19T08:07:03.566Z","ALMNAME":"Motion Alert from Cam01","sound":"push.wav","CHNAME":"Cam0","messageType":"alarm","DEVNAME":"Cam01","pushVersion":"v1.1","UID":"REDACTED","ALMTYPE":"MD","ALMCHN":"1","alert":"Motion Alert from Cam01","title":"Camera Alert"},"from":"743639030586","priority":"normal","notification":{"title":"Camera Alert","body":"Motion Alert from Cam01"},"fcmMessageId":"REDACTED"}
[2023-05-19T08:06:59Z INFO  pushnoti] Persistent ID: Some("REDACTED")

@QuantumEntangledAndy
Copy link
Owner Author

Here's there json message format:

{
    "data": {
        "SRVTIME": "2023-05-19T08:07:03.566Z",
        "ALMNAME": "Motion Alert from Cam01",
        "sound": "push.wav",
        "CHNAME": "Cam0",
        "messageType": "alarm",
        "DEVNAME": "Cam01",
        "pushVersion": "v1.1",
        "UID": "REDACTED",
        "ALMTYPE": "MD",
        "ALMCHN": "1",
        "alert": "Motion Alert from Cam01",
        "title": "Camera Alert"
    },
    "from": "743639030586",
    "priority": "normal",
    "notification": { "title": "Camera Alert", "body": "Motion Alert from Cam01" },
    "fcmMessageId": "REDACTED"
}

@franciscofsales
Copy link

@QuantumEntangledAndy this is a must for battery based cameras, I could try to help, what's missing from this PR?

Thanks

@QuantumEntangledAndy
Copy link
Owner Author

  • Work up a way to fully disconnect and reconnect from the camera in mqtt
  • Bring in the push notifications code
  • Hook those two up

@QuantumEntangledAndy
Copy link
Owner Author

The PR here atm is more of a proof of concept. It has a demo crate that is used to setup and listen for push notifications. So it's not hooked up to the rest of the code yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants