Troubleshooting
Introduction
This is an overview to help you resolve issues you may come across when developing CDP Studio applications. We guide you in identifying the problem and how to solve it. The following sections will highlight various problems related to assembling, building, deploying, and debugging applications, and attempt to give you specific solutions to various common problems.
Where Do I Start?
A good place to start is to look at the different panes at the bottom of the CDP Studio window. Error and warning messages, together with relevant information, are shown here and often give informative indications of the problem.
Go through the relevant panes and check any errors against the ones in the sections below. If you do not find an exact match, look for similar error messages, as these may have a similar cause.
The panes can contain information that assists in discovering inconsistencies in your system that can otherwise be difficult to find. As an example, if you have a component subscribing to a source that is missing or deleted, it is listed as warnings in the Issues pane.
Below is a description of the panes; some contain information relevant to troubleshooting application problems.
Pane name | Description |
---|---|
Issues | This pane shows possible problems, either from CDP Studio itself or from the application build tools. Any issues here could indicate problems with your application that may cause it to not start, or behave incorrectly when it is running. |
Alarms | This pane shows which alarms are set in the application when it is running. Alarms typically indicate an application process data problem, such as no contact with an I/O device, a low value of a process variable and similar. |
Event History | This pane shows the history of events that have occurred in the application. This includes events such as application boot (could suggest an app has crashed and rebooted) and alarm events (emitted when an alarm is set, cleared or acknowledged). |
Search Results | This pane shows the results of your search. Each found item can be clicked to open that item. There is a History pull-down menu that shows your most recent searches. |
Application Output | This pane shows the output from your applications. It contains information such as library build dates, version control IDs, and debug information from components. |
Compile Output | This pane shows messages from the tools that generate machine-readable code from your c++ code. Typical problems are pre-processor errors (definitions / structure / include-file related), compile-time errors (code syntax) and linker errors (problems resolving references/links between libraries and the application). |
QML Debugger Console | This pane can be used to manipulate values temporarily when debugging applications with QML widgets. |
General Messages | This pane shows information from the makefile (build instructions) generator, device pairing messages and deploy issues. CDP Studio uses qmake to generate makefiles, assisted by the files in the $TOOLCHAIN/$CDPVERSION/qmakefeatures folder. |
Version Control | This pane shows information from the version control system |
Connection Info | This pane shows information about the connection between CDP Studio and running applications, such as connect, disconnect, access information, message-throttling, time-sync and other relevant messages. |
My Application Does Not Start
Below are various solutions related to getting the application to start.
Note: See also Troubleshooting Run Failure for more tips on how to resolve the failure to run applications.
Problem: 'Unable to find model for....'
Example | The issues pane is full of error messages:WebAssemblyDemoApp:16: error: Unable to find model for 'Subcomponent Name="HeaterControllerSim"'. Model 'HomeControlSim.HeaterControllerSim' does not exist. Make sure the library 'HomeControlSim' has been built. WebAssemblyDemoApp:17: error: Unable to find model for 'Subcomponent Name="LampControllerSim"'. Model 'HomeControlSim.LampControllerSim' does not exist. Make sure the library 'HomeControlSim' has been built. WebAssemblyDemoApp:18: error: Unable to find model for 'Subcomponent Name="ThermostatSim"'. Model 'HomeControlSim.ThermostatSim' does not exist. Make sure the library 'HomeControlSim' has been built. .... |
Cause | The mentioned models can not be found. |
Solution | Make sure that you have opened the library that contains the model, and that it is using the same Toolkit as the Application. The library name is usually given as the first part of the library name. In the above example, the model name 'HomeControlSim.HeaterControllerSim' implies that the library is called 'HomeControlSim'. Right-click the 'HomeControlSim' library and select Build . |
Problem: 'No such file or directory'
Example: | The code:#include "somelib.h"
gives an error message: ../../MyApp/MyAppApp/CDPMain.cpp:3:10: fatal error: somelib.h: No such file or directory #include "somelib.h" ^~~~~~~~~~~ |
Cause | You are trying to include a file that the build system can not find. It could be that the file name is not written correctly, or that the external library that you are including the file from has not been imported correctly (the library is not in the path), or that the library has not been built for the selected Toolkit. |
Solution |
|
Problem: 'not declared in this scope'
Example | The code:Output = Output + 1; gives an error message: ../RecipeLib/RecipeHandler.cpp:49:3: error: 'Output' was not declared in this scope |
Cause | A variable or function with that name is not found in any of the current namespaces. |
Solution |
|
Problem: 'invalid user-defined conversion'
Example | The code:MyProperty.SetValue(1); gives an error message: ../RecipeLib/RecipeHandler.cpp:39:25: error: invalid user-defined conversion from 'int' to 'const string& {aka const std::basic_string<char>&}' [-fpermissive] In file included from /home/user/CDPStudio/toolkits/linux_x86_64_12/toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/4.7.4/ ../../../../x86_64-pc-linux-gnu/include/c++/4.7.4/string:54:0, from ../../../CDPStudio/toolkits/linux_x86_64_12/CDP-4.9/include/CDPCore/CDPSystem/Base/CDPObject.h:14, from ../../../CDPStudio/toolkits/linux_x86_64_12/CDP-4.9/include/CDPCore/CDPSystem/Base/CDPComponent.h:17, from ../RecipeLib/RecipeHandler.h:4, from ../RecipeLib/RecipeHandler.cpp:1: /home/user/CDPStudio/toolkits/linux_x86_64_12/toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/4.7.4/../../../../ x86_64-pc-linux-gnu/include/c++/4.7.4/bits/basic_string.h:487:7: note: candidate is: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] <near match> |
Cause | You are passing an unexpected (wrong) type to a function or a variable. In the case of the std:: library, these messages can be quite verbose. The (shortened) example above shows someone passing an int when the API expects to receive a const std::string&. |
Solution | Verify that you pass the correct argument type to the function or variable. Example:MyProperty.SetValue("1") |
Problem: 'version GLIBC_X.YY not found'
Example | When trying to run the application on the target computer, it refuses to start, and shows messages similar to these:15:35:32: Starting /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App ... /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.25' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libRevolutionPiIO.so) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libStudioAPIServer.so) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libWebSocketLib.so) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.25' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libcrypto.so.1.1) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libCDPCore.so) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libCDPCore.so) /home/pi/RevPiTest1/RevPiTest1App/RevPiTest1App: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /home/pi/RevPiTest1/RevPiTest1App/lib/libCDPConfigurator.so) 15:35:32: Application finished with exit code 1. |
Cause | The target computer is running an operating system that is not compatible with the selected toolkit. |
Solution | Make sure that you have selected the correct Toolkit for the target that is chosen in the Deploy Configuration. Search for Toolkit in the Help to find the Toolkit documentation, and verify that the target computer is running an operating system that is compatible with the Toolkit. If necessary, upgrade the target operating system, or change the Toolkit. For an example toolkit, see documentation for the Linux Toolkit. |
Problem: 'Failed to start program. Path or permissions wrong?'
Example | When trying to run the application locally or remote, I get the message:16:23:01: Starting /home/user/CDPStudioWorkspace/deployments/systems/CDP_4.10_INSYS_SmartBox_ARMv7_32bit/ WebAssemblyDemo/WebAssemblyDemoApp/WebAssemblyDemoApp ... 16:23:01: Failed to start program. Path or permissions wrong? |
Cause | The most likely cause is that you are trying to run an application built with an incompatible Toolkit or that the device you are deploying to is not properly Paired. |
Solution | Make sure that you have selected the correct Toolkit for the target that is chosen in the Deploy Configuration. Search for Toolkit in the Help, and verify that the target computer is running an operating system that is compatible with the Toolkit. |
Problem: 'gdbserver: not found'
Example | When I try to debug the application, I get the error:15:14:17: Debugging starts bash: line 0: exec: gdbserver: not found |
Cause | The target device does not have gdbserver installed, or it is not reachable from any of the locations defined in the PATH variable. gdbserver is required for remote debugging to work. |
Solution | Install gdbserver on the target device. The gdbserver must be available in the $PATH of the target device. gdbserver can be copied from the correct toolkit folder, for instance:$HOME/CDPStudio/toolkits/raspbian_armv6_13/toolchain/arm-rpi-linux-gnueabihf/debug-root/usr/bin/gdbserver Search for Toolkit in the Help, and see the Toolkit documentation for the correct paths to the various toolkits. |
My Application Does Not Work
Even if the application builds and starts, it may not work properly. This may be due to various configuration errors. Some issues could be:
Problem: <Component> Is Not Working!?
Example | Some component is not performing as expected, and you don't know why. |
Cause | Many components print out warnings/errors when the Debug property is set to a value greater than 0. A larger number means more debug information. Note that excessive message printouts may impact the application's performance. |
Solution | Check the documentation for the component in question. Pressing F1 when the component is selected should take you to the correct help page, or you can search for the model name in the Help. On most components, you can set the Debug property to 1 or 2 to get more information about what it is doing. This may assist you in finding the cause of the problem. |
Problem: Modbus Communication Issue
Example | The communication with the Modbus Slave or modbus master device does not seem to work. |
Cause | The Modbus master or Modbus slave is not set up correctly, or they are not connected, or are attempting communication on different interfaces. |
Solution | See the Modbus Setup Guide for an example of how to set up both a modbus master and a modbus slave. The Modbus Configuration Manual contains generic information on modbus setup. See also the Troubleshooting paragraph, which may aid in finding faults. |
Problem: Web UI Does Not Work
Example | The web page does not show or only partially shows. |
Cause | This could be caused by incorrect values in the WebFilesToServe property in your application, Content Security Policy violations or an error in one of the files in the www folder. |
Solution | Have a look at common issues encountered while developing web interfaces. |
Problem: The Signals Do Not Change
Example | The applications starts, but when I click into the components, the signal values do not change. |
Cause | This normally happens if you run an individual application, and forget to go to the system and choose 'Connect'. |
Solution | Right-click the system and choose 'Connect'. |
Problem: Remote Application Starts, but I Am Unable to Connect
Example | When I try to run the application on a remote machine, the application starts (I can see the messagelog, and the app-icon shows that the app is running), but I can not connect to it. |
Cause | A firewall (most likely on the target) is blocking the application from communicating with external devices. |
Solution | Set up the firewall to allow the application to communicate with external devices. See allowing applications through the Windows firewall for more information about how this can be done for a Windows target. |
My Application Crashes
Application crashes may happen due to issues such as faulty or non-defensive programming. If a component crashes, the application will handle the crash by printing a stack trace of where the problem occurs and suspending the component. This will trigger the Component Suspended alarm, which can be used to put the system in a safe state. If you can reproduce the problem, you may run the application in Debug Mode to identify the root cause of the problem.
Problem: My Application Experiences Random or Strange Crashes
Example | My application, which works fine on another CDP framework version, crashes on CDP version X.YY. |
Cause | As the applications use dynamic library linking, there is a rare case where a crash might happen due to changes in a dependent library. This might happen if the same library is used in multiple projects and has different versions and implementation for different CDP Framework versions. If you use the same target and switch between these versions, and are not careful to clean the target directory before deploy, there is a chance that an old incompatible library is left on the target. This might cause the application to crash when (some) functions or variable from that library is used. |
Solution | To avoid this issue:
|
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.