General Troubleshooting: Difference between revisions

From Phidgets Support
No edit summary
 
(103 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__TOC__
[[Category:Troubleshooting]]
__NOTOC__


Although Phidgets are designed to be easy to use, they are actually a complex system with many levels of interfacing between the Phidget, cables, possible networking, operating systems, USB ports, the Phidget libraries, and ultimately your code.


To troubleshoot a problem with a Phidget device or program, we strongly recommend using a logical approach to pin down the source.  Although Phidgets are designed to be easy to use, they actually are a complex system with many levels of interfacing between the Phidget, cables, possible networking, operating systems, USB ports, the Phidget Libraries, and ultimately your code.
The easiest way to find the problem in your system is to run through some simple tests to rule out certain parts of the system.  


To help you narrow down the source of the problem into a specific part of the overall system, we provide an overview of the entire system below.  In each <span style="background:#EDEDED;padding:5px;border:1px dashed;">grey box</span> we show the affected parts of the system (computer platform, the Phidget, your code, etc) and a simple step or two you can take to see if the problem is within that part of the overall system.


Once you have found the <span style="background:#EDEDED;padding:5px;border:1px dashed;">part of your system</span> with the problem, click on the <font size="+1">'''<span style="color:#006600">green link</span>'''</font> within the box to learn more about how to troubleshoot that portion.


[[Image:troubleshooting.png|1200px]]


The content that you need to solve your problem probably exists somewhere within our documentation.  We cover everything from compiling the Phidget Libraries for embedded systems, to using our example on Visual Studio 6, to how Solid State Relays actually work.  The purpose of this page, then, is to distill the problem you have enough that you can get to the documentation you need.
==== Step 1: Test in Phidget Control Panel ====
[[Image:TMP1000_Panel.jpg|link=|right|300px]]


==Quick Links==


The sections linked from the image above are:


* [[#Code Troubleshooting | <span style="color:#006600">Code Troubleshooting</span>]]
Plug your Phidget into the computer test it using the [[Phidget Control Panel]] as outlined in the [[User Guides|User Guide]] for your device (For Linux users, just proceed to the step 2 instead). Choose the section that best matches the result you get and click on '''"Expand"''' to the right:
* [[#Operating System Troubleshooting | <span style="color:#006600">Operating System Troubleshooting</span>]]
<br clear="all">
* [[#Communications Troubleshooting | <span style="color:#006600">Communications Troubleshooting</span>]]
----
* [[#Webservice Troubleshooting | <span style="color:#006600">Webservice Troubleshooting</span>]]
{{Collapse
* [[#Device Troubleshooting | <span style="color:#006600">Device Troubleshooting</span>]]
|The Phidget doesn't show up in the control panel
|This often indicates an issue with your computer's operating system or the Phidget's hardware. First, go to the [[OS Troubleshooting]] page to make sure the Phidget can be seen on the USB, and then visit the [[Hardware Troubleshooting]] page.
}}
----
{{Collapse
|The Phidget shows up but the text or row is coloured red
|
[[File:Controlpanel_mac_firmwareupgrade.png|link=|300px|right]]


==Code Troubleshooting==
On MacOS, the red text means that a firmware update is available for your device. In older versions of the Windows control panel, the row may be red for the same reason (newer versions show a blue arrow instead). Double-clicking on the red bar or text will download and install the update, which should take less than a minute. If the firmware update fails, you may need to download the latest version of the Phidget drivers and try again. Once the device is updated and working, you can proceed to [[#Step 2: Test with our Sample Code|step 2]].


To determine whether the problem is in your code, '''you should run the provided examples''' for [[Software Overview#Language Support|your programming language]].


* If the examples run, the problem is within your code.
}}
* If the examples do not run, the problem is at a lower level in the system.  Read on to the [[#Operating System Troubleshooting|operating system troubleshooting]] section below.
----
{{Collapse
|When I open a channel on the device it says "Attached: Nothing" or "Resource Busy"
|A Phidget can only be opened in one program at a time, including the Phidget control panel. This behaviour usually means another program or process already has that channel open. Try closing all other programs, and if that doesn't work, go into the task manager and shut down any processes by other programs that use Phidgets. Rebooting may also work if the other program using the Phidget doesn't launch on startup.  


'''If the problem is in your code...'''
If the problem persists, try testing the Phidget on a different computer if possible. If it still has the same problem on multiple computers, {{ContactUs|contact support}} .
:*Syntax help can be found in the API download and code snippets for [[Software Overview#Language Support|your programming language]]
}}
:*High-level concept help (logging, catching errors, using the API) is on the [[General Phidget Programming]] page
----
:*Generic API help (error types and codes, information about each function) is on the [[General API]] page.
{{Collapse
:*Help using hardware in code (number of ports returned in code, maximum software sampling speed) can be found in the ''Software/API'' section on the [[Device List|page for your device]]
|I can't find the Control Panel [[File:Ph.jpg|link=]] icon in my system tray
:*Compiler help (linking libraries, running code) can be found on the [[Software Overview#Language Support | page for your language]]
|For Windows users, navigate to <code>C:\Program Files\Phidgets\Phidget22</code> and run <code>Phidget22Manager.exe</code>. For MacOS users, you can run the Phidget Control Panel from the Applications list.  
:*Ensure you wait enough time for the Phidget to respond to your requests, such as when switching between ratiometric and non-ratiometric sensing, or to get and set device data.


To download and run the examples, visit the page about [[Software Overview#Language Support | your programming language]].  The ''Software/API'' section within the [[Device List|page for your device]] will tell you the software object -- and thus example file name -- for your Phidget.  Make sure to use either that device-specific example, or the '''<code>HelloWorld</code>''' example if there is not an example specifically for your device.
If you find that you need to manually open the Control Panel like this every time you start up your computer, you should open the options and make sure the setting for automatic startup is checked.


When debugging, it helps to extract from your code what is known as a '''Minimum Reproducible Unit''' (MRU).  This is the minimum lines of code that can reproduce the issue. We can help with this.  An MRU will allow you to find what part of your use of Phidgets in code is causing the problem.    Extracting an MRU is a powerful process which can not only isolate the problem, but also allow you to examine and organize your code.  Also, it helps us debug your problem faster if you can show exactly what the problem is in your Phidget API code.
If you can't find the control panel in the places listed above, your Phidgets drivers may not have installed correctly. Go to the [[Operating_System_Support|page for your OS]] and follow the instructions to install the drivers.
}}
----


If you have found problematic lines and want to see what is wrong, you can turn on '''Phidget logging'''.  Logging can save and display many different levels of messages (errors, debugging, or even individual Phidget library actions) to either a file or the program console.  You can find help to turn logging on and off in the [[General Phidget Programming#Logging | logging section]] of our General Phidget Programming guide.


'''Note:''' We do not offer services to debug general programming projects, or to develop code from scratch.  We do, however, support any and all questions about the Phidgets and their use. So, if you have ideas for helpful examples, more documentation, or other useful material we could provide, we welcome your suggestions!
Once you've successfully tested with the Control Panel, you can rule out most hardware and operating system issues. Next we'll try some sample code.


==Operating System Troubleshooting==


To determine whether the problem is in your operating system, you should '''check whether your system detects the Phidget''' by following the ''Troubleshooting'' section on the page for [[Software Overview#Operating System Support|your operating system]].  Commonly, this is done with:
*The Device Manager in [[OS - Windows#Troubleshooting|Windows]]
*The "About This Mac" menu in [[OS - Mac OSX#Troubleshooting|Mac OS X]]
*The kernel logs via '''<code>dmesg | tail</code>''' in [[OS - Linux#Troubleshooting|Linux]]


If you plug in the Phidget and the system shows:
* It does not appear, or
* It does not disconnect, or
* It only appears sometimes
The problem is probably in the communication portion of the system, or at a lower level. 
Start with the [[#Communications Troubleshooting | Communications Troubleshooting]] section below and work your way down.


'''If the problem is with your operating system...'''
====Step 2: Test with our Sample Code====
:*Make sure '''no other programs''' are accessing the Phidget USB port at the same time as your code.  This '''includes''' the [[Phidget Control Panel]] on Windows and the [[Phidget Preference Pane]] on Mac OS X.
:*Make sure your [[Software Overview#Operating System Support | operating system version is supported]]; this includes virtual machine versions (check the page for both the host and emulated machines)
:*Ensure the Phidget libraries and drivers [[Software Overview#Operating System Support | for your operating system]] are the '''most recent''' version
:*Check the ''Limitations'' section [[Software Overview#Operating System Support | for your operating system]] as some problems arise from special combinations


If, on the other hand, your computer ''consistently detects'' the Phidget on the USB port ''but the libraries fail to communicate with it'' (i.e. the provided examples do not run, as [[#Code Troubleshooting | described above]]), the problem is probably (a) your Phidget library versions, (b) other, third-party drivers causing a conflict, or (c) your operating system.  Details about these problems for each platform can be found in the ''Troubleshooting'' section on the page [[Software Overview#Operating System Support | for your operating system]].
You can find our sample code downloads on [{{SERVER}}/?view=code_samples this page]. Select your desired programming language from the drop-down menu and select the object type that matches one used by your Phidget. Then go to the [[Programming_Resources|language page]] for your programming language and run through the instructions for running code in your chosen development environment.


==Communications Troubleshooting==
----
{{Collapse
|The Phidget channel fails to open / I get a timeout error
|Make sure you're setting all of the matching parameters correctly. You can learn more by reading our page on [[Addressing Phidgets]]. Also make sure that the channels you're trying to open aren't already opened in another program (including the Phidget Control Panel).
}}
----
{{Collapse
|I get a compiler error when I try to run the code
|If the code sample doesn't compile, there's probably something wrong in the build settings or a certain file may be in the wrong location. Double check the instructions on the language page to ensure that you've set everything up properly. If you still get compiler errors, {{ContactUs|contact us}} with a screenshot or copy+paste of your error and tell us what operating system, code sample, and Phidget you're using.
}}
----
{{Collapse
|I get a runtime error when I try to run the code
|If the error is reported by the Phidget library, you can find it on the {{Phidget22API}}. If it's being reported from basic functions in your language, try searching the exact text of the error on google to see if other users have had the same one. If that doesn't work, {{ContactUs|contact us}} with a screenshot or copy+paste of your error and tell us what operating system and Phidget you're using.
}}
----


To determine whether the problem is a communications problem, '''check operation using the shortest, most direct connection you can''', including both:
*Data connections, and
*Power connections


'''If you believe a connection may be at fault:'''
:*Use [[Communication Protocols#USB|short USB cables]] (&lt;5 m)... long wires lead to poor sensor data and/or inadequate power
:*Use powered USB hubs or direct connections to a computer. 
:*Try unplugging everything on the hub except the Phidget.
:*Make sure any cables between Phidgets are correctly connected. Helpful pictures can be found on the ''Getting Started'' [[Device List|page for your device]]
:*If your Phidget needs external power, such as the motors and relays, the proper way to provide it can be found on the product page [[Device List | for your device]]


Communication problems come from either (a) power issues, or (b) connection issues.  Once everything is plugged in and powered properly, there is not a whole lot that can go wrong with cables.


The one exception to communications problems being only from power or connections is if you're using a wireless internet connection to the [[SBC|Single Board Computer]].  Help for setting up and troubleshooting that Wifi connection can be found on the [[SBC|SBC product page]].
Once you get our sample code working, you can be assured that your drivers and development environment are set up properly and your Phidget working as intended. If you're still having problems, have a look at our other troubleshooting topics:


==Webservice Troubleshooting==
* [[OS Troubleshooting]]
 
* [[Code Troubleshooting]]
;Quick Fixes...
* [[Hardware Troubleshooting]]
:Make sure the Phidget library versions are the '''same''' on both computers.  The Webservice and libraries are on the [[Software Overview#Operating System Support | page for your operating system]]
* [[Network Server Troubleshooting]]
:Wait a little time before trying to do things with the Phidget upon first connecting remotely, sometimes delay occurs over a network
* [[Troubleshooting Common Issues]]
:Check the network setup on both sides (IP address and port correct?  Server name spelling?  User name and password?)
 
To narrow down the problem to the Webservice, try using the Phidget only on the ''directly'' connected system.  Then, if possible, also try using the Phidget on the ''remotely'' controlling system.  (Some platforms only allow remote use, so this may not be possible.)
 
If the Phidget works locally on both ends but not remotely, the problem is with the Webservice.  First, try slowing your program down.  Sometimes a network will introduce a bit of delay.  This will primarily affect how quickly you can use the Phidget after opening and attaching it, as well as the speed of reading continuous data from the device.  Using a '''<code>sleep</code>''' or '''<code>wait</code>''' function for short periods at these points will slow down your program.  If the program works when slowed, network lag is probably at fault.
 
Another problem might be an error in the numerous details that need to match on each computer.  You either need an IP address and port, or the server name (when using muticast DNS from '''<code>Bonjour</code>''' on Windows and Mac OS X or '''<code>avahi</code>''' on Linux).  The server name is set at the Webservice start up, or it will default to the name of the computer with the direct connection.  Double-checking all of these details may uncover the problem.
 
Finally, if you suspect multicast DNS may be the problem, use the IP address and port form of '''<code>open()</code>''' (if you can) to directly connect to the computer controlling the Phidget.
 
==Device Troubleshooting==
 
;Quick Fixes...
:What your device can and can't do (power, functionality, etc) will be found on [[Device List|its product page]].
:Make sure all the pieces are hooked up correctly.  Helpful photos can be found on the ''Getting Started'' page [[Device List|for your device]].
:If you're trying to do something especially involved, become well-versed in your hardware.  We provide lots of education on our [[Primers| primer pages]].
 
An easy way to tell you have a '''new''' problem with your device is that it suddenly stops working.  If you run the same code, on the same system, with the same libraries, and the same Phidget and suddenly it doesn't do the same thing anymore, you almost certainly have a hardware problem.
 
This can happen especially on boards and/or components that handle some form of external power (motors, relays, etc).  It is important to make sure you don't overload the board, or you could do some serious damage.  Check the [[Device List|specs for your device]] and remember, be conservative!
 
However, sometimes you get a board right out of the box and it doesn't seem to work.  Some Phidgets, being flexible to many tasks, have their own connections between sensors, batteries, power, intermediate boards (like temperature), and so on.  Although usually this is an intuitive hookup process, take another look at the photos in the ''Getting Started Guide'' for [[Device List |your device]] and make sure all the wires are in their proper place. 
 
Once you have confirmed this, slow down and (if you haven't already) work carefully through the setup process. starting with that same ''Getting Started Guide'' for your device - to make sure it is indeed a problem with the hardware.  This troubleshooting page itself shows that even something as simple as a device "not working" could be due to a problem at several different points.
 
==Contact Us==
 
If you are still having trouble after working through this guide, please [[Contact Us|contact us]].
 
It helps if you can you can give us precise information about your issue, such as:
*Minimal code to reproduce the problem
*What part of the system you think the issue might be in, and why
*And, of course, photos or even videos (we love these)!

Latest revision as of 17:08, 20 January 2022


Although Phidgets are designed to be easy to use, they are actually a complex system with many levels of interfacing between the Phidget, cables, possible networking, operating systems, USB ports, the Phidget libraries, and ultimately your code.

The easiest way to find the problem in your system is to run through some simple tests to rule out certain parts of the system.



Step 1: Test in Phidget Control Panel

TMP1000 Panel.jpg


Plug your Phidget into the computer test it using the Phidget Control Panel as outlined in the User Guide for your device (For Linux users, just proceed to the step 2 instead). Choose the section that best matches the result you get and click on "Expand" to the right:


The Phidget doesn't show up in the control panel

This often indicates an issue with your computer's operating system or the Phidget's hardware. First, go to the OS Troubleshooting page to make sure the Phidget can be seen on the USB, and then visit the Hardware Troubleshooting page.


The Phidget shows up but the text or row is coloured red
Controlpanel mac firmwareupgrade.png

On MacOS, the red text means that a firmware update is available for your device. In older versions of the Windows control panel, the row may be red for the same reason (newer versions show a blue arrow instead). Double-clicking on the red bar or text will download and install the update, which should take less than a minute. If the firmware update fails, you may need to download the latest version of the Phidget drivers and try again. Once the device is updated and working, you can proceed to step 2.



When I open a channel on the device it says "Attached: Nothing" or "Resource Busy"

A Phidget can only be opened in one program at a time, including the Phidget control panel. This behaviour usually means another program or process already has that channel open. Try closing all other programs, and if that doesn't work, go into the task manager and shut down any processes by other programs that use Phidgets. Rebooting may also work if the other program using the Phidget doesn't launch on startup.

If the problem persists, try testing the Phidget on a different computer if possible. If it still has the same problem on multiple computers, contact support .


I can't find the Control Panel Ph.jpg icon in my system tray

For Windows users, navigate to C:\Program Files\Phidgets\Phidget22 and run Phidget22Manager.exe. For MacOS users, you can run the Phidget Control Panel from the Applications list.

If you find that you need to manually open the Control Panel like this every time you start up your computer, you should open the options and make sure the setting for automatic startup is checked.

If you can't find the control panel in the places listed above, your Phidgets drivers may not have installed correctly. Go to the page for your OS and follow the instructions to install the drivers.



Once you've successfully tested with the Control Panel, you can rule out most hardware and operating system issues. Next we'll try some sample code.



Step 2: Test with our Sample Code

You can find our sample code downloads on this page. Select your desired programming language from the drop-down menu and select the object type that matches one used by your Phidget. Then go to the language page for your programming language and run through the instructions for running code in your chosen development environment.


The Phidget channel fails to open / I get a timeout error

Make sure you're setting all of the matching parameters correctly. You can learn more by reading our page on Addressing Phidgets. Also make sure that the channels you're trying to open aren't already opened in another program (including the Phidget Control Panel).


I get a compiler error when I try to run the code

If the code sample doesn't compile, there's probably something wrong in the build settings or a certain file may be in the wrong location. Double check the instructions on the language page to ensure that you've set everything up properly. If you still get compiler errors, contact us with a screenshot or copy+paste of your error and tell us what operating system, code sample, and Phidget you're using.


I get a runtime error when I try to run the code

If the error is reported by the Phidget library, you can find it on the Phidget22 API. If it's being reported from basic functions in your language, try searching the exact text of the error on google to see if other users have had the same one. If that doesn't work, contact us with a screenshot or copy+paste of your error and tell us what operating system and Phidget you're using.




Once you get our sample code working, you can be assured that your drivers and development environment are set up properly and your Phidget working as intended. If you're still having problems, have a look at our other troubleshooting topics: