alienatedsec / yi-hack-v5

Even newer Custom Firmware for Xiaomi Cameras based on Hi3518ev200 Chipset. It includes free RTSP, ONVIF and other improvements based on the work by roleoroleo
GNU General Public License v3.0
803 stars 89 forks source link

[47US] "Disable cloud" enabled causes mqtt state is always offline (firmware 0.41b) #304

Closed franciscot closed 11 months ago

franciscot commented 1 year ago

Describe the bug With Disable cloud enabled mqtt's state is always offline. Tested with version 0.40 0.41a & 0.41b

To Reproduce Steps to reproduce the behaviour:

  1. Reset to YI-HACK-V5 defaults
  2. Config hostname, timezone, user and password, swapfile on. Nothing else.
  3. Cofig MQTT. Just changed "General config", "Authentication" and topics-prefix. Nothing else.
  4. Reboot
  5. The mqtt status of the camera is online.
  6. Activate "Disable cloud"
  7. Reboot
  8. The mqtt status of the camera is offline always.

Expected behaviour Disable cloud doesn't affect to status in mqtt. In Home Assistant mqtt the camera is "not available" because is offline.

Set Up Details (please complete the following information):

Additional context mqtt message: yicam/status/offline

dskvr commented 1 year ago

This might be the problem I am having (65US). However, deactivating "Disable Cloud" has no effect.

Additionally, not only is status always offline, but stat.camera only updates on boot (sometimes)

Here's some info:

Broker Logs

2023-10-13 13:25:01: New connection from 123.456.7.8:55061 on port 1883.
2023-10-13 13:25:01: New client connected from 123.456.7.8:55061 as yicam_c (p2, c1, k15, u'mqttuser').
2023-10-13 13:25:02: Client yicam closed its connection.

From MQTT Explorer:

Maybe nothing but...

  1. In log, online message is received but immediately afterwards offline message is received.
  2. Notice how "QoS" value is 0 Screen Shot 2023-10-13 at 1 06 19 PM

QOS Value in MQTT settings for birth/will is 1, not 0 Screen Shot 2023-10-13 at 1 06 49 PM

On further investigation, I enabled discovery for "MQTT Camera Settings Advertise." This was to see if the camera was properly advertising the correct status. As expected, during boot it broadcasts the correct settings, but the corresponding member does not update (in any amount of time) when for example cmnd.camera.switch_on is changed.

It appears to be a connection issue with the broker in my case, but this doesn't explain why it goes online for a split second, nor why the broker is not giving me an authentication error.

Stumped.

github-actions[bot] commented 1 year ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

franciscot commented 1 year ago

I can confirm: In MQTT QoS is always in "0".

github-actions[bot] commented 11 months ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

franciscot commented 11 months ago

Testing with 0.4.1d now it's working the state (online/offline) in mqtt, with or without "disable cloud".