logantgt / EcpEmuServer

Trigger webhooks from your Logitech Harmony (or other Roku ECP compatible) Universal Remote
MIT License
19 stars 2 forks source link

Getting a socket already used error when running the program #2

Closed eric6444 closed 1 year ago

eric6444 commented 2 years ago

[x] error @ 2022-07-22 20:35:56: Une seule utilisation de chaque adresse de socket (protocole/adresse réseau/port) est habituellement autorisée.

eric6444 commented 2 years ago

here is what i got

[i] info @ 2022-07-23 23:27:18: EcpEmuServer started (press CTRL+C twice to terminate) [i] info @ 2022-07-23 23:27:18: RuleManager running, loading rules... [*] success @ 2022-07-23 23:27:18: Loaded HttpGET rule "New Rule" from rules.xml for button "None" [i] info @ 2022-07-23 23:27:18: Button API running [x] error @ 2022-07-23 23:27:18: Une seule utilisation de chaque adresse de socket (protocole/adresse réseau/port) est habituellement autorisée.

logantgt commented 2 years ago

Hi there Eric, just to be sure, you aren't running another application like HarmonySpan at the same time correct? HarmonySpan must be stopped before running EcpEmuServer because they use the same port on the network.

eric6444 commented 2 years ago

Hi, i was running the logitech Oem Harmony sortware at the same time but not the span. I am new i do not have your previous version.

Téléchargez Outlook pour iOShttps://aka.ms/o0ukef


De : Logan Lowe @.> Envoyé : Sunday, July 24, 2022 12:13:25 PM À : AShifter/EcpEmuServer @.> Cc : eric6444 @.>; Author @.> Objet : Re: [AShifter/EcpEmuServer] Getting a socket already used error when running the program (Issue #2)

Hi there Eric, just to be sure, you aren't running another application like HarmonySpan at the same time correct? HarmonySpan must be stopped before running EcpEmuServer because they use the same port on the network.

— Reply to this email directly, view it on GitHubhttps://github.com/AShifter/EcpEmuServer/issues/2#issuecomment-1193349604, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2F4CIIN23SYOP2NNL33VWTVVVTSLANCNFSM54ND22IA. You are receiving this because you authored the thread.Message ID: @.***>

logantgt commented 2 years ago

Hello Eric, that sounds good. Is there a way you could try running the application on another computer to see if it has the same error? If not, I suspect this might be caused by something like Plex Media Server having a DLNA server running on your network, which uses the same port as EcpEmuServer for device discovery. If you have a Plex server on this system, make sure this option is disabled; image

eric6444 commented 2 years ago

The DNLA was the problem so this is solve thank you.

But after when i go to Harmony looking for new hardware it does not find the virtual ROKU am i missing a step sorry for being noob :(

logantgt commented 2 years ago

Glad to hear that helped to solve the first issue. Sometimes if the virtual Roku can't be found in the Logitech software it's an issue with having multiple network adapters - can you check this?

If you have Windows then press Windows Key + R to get the Run dialogue, and type ncpa.cpl and press Enter. You'll get this window;

image

If there is more than one entry, right-click and disable all of them except for the one that you use to connect to the Internet, and then restart EcpEmuServer and try again. If this doesn't help then make sure the Harmony Hub is on the same network as your PC.

eric6444 commented 2 years ago

Ok it work now i can find the virtuel Roky only if i conect to wifi. an turn off the other adapter. I conect the server on ethernet an disable the other adapter Harmony can't find the Roku. Is there a way to make it work if i stay connect with my ethernet adapter? Also once i added the roku to the harmony what is the next step i need to do to turn on or off light on my plex app. Cant i turn back on the Plex DLNA once i am done? All my data base run by the DLNA. Thank you.

eric6444 commented 2 years ago

OK i think i got to work with webhook but when i press play or pause the light will go on or off but the movie on plex or youtube wont start playing. Also for the DLNA anyway i can put it back on? Thank you.

logantgt commented 2 years ago

Apologies for the slow response! I'm glad to hear that you were able to find the emulated Roku from the Harmony. At this point you should be able to enable the DLNA server on Plex again, EcpEmuServer will still give you that error but it should continue running anyway.

At this point you should be able to enable your other network adapters safely as well. In order to fix these issues going forward, I am considering adding the ability to provide EcpEmuServer with a specific IP address to bind to at startup, so I will keep this issue open until I add a fix like that.

Edit: For the issue with the play or pause buttons not controlling your media devices, you need to add the virtual Roku device into your activities and run those button presses as sequences; https://support.myharmony.com/en-es/creating-button-sequences

Thank you for helping to test this out!

marshallvyper commented 1 year ago

Hi there... I'm having a similar issue. I've tried on one PC and get the "Only one usage of each socket..." error. I did a netstat -an | find "LISTEN" and see nothing listening on TCP 8060 prior to starting the app. I decided to try another PC and it was fine. It ran ok for a couple days but then last nights Windows update happened and now my 2nd PC is doing the same thing. I check a netstat on it and see nothing listening on 8060 so I'm not sure what might be causing this. Neither of the 2 PC's are running a plex server.

Any help would be appreciated!

Thanks

logantgt commented 1 year ago

@marshallvyper Hello there, that is pretty odd. I have not been on a mainline version of Windows 10 for a while now so I can't say that I know if the latest update impacts anything. Where in the log does the issue happen? It might not be the button API port 8060 but rather the SSDP multicast port 1900.

marshallvyper commented 1 year ago

Hmm, I didn't know about the multicast port 1900.. from the log I think that might be it:

[i] info @ 2022-09-14 5:44:52 PM: Button API running [x] error @ 2022-09-14 5:44:52 PM: Only one usage of each socket address (protocol/network address/port) is normally permitted.

Given that, how can I go about troubleshooting for figuring out where the conflict is? My skill is limited to TCP/UDP without much knowledge on broadcast/multicast.

Thanks!

marshallvyper commented 1 year ago

You gave me a place to look with the port 1900. I found Windows 10 has a "SSDP Discovery" service running that was causing the conflict. Not sure what might break with that service disabled but the app seems to work now.

logantgt commented 1 year ago

That's good to hear, I will have to make a note of that in the README - that could impact your ability to discover other devices in the Network panel of Explorer or to have your system detected by other Windows 10 systems in their Network panels, other than that should be good.

Have fun!