Gateway service stops working



  • I am using the gateway as a service on my always on Windows computer. It works perfectly when it is working but stops functioning every few days yet the service is still running. It starts working again once I restart the service.

    Anything to look for to troubleshoot this?
    Is there a command that will get me to the live service output? (The output you would normally see in the command line window if you aren’t running as a service) This may give me some clue to what is going on, it would at least show me if the service is responding to requests at all when it stops working.

    Thanks.



  • I have the same thing, but not in days… could be a week or two. I have “assumed” its just a windows thing. Unless you reboot window machines every so often, the memory leakage from any other program affect anything / all things / performance on the Win machine, and the only cure to to reboot every so often.
    If I cant reboot at the moment, I stop and start the service, I have shortcuts on my desktop for it. My always on Win machine is also a my workstation and server at this moment, after my server died.
    I’ll go with PI solution in the near future most likely.



  • @chester40391

    You can access the log data via the file system or you can use the following Windows PowerShell command to “follow” the log in a live output window:

    Logging
    If running the Monocle Gateway as a Windows service the application will write its output data to a log file: monocle-gateway.log.

    To monitor the log file while the service is running you can open a Power Shell window and use the following command to “tail” the log file. Get-Content -Path .\monocle-gateway.log -Wait

    (See: https://monoclecam.com/monocle-gateway/install/windows#logging)

    You can also just run the “monocle-gateway.exe” from the command line and not use the Windows service while you are diagnosing. It might be an interesting test to see if it only fails while running as a service versus running standalone from command line.

    Thanks, Robert



  • The same thing happens to me, but I’m running in a container on a QNAP NAS. It happens every week or two. When this happens the Gateway is still running, but it isn’t using any resources. The Amazon devices try to connect but then say that the camera isn’t responding.

    The camera mostly viewed is a Unifi camera running in standalone mode. I use @proxy, and just added @hangup to see if that would make a difference.

    I should have copied the console output, but from memory it showed the Alexa device connecting, then disconnecting after a little while. I don’t remember see any errors.



  • @Monocle, I finally had the problem again.

    Here is the end of my console output from today:

    ------------------------------------------------- 
    INITIALIZE RTSP STREAM: Front Facing East 
    ------------------------------------------------- 
     - NAME : Front Facing East 
     - LABEL : PRIMARY 
     - URL : rtsp://192.168.1.47:554/s1 
     - UUID : STREAM:<streamhash> 
     - SESS : <sesshash> 
     - MODIF : Mon Jul 06 2020 22:46:51 GMT+0000 (UTC) 
     - TAGS : @hangup,@proxy 
    ------------------------------------------------- 
     
    2020-08-19T20:06:34.573Z [INFO] [RTSP PROXY] REGISTERING STREAM [Front Facing East/PRIMARY]; (STREAM:<streamhash>) 
    2020-08-19T20:06:34.574Z [DEBUG] <RTSP-PROXY> [REQUEST] --> [REGISTER] rtsp://192.168.1.47:554/s1 
    2020-08-19T20:06:34.574Z [TRACE] <RTSP-PROXY> [REQUEST] --> [HEADERS] { 
     "cseq": "1", 
     "transport": "reuse_connection=0;preferred_delivery_protocol=udp;proxy_url_suffix=STREAM:<streamhash>;username=<username>;password=<password>" 
    } 
    2020-08-19T20:06:34.851Z [INFO] [192.168.1.165:33414 <code>] RTSP CLIENT SOCKET CONNECTED 
    2020-08-19T20:06:34.986Z [INFO] [192.168.1.165:33414 <code>] RTSP CLIENT ATTACHED TO STREAM: Front Facing East (STREAM:<streamhash>) 
    2020-08-19T20:06:34.988Z [INFO] [192.168.1.165:33414 <code>] RTSP ENDPOINT SOCKET CONNECTED {127.0.0.1:8554} 
    2020-08-19T20:06:34.988Z [DEBUG] [192.168.1.165:33414 <code>] [CLIENT REQUEST] --> [DESCRIBE] rtsp://<rtsphash>.mproxy.io:443/STREAM:<streamhash>?session=<sesshash> 
    2020-08-19T20:06:34.988Z [TRACE] [192.168.1.165:33414 <code>] [CLIENT REQUEST] --> [HEADERS] { 
     "accept": "application/sdp", 
     "user-agent": "Fire OS/6.0 stagefright/1.2 (Linux;Android 7.1.2)", 
     "cseq": "1" 
    } 
    2020-08-19T20:06:34.988Z [DEBUG] [192.168.1.165:33414 <code>] [ENDPOINT REQUEST] --> [DESCRIBE] rtsp://<rtsphash>.mproxy.io:443/STREAM:<streamhash> 
    2020-08-19T20:06:34.988Z [TRACE] [192.168.1.165:33414 <code>] [ENDPOINT REQUEST] --> [HEADERS] { 
     "accept": "application/sdp", 
     "user-agent": "Fire OS/6.0 stagefright/1.2 (Linux;Android 7.1.2)", 
     "cseq": "1" 
    } 
    2020-08-19T20:07:04.986Z [WARN] [192.168.1.165:33414 <code>] RTSP CLIENT SOCKET TIMEOUT 
    2020-08-19T20:07:04.988Z [WARN] [192.168.1.165:33414 <code>] RTSP ENDPOINT SOCKET TIMEOUT [192.168.1.165:33414 <code>] 
    2020-08-19T20:07:04.989Z [INFO] [192.168.1.165:33414 <code>] RTSP ENDPOINT SOCKET CLOSED [192.168.1.165:33414 <code>] 
    2020-08-19T20:07:04.989Z [INFO] [192.168.1.165:33414 <code>] RTSP CLIENT SOCKET CLOSED 
    2020-08-19T20:07:04.989Z [INFO] [192.168.1.165:33414 <code>] RTSP CLIENT DETACHED FROM STREAM: Front Facing East (STREAM:<streamhash>) 
    2020-08-19T20:07:04.989Z [INFO] [RTSP PROXY] DE-REGISTERING STREAM [Front Facing East/PRIMARY]; NO LONGER IN USE 
    2020-08-19T20:07:04.990Z [DEBUG] <RTSP-PROXY> [REQUEST] --> [DEREGISTER] rtsp://192.168.1.47:554/s1 
    2020-08-19T20:07:04.990Z [TRACE] <RTSP-PROXY> [REQUEST] --> [HEADERS] { 
     "cseq": "1", "transport": "reuse_connection=0;preferred_delivery_protocol=udp;proxy_url_suffix=STREAM:<streamhash>" 
    } 
    

    I didn’t know what would compromise security, so I replaced the hashes, etc.

    Does this help explain what’s happening? The Echo Show would just say that the camera isn’t responding. I restarted the container and it’s working perfectly again.



  • @tfjield

    I don’t see anything in the log that indicates a failure or error. Is it possible that you have a public IP address change from your ISP? If you public IP address gets changed, Monocle Gateway won’t know about it and thus won’t update our servers with your latest address … until you restart it … and then the gateway will automatically re-register using your new address.

    Thanks, Robert



  • @Monocle
    I don’t think so. My external IP is the same now as it has been for years.

    I’ll post the next time it happens again. Maybe the timing will yield some clue.



  • @Monocle said in Gateway service stops working:

    can also just run the “monocle-gateway.exe” from the command line and not use the Windows service while you are diagnosing. It might be an interesting test to see if it only fails while running as a service versus running standalone from command line

    It fails regardless if I use the service or the .exe. I noticed a comment below mine regarding public IP changes causing an issue. I will have to check for this. It is possible my IP changes frequently. If that is the case is there anything I can do aside from programatically restarting the service daily?



  • @chester40391 said in Gateway service stops working:

    It is possible my IP changes frequently. If that is the case is there anything I can do aside from programatically restarting the service daily?

    Probably not … however, if you find this to be the case let us know and we can add a periodic check in the gateway to try and detect IP changes and re-register any updated address with the servers.

    Thanks, Robert



  • I confirmed my IP is changing frequently but I also experienced the gateway stopped working without an IP change. Still running but Alexa integration stops working until I restart the gateway app/service. I will try to make time to grab logs.

    “we can add a periodic check in the gateway to try and detect IP changes and re-register any updated address with the servers.” I think this would be a great implementation. The reason I found Monocle is because I am in the country with very limited internet options and low caps which means A. I cant use heavy cloud based services even if I wanted to. B. As a result of the scrappy technology behind my ISP solution I have frequent IP changes. This might be too edge case for the effort but another possible solution might be to allow the ability to statically set a DNS name instead of detecting the IP. I could use a dynamic DNS provider and a client on my network to keep DNS updated of IP changes.


Log in to reply