AFK not being detected

I have a problem where ActivityWatch never detects that my system is idle. So my active time on teh Window tab is listed as 100% not-afk.

I even tested with not touching my machine for 30min. Made sure no audio was playing and that I was looking at the ActivityWatch dashboard. I do have two monitors, but not sure if that makes a difference. When I installed ActivityWatch I installed for a single user so it didn’t need elevated permissions. I have checked that the aw-watcher-afk module is checked. This is a default configuration with no changes. The AFK module logs show no issues.

Are there any apps that could be interfering? Or any idea how i can troubleshoot this.

aw-watcher-afk seems to at least be running as it reports not-afk, otherwise there would be no activity at all if it would fail to run.

aw-watcher-afk works by looking at when the last mouse or keyboard activity was reports afk or in your case not-afk depending on how long ago that was (180 seconds/3min by default).

What operating system are you using? Windows, macOS or Linux? The implementation is quite different between these platforms.

Win10 Pro - version 2004

Can confirm that when I tested I wasn’t touching the keyboard or mouse.

Still have this issue, listed below further things I’ve tried or additional info that may help

  • Reinstalled via setup, except this time did for “all users” and gave elevated permissions, all while anti-virus was disabled
  • Turned off the normal server and tried with the rust server module
  • ActivityWatch is installed on a non-system drive
  • Using version 0.9.2
  • Only log entries in aw-watcher-afk log

2020-08-07 09:20:51 [INFO ]: aw-watcher-afk started (aw_watcher_afk.afk:53)
2020-08-07 09:20:52 [INFO ]: Connection to aw-server established by aw-watcher-afk (aw_client.client:348)

  • Getting an error in aw-watcher-window though
    2020-08-07 10:01:33 [ERROR]: Exception thrown while trying to get active window: (-2147217385, ‘OLE error 0x80041017’, None, None) (aw_watcher_window.main:66)

Also

The server certainly seems to be working, I think the only thing needed to debug what’s wrong is aw-watcher-afk.

The first thing to check is that there are events in the aw-watcher-afk bucket under the “Raw Data” tab and check how it looks when.
If the event in there is always “not-afk” even when you are indeed afk, the next thing to debug would be to check what happens when you run aw-watcher-afk from the console with the “-v” or “–verbose” flag as that will print if the mouse is moved or if the keyboard is moved so you can know which one is to blame.

I’m only seeing “not-afk” events in the raw data tab.

I started up the afk module from the console and let it run for 3min without touching anything.
Here is an excerpt from the debug (computer name changed). I can’t read this so not quite sure what is causing the issue.

2020-08-07 22:45:05 [DEBUG]: http “POST /api/0/buckets/aw-watcher-afk_a HTTP/1.1” 304 0 (urllib3.connectionpool:437)
2020-08-07 22:45:05 [INFO ]: Connection to aw-server established by aw-watcher-afk (aw_client.client:348)
2020-08-07 22:45:10 [DEBUG]: Seconds since last input: 0.0 (aw_watcher_afk.afk:79)
2020-08-07 22:45:15 [DEBUG]: Seconds since last input: 0.016 (aw_watcher_afk.afk:79)
2020-08-07 22:45:15 [DEBUG]: Starting new HTTP connection (1): 127.0.0.1:5600 (urllib3.connectionpool:225)
2020-08-07 22:45:15 [DEBUG]: http “POST /api/0/buckets/aw-watcher-afk_a/heartbeat?pulsetime=65.0 HTTP/1.1” 200 115 (urllib3.connectionpool:437)
2020-08-07 22:45:20 [DEBUG]: Seconds since last input: 0.015 (aw_watcher_afk.afk:79)
2020-08-07 22:45:25 [DEBUG]: Seconds since last input: 0.0 (aw_watcher_afk.afk:79)
2020-08-07 22:45:25 [DEBUG]: Starting new HTTP connection (1): 127.0.0.1:5600 (urllib3.connectionpool:225)
2020-08-07 22:45:25 [DEBUG]: http://127.0.0.1:5600 “POST /api/0/buckets/aw-watcher-afk_a/heartbeat?pulsetime=65.0 HTTP/1.1” 200 116 (urllib3.connectionpool:437)
2020-08-07 22:45:30 [DEBUG]: Seconds since last input: 0.0 (aw_watcher_afk.afk:79)
2020-08-07 22:45:35 [DEBUG]: Seconds since last input: 0.0 (aw_watcher_afk.afk:79)

I unplugged all my USB devices and replugged them and now AFK is working.

Thanks for the assistance for putting me on th right track.

For others it was an issue with my Razor Orbweaver. Which gets treated like a “joystick” where it constantly updates windows saying it’s centered which is why it wasn’t being registered as AFK.

Info on a potential fix, though it seems most people just unplug it when they aren’t using it.

1 Like

That’s really interesting.

I wonder if it would be possible for aw-watcher-afk to ignore joysticks completely to avoid issues like this.