Troubleshooting NSClient
NSClient relies on stable communication with Nightscout. An unstable connection leads to synchronization errors and high data usage.
If nobody is following you on Nightscout you can choose to pause NSClient to save battery life or you can choose to setup NSClient so that it only connects when on Wi-Fi and/or during charging.
How to detect an unstable connection?
Open the NSClient screen (Configuration > Communication > NSClientV3 > Open plugin) and watch the Status and the log. With websockets enabled, the status should stay “connected”, with almost no reconnection messages in the log. If you see many reconnections, then there is a problem.
Restart
As a first step, restart Nightscout and then your phone to see if the issue is permanent.
If your Nightscout is hosted on Heroku, you can restart Nightscout by: Logging into Heroku, click on your nightscout app name, click on the ‘More’ menu, then ‘Restart all dynos’.
For other hosts, please follow your hosts guidance documentation.
Phone issues
Android may put your phone into a sleep mode. Check if you have an exception for AAPS in your phones power options to allow it to run in the background all the time.
Check the NSClient again when in strong network signal location.
Try another phone.
Nightscout
If your site is hosted on Azure, many people have found that connection issues have improved since moving to Heroku.
A workaround to connection issues in Azure is to set in Application settings HTTP protocol to 2.0 and Websockets to ON
Remote control needs websockets
Websockets are mandatory for remote control from AAPSClient, on both phones. If the websocket connection keeps dropping, remote control does not work. Data synchronization still works, but more slowly. Your Nightscout host must support websockets.
No BG reading from Nightscout
If AAPS connects to Nightscout correctly but BG displays as N/A: in the NSClientV3 settings, open Synchronization and turn on Receive CGM data from NS. This option is hidden while client control is on (hardened mode); in that case check that NSClient BG is selected in Configuration → BG Source.
If you still get an error…
Check the size of your database in MongoDB (or via the database size plugin in nightscout). If you are using the free tier in MongoDB, 496MB means it is full and needs to be cleaned up. Follow these Nightscout instructions for checking the size of your database and clearing out data.
Before clearing data from your database and if you haven’t already set it up, you should consider donating your AAPS data to the Open Humans project (for research). The instructions are on the OpenHumans configuration page.