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

[samsungtv] Fix reconnect after first connection to TV is lost #11487

Merged
merged 2 commits into from
Nov 15, 2021

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Oct 31, 2021

Fixes #7055
Fixes #7406

Signed-off-by: Jacob Laursen jacob-github@vindvejr.dk

Initially the binding will start RemoteControllerService in non-UPnP mode by calling createNonUpnpService.

When device is added, some additional services are started and RemoteControllerService is replaced by new UPnP instance from createUpnpService.

When device is removed, the binding would stop all services, including the RemoteControllerService - without restarting the non-UPnP service. This made it unable to detect when device would be added again.

This has been fixed by calling checkCreateManualConnection after stopping all services in order to go back to original state listening for devices being added - like after initialize(). See comment in linked issue for additional information.

Tested with Samsung UE55D8005 (legacy protocol).

Additionally reduced log level from DEBUG to TRACE for some specific logging of methods that would be entered once per second:

2021-10-30 21:52:32.446 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, power, channel]
2021-10-30 21:52:32.448 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
2021-10-30 21:52:32.450 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
2021-10-30 21:52:32.451 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: channel, command: REFRESH
2021-10-30 21:52:32.454 [DEBUG] [internal.service.MainTVServerService] - Received channel: channel, command: REFRESH
2021-10-30 21:52:32.501 [DEBUG] [internal.service.MainTVServerService] - Received channel: sourceName, command: REFRESH
2021-10-30 21:52:32.517 [DEBUG] [internal.service.MainTVServerService] - Received channel: programTitle, command: REFRESH
2021-10-30 21:52:33.519 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, power, channel]
2021-10-30 21:52:33.521 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
2021-10-30 21:52:33.523 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
2021-10-30 21:52:33.525 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: channel, command: REFRESH
2021-10-30 21:52:33.526 [DEBUG] [internal.service.MainTVServerService] - Received channel: channel, command: REFRESH
2021-10-30 21:52:33.543 [DEBUG] [internal.service.MainTVServerService] - Received channel: sourceName, command: REFRESH
2021-10-30 21:52:33.554 [DEBUG] [internal.service.MainTVServerService] - Received channel: programTitle, command: REFRESH

jlaur added 2 commits October 31, 2021 20:44
Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
…es per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur requested a review from paulianttila as a code owner October 31, 2021 19:55
@jlaur
Copy link
Contributor Author

jlaur commented Oct 31, 2021

@jlaur
Copy link
Contributor Author

jlaur commented Nov 7, 2021

I just received confirmation that this PR also fixes #7406.

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lolodomo
Copy link
Contributor

@paulianttila ; any comment?

@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of an add-on label Nov 15, 2021
@lolodomo
Copy link
Contributor

Let's go for a merge.

@lolodomo lolodomo merged commit 43090b9 into openhab:main Nov 15, 2021
@lolodomo lolodomo added this to the 3.2 milestone Nov 15, 2021
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
…ab#11487)

* Fix reconnect after first connection to TV is lost.

Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Reduced log level to TRACE for logging of entered methods several times per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
…ab#11487)

* Fix reconnect after first connection to TV is lost.

Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Reduced log level to TRACE for logging of entered methods several times per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
…ab#11487)

* Fix reconnect after first connection to TV is lost.

Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Reduced log level to TRACE for logging of entered methods several times per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
…ab#11487)

* Fix reconnect after first connection to TV is lost.

Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Reduced log level to TRACE for logging of entered methods several times per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur deleted the 7055-samsungtv-recover-from-tv-offline branch June 13, 2022 18:55
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
…ab#11487)

* Fix reconnect after first connection to TV is lost.

Fixes openhab#7055

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Reduced log level to TRACE for logging of entered methods several times per second.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
4 participants