Skip to content

How to capture all packets for issue resolution

rstrouse edited this page Feb 1, 2021 · 10 revisions

Packet capture - 6.0

Packet capture for issue resolution is made even easier in 6.0! Packet capture can be started from your current configuration or you can request that the app does a "reset" as if you were starting from a fresh place.

The first step in troubleshooting any problem is to make a backup

The output of the process is everything you need for submitting an issue. The final files will be stored in a directory under logs with the date time. EG logs\2020-05-25_21-07-43 (May 25, 2020 9:07:43 pm). In that directory will be the following:

  • A zip file containing the 5 items below (see notes in each section below for easy access to this file)
    1. config.json
    2. poolConfig.json as it is at the end of the capture
    3. poolState.json as it is at the end of the capture
    4. packetLog(date).log with a record of all the incoming & outgoing packets and incoming API calls
    5. consoleLog(_date).log which is a record of all the messages displayed in the console (with full logging)

There are three ways to complete the process:

  1. -webClient
  2. dashPanel
  3. Command line
  4. API

-webClient

This method allows you to start, stop and download the file from a web browser.

  1. Click Edit on System Information
  1. Select either Capture with Reset or Capture without Reset and click the button. Capture with Reset will make a backup of your poolConfig.json/poolState.json in the /data directory.
  1. Click stop when you have captured the information required to diagnose the issue.

The browser will automatically download a file called Replay.zip that you can attach to the issue. NOTE: Some users have experienced issues with the browser downloading the file. Please make sure that you can unzip it before uploading to a case/forums. If the zip file is broken, you can manually retrieve it from ./logs directory under the directory where the app is installed.

-dashPanel

If you are using dashPanel as your web client, you can create the capture files and have them downloaded to your browser.

  1. To begin, click the hamburger menu on the upper left corner of the dashPanel display to open the settings menu.

image

  1. Select the logging tab in the settings window and click the Capture Replay button. A dialog will be displayed that allows you to reload the configuration while capturing the communications.

image

Under most circumstances a complete reload provides the most information for troubleshooting. This action is taken when the Capture Configuration Relaod checkbox is checked. Uncheck this box to capture a particular situation regarding your controller. For instance, the communications that occur when you turn a circuit on or off. When you are satisfied with your selections press the Begin Capture button.

image

  1. After pressing the Begin Capture button the Select Capture Options dialog will close and the capture will begin. At this time the Capture Replay Button will change to Cancel Capture. If the Capture Configuration Reload option is checked the software will start requesting configuration items from the equipment installed on your pool.

image

  1. Perform the necessary actions to capture the issue in its entirety. If the issue has to do with the configuration wait until the dashPanel header changes from Loading to Ready. When you are done capturing the information, navigate to the Logging tab on the Settings dialog and press the Cancel Capture button.

image

IMPORTANT: Do not leave the the software in the capture mode. This will continue to capture information at great detail until consumes all the available storage on the device that is running njspc.

  1. After you press the Cancel Capture button the results of the capture will be downloaded to your browser in the form of a .zip file. Upload that file with a detailed description of your issue. Depending on your browser platform, this will appear on the footer of the browser.

IMPORTANT: In case you didn't read the statement above. Do not leave the the software in the capture mode. This will continue to capture information at great detail until consumes all the available storage on the device that is running njspc.

API method

This method calls the same API's as the -webClient method but can be useful if you don't have the -webClient running.

Start the capture with either:

  • server:4200/app/config/startPacketCapture - this will call a "reset" of your poolController app. This method will make a backup of your poolConfig.json/poolState.json in the /data directory.

  • server:4200/app/config/startPacketCaptureWithoutReset - starts a capture with your existing configuration.

Stop the capture with:

  • server:4200/app/config/stopPacketCapture - This will stop the packet capture and download a zip file in your local browser with the name as the current date and a zip extension, eg 2020-05-25_21-09-43.zip.

Command line

To use this from the command line, set config.json property {log: {app: {captureForReplay: true}}}. This will capture the process from whatever state the app is in when you start it. EG if you have already initialized the pool controller it will start with your existing configuration files.

To start with a clean configuration, manually make a backup (or delete) your data\poolConfig.json and data\poolState.json files and start the app.

To stop the capture, do one of three things:

  1. Stop the application from the command line using Cmd-C or Ctrl-C (let it exit normally; do not kill the process).
  2. Use the stop method for the -webClient as listed above
  3. Use the stop method for the API's as listed above.

Packet capture - 5.2 to 5.3

Starting with 5.2, there is a new capture/replay tool available for troubleshooting. This captures your logs, config file, incoming/outgoing packets, and URL actions. The only thing you need to manually capture are any errors that are logged in the console (in the event of an app crash).

How to capture all packets

  1. Start the app with npm run start:capture {config.json}
  2. After you experience the error/behavior/bug stop the app. There will be three new files in the replay directory. Include those three files when communicating any issues.

What to include

  1. What version of the code are you using
  2. What is causing the error
  3. All three files from the /replay directory.
  4. Any errors that are in the console
  5. Your pool equipment

Packet capture - 5.1.x and earlier

In order to have a full picture of what is happening, and what is broken, it is necessary to see the full packet information that is output from the system.

What to include

  1. What version of the code are you using
  2. What is causing the error
  3. All output from the file log (See below)
  4. Any errors that are in the console
  5. Your config.json or in-use configuration file
  6. Your pool equipment

Setup your file log

In your config.json, there are a number of sections that you should enable:

        "log": {
            "logLevel": "info",
            "socketLogLevel": "info",
            "fileLog": {
                "enable": 1,   // Turn on the file log
                "fileLogLevel": "silly",  // leave this on 'silly' to capture everything
                "fileName": "output.log"
            },
            "logPumpMessages": 1,  // set all log variables to 1 to capture everything
            "logDuplicateMessages": 1,
            "logConsoleNotDecoded": 1,
            "logConfigMessages": 1,
            "logMessageDecoding": 1,
            "logChlorinator": 1,
            "logIntellichem": 1,
            "logPacketWrites": 1,
            "logPumpTimers": 1,
            "logReload": 01,
            "logApi": 1

Capture the error

Once you have the above setup, restart the app, wait for it to finish the configuration process (i.e. with Intellitouch) and then replicate the error. Everything (except the error) should be captured in the logs.