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

Unable to connect to mqtt broker #2

Closed
jokerigno opened this issue Jun 30, 2019 · 16 comments
Closed

Unable to connect to mqtt broker #2

jokerigno opened this issue Jun 30, 2019 · 16 comments

Comments

@jokerigno
Copy link

Hi,

I’ve installed the docker container, created a config file and run it.

Gifs are created. But there’s no mqtt message. I’ve using mqtt explorer to look for the topic but there is no message.

Here is my config


{
  "data_folder": "",
  "mqtt_server": "xxx.xxx.x.xxx",
  "mqtt_port": 1883,
  "mqtt_user": "xxxxx",
  "mqtt_pwd": "xxx#xxxxxx",
  "mqtt_base_topic": "cameras/gifs",
  "ffmpeg_working_folder": "./gifs",
  "synology_base_api_url": "http://xxx.xxx.x.xxx:5000",
  "synology_user": "xxxxx",
  "synology_password": "xxxxx",
  "synology_cameras": [
    {
      "id": 2,
      "skip_first_n_secs": 5,
      "max_length_secs": 5,
      "scale": 320,
      "topic_name": "veranda"
    },
    {
      "id": 3,
      "skip_first_n_secs": 7,
      "max_length_secs": 10,
      "scale": 640,
      "topic_name": "balcone"
    }
  ]
}

can ypu please support me?

@fabtesta
Copy link
Owner

The problem is that mqtt credentials are unused in code 😅. I'll fix the code in the next few days.

@jokerigno
Copy link
Author

One is glad to be of service. BTW thank you for this solution as will help me protect my house while on vacation

@fabtesta
Copy link
Owner

fabtesta commented Jul 1, 2019

@jokerigno , the analysis was too raw and indeed the creds options are used in code and are working for a test broker that I have bring-up with authentication needed. You should check if your broker is compliant to MQTT v3.1 protocol for auth credentials to work.

@fabtesta
Copy link
Owner

fabtesta commented Jul 1, 2019

See

self.mqtt_client.username_pw_set(username=self.config["mqtt_user"], password=self.config["mqtt_pwd"])

@jokerigno
Copy link
Author

well my docker container is created using this image:

https://hub.docker.com/_/eclipse-mosquitto

and in the description I've found "Eclipse Mosquitto is an open source message broker which implements MQTT version 5, 3.1.1 and 3.1" so it my opinion it should be compliant!

There's some particular config that I have to use on it?

@fabtesta
Copy link
Owner

fabtesta commented Jul 1, 2019 via email

@jokerigno
Copy link
Author

yep. In mqtt_server field.

@fabtesta
Copy link
Owner

fabtesta commented Jul 1, 2019

Could you post the container logs?

@jokerigno
Copy link
Author

Here's the log from your container:

[2019-07-01 16:53:06] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:06] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:06] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:06] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:53:16] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:53:16] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:53:16] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:16] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:16] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:16] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:53:16] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:53:16] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:53:16] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:53:16] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:53:16] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:16] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:16] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:16] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:16] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:16] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:53:26] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:53:26] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:53:26] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:26] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:26] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:26] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:53:26] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:53:26] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:53:26] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:53:26] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:53:26] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:26] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:26] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:26] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:26] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:26] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:53:36] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:53:36] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:53:36] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:37] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:37] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:37] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:53:37] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:53:37] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:53:37] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:53:37] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:53:37] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:37] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:37] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:37] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:37] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:37] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:53:47] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:53:47] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:53:47] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:47] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:47] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:47] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:53:47] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:53:47] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:53:47] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:53:47] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:53:47] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:47] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:47] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:47] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:47] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:47] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:53:57] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:53:57] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:53:57] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:57] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:57] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:57] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:53:57] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:53:57] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:53:57] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:53:57] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:53:57] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:53:57] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:53:57] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:53:57] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:53:57] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:53:57] [INFO] (MainThread) Event 13 already processed
,[2019-07-01 16:54:07] [INFO] (MainThread) CameraMotionEventHandler  poll_event 2 veranda_camera_di_adele
,[2019-07-01 16:54:07] [INFO] (MainThread) Start getting last camera event for camera 2 veranda_camera_di_adele
,[2019-07-01 16:54:07] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:54:07] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=2&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:54:07] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:54:07] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-01 16:54:07] [ERROR] (MainThread) Event 7 already processed (277, '2', 685, '2019-06-29 21:09:08.382933')
,[2019-07-01 16:54:07] [INFO] (MainThread) Event 7 already processed
,[2019-07-01 16:54:07] [INFO] (MainThread) CameraMotionEventHandler  poll_event 3 balcone_cucina
,[2019-07-01 16:54:07] [INFO] (MainThread) Start getting last camera event for camera 3 balcone_cucina
,[2019-07-01 16:54:07] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-01 16:54:07] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=List&version=4&locked=0&reason=2&limit=1&cameraIds=3&_sid=.ww5NS11LhkLI1230NZN012245 HTTP/1.1" 200 None
,[2019-07-01 16:54:07] [INFO] (MainThread) event_response status_code 200
,[2019-07-01 16:54:07] [INFO] (MainThread) found event for camera Balcone Cucina
,[2019-07-01 16:54:07] [ERROR] (MainThread) Event 13 already processed (266, '3', 674, '2019-06-29 19:40:34.087795')
,[2019-07-01 16:54:07] [INFO] (MainThread) Event 13 already processed

,

@fabtesta
Copy link
Owner

fabtesta commented Jul 2, 2019

It seems that motion events are correctly processed and gifs are published.
If something goes wrong in the loop, the eventid is not saved as processed in the database.
I need a log for a new founded event.
To be sure that everything is going well and it's just a matter of topic subscription, you should search for and send me a line that says "publish_mqtt_message gif mqtt_server".

@jokerigno
Copy link
Author

Here it is:

,[2019-07-02 08:17:05] [INFO] (MainThread) found event for camera Veranda Camera di Adele
,[2019-07-02 08:17:05] [INFO] (MainThread) Start downloading event video for event_id 23
,[2019-07-02 08:17:05] [INFO] (MainThread) Downloading video for event id 23 to ./gifs/23.mp4 .....
,[2019-07-02 08:17:05] [DEBUG] (MainThread) Starting new HTTP connection (1): 192.168.2.100:5000
,[2019-07-02 08:17:05] [DEBUG] (MainThread) http://192.168.2.100:5000 "GET /webapi/entry.cgi?api=SYNO.SurveillanceStation.Event&method=Download&version=4&analyevent=false&mountId=0&eventId=23&_sid=gLQfD0EbVYxuM1230NZN012245 HTTP/1.1" 200 3145728
,[2019-07-02 08:17:05] [INFO] (MainThread) download_response status_code 200
,
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[                                                  ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[=                                                 ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[==                                                ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[===                                               ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[====                                              ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[=====                                             ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[======                                            ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[=======                                           ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[========                                          ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[=========                                         ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[==========                                        ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[===========                                       ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[============                                      ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[=============                                     ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[==============                                    ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[===============                                   ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[================                                  ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[=================                                 ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[==================                                ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[===================                               ]
[====================                              ]
[====================                              ]
[=====,===============                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[====================                              ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[=====================                             ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[======================                            ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[=======================                           ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[========================                          ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[=========================                         ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[==========================                        ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[===========================                       ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[============================                      ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[=============================                     ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[==============================                    ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[===============================                   ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[================================                  ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[=================================                 ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[==================================                ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[===================================               ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[====================================              ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[=====================================             ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[======================================            ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[=======================================           ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[============,============================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[========================================          ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[=========================================         ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[==========================================        ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[===========================================       ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[============================================      ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[=============================================     ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[==============================================    ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[===============================================   ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================  ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[================================================= ]
[==================================================][2019-07-02 08:17:05] [INFO] (MainThread) Downloading video for event id 23 to ./gifs/23.mp4 .....DONE
,[2019-07-02 08:17:05] [INFO] (MainThread) convert_video_gif scale 320 skip_first_n_secs 5 max_length_secs 5 input_video ./gifs/23.mp4 output_gif ./gifs/23.gif
,ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
,  built with gcc 6.4.0 (Alpine 6.4.0)
,  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-postproc --enable-small --enable-version3 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
,  libavutil      56. 22.100 / 56. 22.100
,  libavcodec     58. 35.100 / 58. 35.100
,  libavformat    58. 20.100 / 58. 20.100
,  libavdevice    58.  5.100 / 58.  5.100
,  libavfilter     7. 40.101 /  7. 40.101
,  libavresample   4.  0.  0 /  4.  0.  0
,  libswscale      5.  3.100 /  5.  3.100
,  libswresample   3.  3.100 /  3.  3.100
,  libpostproc    55.  3.100 / 55.  3.100
,Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './gifs/23.mp4':
,  Metadata:
,    major_brand     : isom
,    minor_version   : 0
,    compatible_brands: mp41avc1
,    creation_time   : 2019-07-02T08:16:56.000000Z
,  Duration: 00:00:13.55, start: 0.000000, bitrate: 1857 kb/s
,    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080, 968 kb/s, 20 fps, 20 tbr, 1001 tbn, 2002 tbc (default)
,    Metadata:
,      creation_time   : 2019-07-02T08:16:56.000000Z
,      handler_name    : VideoHandler
,Stream mapping:
,  Stream #0:0 -> #0:0 (h264 (native) -> gif (native))
,Press [q] to stop, [?] for help
,[swscaler @ 0x559658c94640] deprecated pixel format used, make sure you did set range correctly
,Output #0, gif, to './gifs/23.gif':
,  Metadata:
,    major_brand     : isom
,    minor_version   : 0
,    compatible_brands: mp41avc1
,    encoder         : Lavf58.20.100
,    Stream #0:0(eng): Video: gif, bgr8, 320x180, q=2-31, 200 kb/s, 15 fps, 100 tbn, 15 tbc (default)
,    Metadata:
,      creation_time   : 2019-07-02T08:16:56.000000Z
,      handler_name    : VideoHandler
,      encoder         : Lavc58.35.100 gif
,frame=   30 fps=0.0 q=-0.0 size=       1kB time=00:00:01.94 bitrate=   3.3kbits/s speed=3.86x    
frame=   75 fps=0.0 q=-0.0 Lsize=     239kB time=00:00:04.94 bitrate= 396.4kbits/s speed= 6.6x    
,video:238kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.575662%
,[2019-07-02 08:17:08] [INFO] (MainThread) publish_mqtt_message gif mqtt_server 192.168.2.100  mqtt_port 1883 mqtt_base_topic cameras/gifs topic_name veranda_camera_di_adele
,[2019-07-02 08:17:08] [INFO] (MainThread) Done processing event_id 23

Then I used MQTT-Explorer looking for cameras topic but I found nothing.

@fabtesta
Copy link
Owner

fabtesta commented Jul 2, 2019

The gif filename should be correctly published to topic "cameras/gifs/veranda_camera_di_adele" as the log says

publish_mqtt_message gif mqtt_server 192.168.2.100 mqtt_port 1883 mqtt_base_topic cameras/gifs topic_name veranda_camera_di_adele

Did you try to subscribe the topic?
Issue this command from moquitto server container.
mosquitto_sub -v -t 'cameras/gifs/veranda_camera_di_adele'

@fabtesta
Copy link
Owner

fabtesta commented Jul 9, 2019

@jokerigno Any feedbacks?

@jokerigno
Copy link
Author

After some struggle now it works! And it's great! It's just a pity that Synology allows only 2 free cameras because is so damn fan to see the gifs!

Thank you so much for this!

@garenbosnoyan
Copy link

@fabtesta the setup is all working but the only place I'm stuck is using node-red. I'm using the debug and I do see the gif in the payload but I don't know how to send from there to the telegram. Do you guys have any suggestions?

@fabtesta
Copy link
Owner

The mqtt payload only notifies the path where the gif has been placed, so you have to:

  • subscribe the same topic
  • receive a new message that means that a new gif is available
  • read the message payload that contains the gif name saved in the configured path
  • send a message with your telegram bot attaching the gif file from that path

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

No branches or pull requests

3 participants