AdyRock / homey-netscan

4 stars 3 forks source link

only half works #1

Closed ronwell74 closed 2 years ago

ronwell74 commented 3 years ago

i can get the app to work for when my computer turns on. but it doesn't detect the computer has turned off, until i restart homey. i have tried different tcp port numbers for my computer, and get the same result. if i add my computerusing the ip address device. it doesn't detect either on or off.

AdyRock commented 3 years ago

That's strange 🤔 For my PC I use the IP option and it detects both on and off quite quickly. My PC has a fixed IP address to make sure it doesn't change.

What version of Homey are you using?

ronwell74 commented 3 years ago

its a standard homey not pro. with 7.0

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sat, 26 Jun 2021, 6:29 pm Adrian Rockall, @.***> wrote:

That's strange 🤔 For my PC I use the IP option and it detects both on and off quite quickly. My PC has a fixed IP address to make sure it doesn't change.

What version of Homey are you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-868972027, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7QMDJWIPPXEABFOZ6DTUWJHJANCNFSM47LEER2Q .

AdyRock commented 3 years ago

Mine is on v7 as well. It's possible it could take a minute or so to detect going off due to network timeout settings, but I do try to override the timeout to keep it responsive.

I can't see a way that the app wouldn't detect the PC going off, provided it really does go off and hasn't gone into a sleep mode where it still responds to network connections. Have you tried to completely remove the power from the PC to see if it is detected as off then? Can you double check the IP address is really for the PC and that there isn't another devices with the same IP?

Could you try to run the app from the CLI as it should display messages in the command window that might help track down the problem

ronwell74 commented 3 years ago

all the devices on my network have reserved ip addresses. i dont know how to do the cli part. can you give me some instructions. thanks.

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sat, 26 Jun 2021, 7:44 pm Adrian Rockall, @.***> wrote:

Mine is on v7 as well. It's possible it could take a minute or so to detect going off due to network timeout settings, but I do try to override the timeout to keep it responsive.

I can't see a way that the app wouldn't detect the PC going off, provided it really does go off and hasn't gone into a sleep mode where it still responds to network connections. Have you tried to completely remove the power from the PC to see if it is detected as off then? Can you double check the IP address is really for the PC and that there isn't another devices with the same IP?

Could you try to run the app from the CLI as it should display messages in the command window that might help track down the problem

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-868980203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7QHV26QUGIN2CIJPY3TUWSALANCNFSM47LEER2Q .

AdyRock commented 3 years ago

There is a tutorial on the forum: https://community.athom.com/t/how-to-cli-install-method/198 And in the help: https://apps.developer.homey.app/the-basics/getting-started

The main problem is you probably need to run the CLI on the PC that you want to switch on and off. Luckily I have a laptop as well that I initially tested the detection on.

ronwell74 commented 3 years ago

sorry but i cant cant follow java stuff, i struggle reading and understanding it. thats why i went with homey rather than home assistant.

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sat, 26 Jun 2021, 8:12 pm Adrian Rockall, @.***> wrote:

There is a tutorial on the forum: https://community.athom.com/t/how-to-cli-install-method/198 And in the help: https://apps.developer.homey.app/the-basics/getting-started

The main problem is you probably need to run the CLI on the PC that you want to switch on and off. Luckily I have a laptop as well that I initially tested the detection on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-868982895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7USC4QKAFRDXDZBLZ3TUWVKNANCNFSM47LEER2Q .

AdyRock commented 3 years ago

You don't need to understand the code, just run it from the CLI so it displays messages in the console. I understand if it is too much but I don't know how to find the issue any other way at the moment. At some point I will add a log viewer in the app like I have on my other apps but it takes some time to set up.

ronwell74 commented 3 years ago

theres a lot of java in the instructions, just seeing it makes my head hurt.

On Sat, 26 Jun 2021 at 20:34, Adrian Rockall @.***> wrote:

You don't need to understand the code, just run it from the CLI so it displays messages in the console. I understand if it is too much but I don't know how to find the issue any other way at the moment. At some point I will add a log viewer in the app like I have on my other apps but it takes some time to set up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-868985328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7VMYSCG7TZACFEHFUTTUWX4LANCNFSM47LEER2Q .

--


:-)

Aaron .L .Powell 25/328 Fullarton rd. Fullarton South Australia 5063 ph: 0402675551 email: @.***

:-)

ronwell74 commented 3 years ago

i am close to fixing it. i just unistalled fing from my computer, and now homey knows when the computer turns off. theres a 5 minute delay, but i dont have to restart homey first which is good. i unistalled fing because the notifications where getting anoying and no longer needed it. it could be related or just a conwincedence. all i need to fix now is the speed it respons to. thanks.

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sat, 26 Jun 2021, 8:34 pm Adrian Rockall, @.***> wrote:

You don't need to understand the code, just run it from the CLI so it displays messages in the console. I understand if it is too much but I don't know how to find the issue any other way at the moment. At some point I will add a log viewer in the app like I have on my other apps but it takes some time to set up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-868985328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7VMYSCG7TZACFEHFUTTUWX4LANCNFSM47LEER2Q .

AdyRock commented 3 years ago

That's still a long delay. What do you have the Check Interval and Check Timeout set to? I have Interval = 15 and Timeout = 10. That should mean it checks every 15 seconds and assumes the device is offline if it doesn't respond within 10 seconds. Therefore, it detects that my PC has been turned off in a maximum of 25 seconds.

ronwell74 commented 3 years ago

i haven't touched those settings they are still 15 and 10

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sun, 27 Jun 2021, 9:51 am Adrian Rockall, @.***> wrote:

That's still a long delay. What do you have the Check Interval and Check Timeout set to? I have Interval = 15 and Timeout = 10. That should mean it checks every 15 seconds and assumes the device is offline if it doesn't respond within 10 seconds. Therefore, it detects that my PC has been turned off in a maximum of 25 seconds.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869078582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7QMLENZXA7BWURFB5LTUZVJDANCNFSM47LEER2Q .

AdyRock commented 3 years ago

It just doesn't makes sense, so I am really confused. Basically, with those settings, if the connection is not made within 10 seconds then it will flag as offline and If the PC is truly switched off there will be nothing to make the connection with. I have only seen problems trying to make or maintain a connection in the past and never an issue with not having a connection like this.

If the PC uses a wired network connection then try pulling the cable out to see if Homey reports it as offline.

ronwell74 commented 3 years ago

pulling the network cable does the same thing, it takes homey 5 minutes to detect its disconnected. just to check I have the correct tcp port, here is my nmap results, I am using port 554 for the app, is that correct?.

Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-27 12:37 Cen. Australia Standard Time

Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.

Nmap scan report for 192.168.119.184

Host is up (0.0060s latency).

Not shown: 987 closed ports

PORT STATE SERVICE

7/tcp open echo

9/tcp open discard

13/tcp open daytime

17/tcp open qotd

19/tcp open chargen

135/tcp open msrpc

139/tcp open netbios-ssn

445/tcp open microsoft-ds

554/tcp open rtsp

2869/tcp open icslap

2968/tcp open enpp

5357/tcp open wsdapi

10243/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 1.41 seconds

On Sun, 27 Jun 2021 at 10:37, Adrian Rockall @.***> wrote:

It just doesn't makes sense, so I am really confused. Basically, with those settings, if the connection is not made within 10 seconds then it will flag as offline and If the PC is truly switched off there will be nothing to make the connection with. I have only seen problems trying to make or maintain a connection in the past and never an issue with not having a connection like this.

If the PC uses a wired network connection then try pulling the cable out to see if Homey reports it as offline.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869082288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7UYQPU5EDKT4OMWHRTTUZ2VNANCNFSM47LEER2Q .

--


:-)

Aaron .L .Powell 25/328 Fullarton rd. Fullarton South Australia 5063 ph: 0402675551 email: @.***

:-)

AdyRock commented 3 years ago

I must admit, those instructions were written by my predecessor so I'm not 100% sure, but I think any of those ports should work. For my detection I use the IP device that doesn't require a port. Later today I will do some testing using the TCP port option just in case there is a bug in that/

ronwell74 commented 3 years ago

thanks

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Sun, 27 Jun 2021, 6:23 pm Adrian Rockall, @.***> wrote:

I must admit, those instructions were written by my predecessor so I'm not 100% sure, but I think any of those ports should work. For my detection I use the IP device that doesn't require a port. Later today I will do some testing using the TCP port option just in case there is a bug in that/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869126087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7RFV7OEGTGK6BQEI4DTU3RILANCNFSM47LEER2Q .

AdyRock commented 3 years ago

So tests using the TCP port option all work fine for me. I now have connections to my PC on port 3389 (RDP) and it detects on and off states in tandem with the IP only option.

To try and track down the problem you are experiencing, I have published a new test version that has a log view page. https://homey.app/en-gb/app/com.netscan/Net-Scan/test

To see the log, navigate to More - App - NetScan - Configure App. The page has an option to set the log level, so set that to "Basic Information". Wait for the device to come on line and then go offline and then tap on the Send Log button.

ronwell74 commented 3 years ago

the log didnt work. i could see it checking before the computer turned on. then once it turned on, it stopped checking. this time it didn't detect the computer turning off until i restarted the app. and the send log just failed aswell.

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Mon, 28 Jun 2021, 2:07 am Adrian Rockall, @.***> wrote:

So tests using the TCP port option all work fine for me. I now have connections to my PC on port 3389 (RDP) and it detects on and off states in tandem with the IP only option.

To try and track down the problem you are experiencing, I have published a new test version that has a log view page. https://homey.app/en-gb/app/com.netscan/Net-Scan/test

To see the log, navigate to More - App - NetScan - Configure App. The page has an option to set the log level, so set that to "Basic Information". Wait for the device to come on line and then go offline and then tap on the Send Log button.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869191059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7RRYVUS6AMA6UZY7STTU5HS3ANCNFSM47LEER2Q .

AdyRock commented 3 years ago

Ah, I forgot to publish a file which is why the send log didn't work so that will be fixed in the next update. Could you post the last few lines of the log on here so I can try to see what path it took before stopping? I am guessing that there is a route through that misses setting up the timer again.

ronwell74 commented 3 years ago

these are the last 5 lines in the log. before it stop, i could see new lines coming up everyfew seconds, but that stopped once the computer had started.

05:28:55.582: Device still Offline HP - 192.168.119.184 05:28:55.596: HP - 192.168.119.184 on close 05:29:10.675: Checking TCP device HP - 192.168.119.184port554 05:29:11.769: HP - 192.168.119.184 on connect 05:29:11.779: * Device came Online HP - 192.168.119.184

hope this helps.

On Mon, 28 Jun 2021 at 16:46, Adrian Rockall @.***> wrote:

Ah, I forgot to publish a file which is why the send log didn't work so that will be fixed in the next update. Could you post the last few lines of the log on here so I can try to see what path it took before stopping? I am guessing that there is a route through that misses setting up the timer again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869423861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7RPLN7LGRUFIET7OF3TVAOVFANCNFSM47LEER2Q .

--


:-)

Aaron .L .Powell 25/328 Fullarton rd. Fullarton South Australia 5063 ph: 0402675551 email: @.***

:-)

AdyRock commented 3 years ago

Aha, I think I have found the issue. I have published a new test version.

ronwell74 commented 3 years ago

thanks for your help. do i need to re install it

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Mon, 28 Jun 2021, 6:33 pm Adrian Rockall, @.***> wrote:

Aha, I think I have found the issue. I have published a new test version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869508775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7S3F7SZF3I5UK7M4PDTVA3HBANCNFSM47LEER2Q .

AdyRock commented 3 years ago

Possibly. Homey might auto-update it as you have a test version already installed so check the app version number is 2.0.4. If not then just install it again over the top of the old one, no need to uninstall first.

ronwell74 commented 3 years ago

thanks il test it tomorrow and you know how it goes. thanks

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Mon, 28 Jun 2021, 6:41 pm Adrian Rockall, @.***> wrote:

Possibly. Homey might auto-update it as you have a test version already installed so check the app version number is 2.0.4. If not then just install it agab over the top of the old one, no need to uninstall first.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869515234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7QDFSF55Y6T2JPA5RDTVA4FFANCNFSM47LEER2Q .

ronwell74 commented 3 years ago

that works now. thanks

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Mon, 28 Jun 2021, 6:43 pm Aaron Powell, @.***> wrote:

thanks il test it tomorrow and you know how it goes. thanks

-------------------------------------------- :-)

Aaron .L .Powell

25/328 Fullarton rd.

Fullarton South Australia 5063

ph: 0402675551

email: @.***

-------------------------------------------- :-)

On Mon, 28 Jun 2021, 6:41 pm Adrian Rockall, @.***> wrote:

Possibly. Homey might auto-update it as you have a test version already installed so check the app version number is 2.0.4. If not then just install it agab over the top of the old one, no need to uninstall first.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AdyRock/homey-netscan/issues/1#issuecomment-869515234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2VO7QDFSF55Y6T2JPA5RDTVA4FFANCNFSM47LEER2Q .