05. Debug Log Acquisition
Operation scripts that are executed on NEQTO devices are developed using neqto.js (JavaScript).
In doing so, the print method is utilized to output arbitrary logs for debugging and evaluation.
Overview
The following logging methods are available:
> start↵
OK
> [system][info]Certification Complete(00.00.00)
[system][info]Checking Script...
[system][info]Ready
Thu Apr 08 2021 02:31:03 GMT+00:00+766ms : Hello World!!! 0
Thu Apr 08 2021 02:31:04 GMT+00:00+766ms : Hello World!!! 1
Thu Apr 08 2021 02:31:05 GMT+00:00+766ms : Hello World!!! 2
Thu Apr 08 2021 02:31:06 GMT+00:00+766ms : Hello World!!! 3
Thu Apr 08 2021 02:31:07 GMT+00:00+766ms : Hello World!!! 4
Thu Apr 08 2021 02:31:08 GMT+00:00+766ms : Hello World!!! 5
Thu Apr 08 2021 02:31:09 GMT+00:00+766ms : Hello World!!! 6
Thu Apr 08 2021 02:31:10 GMT+00:00+766ms : Hello World!!! 7
Thu Apr 08 2021 02:31:11 GMT+00:00+766ms : Hello World!!! 8
Thu Apr 08 2021 02:31:12 GMT+00:00+766ms : Hello World!!! 9
Thu Apr 08 2021 02:31:13 GMT+00:00+766ms : Hello World!!! 10
Method for sending logs to NEQTO Console in real time and viewing logs on NEQTO Console
Log settings
If using the log function, it is necessary to set the output destination of the log in advance.
Use the methods of the Log object in the JavaScript code to configure the settings.
Logging methods
1. Method for connecting a NEQTO device to a local PC and using User Console mode to view real-time logs
Configure the log output destination using the printLevel method of the Log object.
Add the following code to the script of the target node.
Specify the output destination "Outputs the log from the serial port of NEQTO device".log.printLevel(2);
Launch the NEQTO device in the User Console Mode.
Open the COM port using a terminal software and enter the command console.
> ↵
> ↵
>
Enter the
start
command to launch the NEQTO service and output the print log.
> start↵
OK
> [system][info]Certification Complete(00.00.00)
[system][info]Checking Script...
[system][info]Ready
Thu Apr 08 2021 02:31:03 GMT+00:00+766ms : Hello World!!! 0
Thu Apr 08 2021 02:31:04 GMT+00:00+766ms : Hello World!!! 1
Thu Apr 08 2021 02:31:05 GMT+00:00+766ms : Hello World!!! 2
Thu Apr 08 2021 02:31:06 GMT+00:00+766ms : Hello World!!! 3
Thu Apr 08 2021 02:31:07 GMT+00:00+766ms : Hello World!!! 4
Thu Apr 08 2021 02:31:08 GMT+00:00+766ms : Hello World!!! 5
Thu Apr 08 2021 02:31:09 GMT+00:00+766ms : Hello World!!! 6
Thu Apr 08 2021 02:31:10 GMT+00:00+766ms : Hello World!!! 7
Thu Apr 08 2021 02:31:11 GMT+00:00+766ms : Hello World!!! 8
Thu Apr 08 2021 02:31:12 GMT+00:00+766ms : Hello World!!! 9
Thu Apr 08 2021 02:31:13 GMT+00:00+766ms : Hello World!!! 10
2. Method for storing logs in non-volatile memory on a NEQTO device and getting logs by remote instruction from NEQTO Console
Configure the log output destination using the printLevel method of the Log object.
Add the following code to the script of the target node.
Specify the output destination "Saves the log to the non-volatile memory on the NEQTO device".log.printLevel(1);
Run the script.
The print log will be stored in the non-volatile memory.Send the instruction "Get debug log" to the target node from NEQTO Console.
When the NEQTO device receives the "Get Debug Log" instruction from the NEQTO Console, it will exit the operation script and start uploading the log. After the log transfer is completed, the operation script will be executed again. Note that if the log transfer is successful, the log in the non-volatile memory is erased.
After a period of time, the log data from the device will have been uploaded to the NEQTO Console.
Download the log data.
Open the downloaded file with a text editor and review the log.
3. Method for sending logs to NEQTO Console in real time and viewing logs on NEQTO Console
- Refer here in advance, and confirm the details regarding this feature.
- This feature uses NEQTO Infinitypool.
An optional subscription is required to use NEQTO Infinitypool.
Configure the log output destination using the printLevel method of the Log object.
Add the following code to the script of the target node.
Specify the output destination "Sends the log to NEQTO Console in real time".
Specify any value for instance ID. (ex.100
)log.printLevel(4,100);
Configure the component settings on the NEQTO Console.
Add the following components to the template of the target node.
Name Note Object Resource Instance Any (ex. DebugLog
)Any Addressable Text Display Text Any (ex. 100
)Run the script.
The print log will be displayed in the component (DebugLog
).