General Troubleshooting: Difference between revisions

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


==Getting Started==
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.
===Why you're here===
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.
===Not sure where your problem lies?===
====Code Issues====
If you are having issues with writing your own code, the first place to look is the {{Phidget22API}}.


Next, make sure your Phidget libraries are up-to-date. After installing the latest libraries, run one of our provided examples. If the example works, check your code: [[#Code Troubleshooting|Code Troubleshooting]].
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.  


If the example doesn't work, you may have a platform issue.
====Platform Issues====
First, plug in your Phidget and check the system logs. If the Phidget appears, see [[#Operating System Troubleshooting|Operating System Troubleshooting]].


If the Phidget unreliably appears, you may have a communications issue.
====Communication Issues====
If your Phidget sometimes appears in your system logs, see [[#Communications Troubleshooting|Communications Troubleshooting]].


If it never appears, you may have a hardware issue.
====Hardware Issues====
Use this process to debug the Phidget on a different computer. If it does not work on any computer, see [[#Device Troubleshooting|Device Troubleshooting]].


====Network Server Issues====
==== Step 1: Test in Phidget Control Panel ====  
If you think you are having a Network Server issue, try running the Phidget locally. If the Phidget works locally, see [[#Network Server Troubleshooting|Network Server Troubleshooting]]
[[Image:TMP1000_Panel.jpg|link=|right|300px]]




==Code Troubleshooting==
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.
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:
* 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.
<br clear="all">
----
{{Collapse
|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 row is coloured red
|
[[File:Controlpanel_windows_firmwareupgrade.png|link=|300px|right]]
This means that a firmware update is available for your device. Double-clicking on the red bar 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]].
}}
----
{{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 {{Phidget22API}} 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
----
:*Compiler help (linking libraries, running code) can be found on the [[Software Overview#Language Support | page for your language]]  
{{Collapse
:*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.
|I can't find the Control Panel [[File:Ph.jpg|link=]] icon in my system tray
|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.  


To download and run the examples, visit the page about [[Software Overview#Language Support | your programming language]].  The API section on the product page for your device [{{SERVER}} on our main website] will tell you the software object -- and thus example file name -- for your Phidget.  Make sure to use either that object-specific example or the '"HelloWorld" example if one is available.
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 the part of your code that deals with Phidgets.
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 [[Logging,_Exceptions,_and_Errors | Logging, Exceptions, and Errors]] page.


'''Note:''' We do not offer services to debug general (non-Phidgets) programming projects, or to develop code from scratch.  We do, however, support any and all questions and suggestions about Phidgets and their use. So, if you have ideas for helpful examples, more documentation, or other useful material we could provide, we welcome them!
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==
===macOS===
First, make sure you have followed the [[OS - macOS#Getting Started with macOS|getting started]]  guide on the macOS page.


You should now have the latest Phidget software installed and have the Phidget Control Panel running. If your device is not listed in the Phidget Control Panel, verify that your computer has detected the Phidget via USB. To do that, follow these steps:


1. Navigate to the Apple Menu and select About This Mac
[[File:OSX About This Mac.png‎|link=|alt=macOS About This Mac|center]]


2. Click on the System Report button. Find your Phidget in the USB section.
====Step 2: Test with our Sample Code====
[[File:OSX USB Devices.png ‎|link=|alt=macOS Attached USB Devices|center]]


If you can see your Phidget in the USB list even though it does not show up in the Phidget Control Panel take a moment to check the basics:
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.
* You are using macOS X 10.5 or newer
* No other programs, drivers, or processes are using that USB port in software (including other programs trying to use Phidgets)
* Your Phidget libraries are up-to-date


----
{{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.
}}
----


If your problem is not solved, there might be a [[#Communications Troubleshooting|communication]] issue.


===Windows===
First, make sure you have followed the [[OS - Windows#Getting Started with Windows|getting started]]  guide on the Windows page.


You should now have the latest Phidget software installed and have the Phidget Control Panel running. If your device is not listed in the Phidget Control Panel, verify that your computer has detected the Phidget via USB. To do that, follow these steps:


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:


1. Open the Device Manager by accessing the start menu, and searching for ''Device Manager''. Under the Human Interface Devices heading there should be a HID-compliant device and a USB Input Device entry for every Phidget. Simply disconnect/connect a Phidget to verify which one it is on the list.
* [[OS Troubleshooting]]
 
* [[Code Troubleshooting]]
[[File:Windows_DeviceManager.PNG|link=|alt=Windows Device Manager | center]]
* [[Hardware Troubleshooting]]
 
* [[Network Server Troubleshooting]]
2. Another place you can see attached Phidgets is "Devices and Printers" which you can also open by searching for it in the start menu.
* [[Troubleshooting Common Issues]]
 
[[File:Windows_DevicesAndPrinters.jpg|link=|alt=Devices and Printers | center]]
 
 
If you can see your Phidget in the USB list even though it does not show up in the Phidget Control Panel take a moment to check the basics:
 
*You are using Windows 7 or newer.
*You have .NET framework 3.5 or higher.
*No other programs, drivers, or processes are using that USB port in software. Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: third party software prevents communications with Phidgets for more information.
*The Phidget libraries are the latest version (visit the getting started section to download them)
*Check the common problems section below, some specific combinations can cause problems
 
 
If you don't see the Phidget in either list, try the following things:
 
*If the Phidget is connected to your PC through a USB hub, try connecting it directly to a USB port on your computer.
*If your Phidget requires an external power supply, make sure that a supply of the correct voltage is connected.
*If you're using an old USB cable, try switching it out for one you know is working.
*Try switching to a different USB port on your computer.
*Try connecting the Phidget to a different computer, especially if you have one that has worked with other Phidgets previously.
 
 
If you've tried all of these things and the Phidgets still don't show up,  there might be a [[#Communications Troubleshooting|communication]] issue.
 
==Communications Troubleshooting==
 
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 [[Electricity Primer#USB Cables|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.
:*Try plugging the Phidget directly into the computer instead of using a hub. If this solves the problem, either the hub is at fault, or the added length of cable from the hub to the computer may have caused instability.
:*Make sure any cables between Phidgets are correctly connected. Helpful pictures can be found on the [[:Category:UserGuide|User Guide]] 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 for your device [{{SERVER}} on our main website]
 
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 [{{SERVER}}/products.php?product_id=1073 Single Board Computer].  Help for setting up and troubleshooting that Wifi connection can be found on the [[OS - Phidget SBC|SBC operating system page]].
 
 
==Device Troubleshooting==
 
To determine whether the problem is with the Phidget itself, '''check whether the Phidget works on a different computer'''.
 
'''If you suspect the problem is with the hardware:'''
:*Move the setup to a different operating system.  If it appears on another system, you'll want to debug your original system starting with [[#Operating System Troubleshooting|Operating System Troubleshooting]]
:*Check what your device can and can't do (power, functionality, etc) - this will be found on its product page [{{SERVER}} on our main website].
:*Make sure all the pieces are hooked up correctly.  Helpful photos can be found on the ''Getting Started'' page for your device in its [[:Category:UserGuide|user guide]].
:*If you're trying to do something especially involved, become well-versed in your hardware.  We provide lots of information on our [[:Category:Primer| primer pages]].
 
It may be tempting to assume that a device "not working" indicates a problem with the hardware.  But 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.  The best place to start if you haven't worked through our documentation yet would be the ''Getting Started'' guide for your device, found in its [[:Category:UserGuide|user guide]].
 
===Diagnosing Hardware Problems===
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 specs for your device and remember, be conservative.
 
====Heat====
One of the surest ways to discover a problem is as simple as touching the board.  When current flows through electronics it will generate heat, this is a fundamental fact with all electronics.  The more current that you are pushing, the more heat that will be generated.  As a result of this the instance where you have the most current possible flowing (a short circuit) will also generate the most heat.  So much heat that it will likely be painful to the touch so be careful when poking and prodding the various parts of the board.  Keep in mind that some heat build up is to be expected, but if you can find a part of the board that is unusually hot then there is a strong possibility that there is a short circuit somewhere in that section and the board has been damaged.  You should {{ContactUs|contact us}} if this is the case.
 
====Checking Voltages====
If you have a multimeter at your disposal another good way of checking your board is to check that all of the ICs on the board are getting the power they should.  If you look at the labelling on the top of the ICs you should be able to get the part number of the chip.  If it is too small or hard to read you can always look at the high resolution product images on our website to get a better look.  Failing that, {{ContactUs|contact us}} and we can give you the part number.  Once you have it search the internet for a data sheet for the part.  The data sheet will have a pin diagram from which you can determine which pins are V<sub>cc</sub> and Gnd.  Take your multimeter and measure the voltage between those pins.  Does the chip appear to be getting the voltage it should be?  If not then it is possible there is a short somewhere in the power line.
 
====EMI====
One of the most difficult hardware related problems to diagnose and debug is electromagnetic interference or EMI.  In fact, it is such a complex topic that we have a guide devoted entirely to it.  If you think you may be having EMI difficulties or if you don't know what kind of difficulties you might be having (an apparent lack of other explanation is a good sign your problems might be EMI related) you should read our guide for [[Addressing Electromagnetic Interference with Phidgets|addressing EMI issues]].
 
==Network Server Troubleshooting==
 
To determine whether the problem is with the Network Server, '''check whether the Phidget can run without the Network Server''' by directly connecting it to one of the computers and running Phidget code locally on that system.
 
* This will be possible at least for the computer hosting the direct connection to the Phidget
* You can use a local version of the open() function, or use our examples as described in the [[#Code Troubleshooting|Code Troubleshooting]] section above
* For the platform remotely controlling the Phidget, this direct test may not be possible (such as for [[OS - iOS|iOS]] or some [[OS - Android|Android]] devices)
 
If the Phidget works locally but not over the network, the problem is with the Network Server.  If the Phidget does not work locally either, it is probably not the Network Server, and is instead your code, your operating system, your connections, or the device itself.  Use this Troubleshooting guide on the local system to diagnose the problem.
 
'''If the problem is within the Network Server:'''
:*Make sure the Phidget library and Network Server versions are the '''same''' on both computers.  Different Network Server versions do not work together.  Find the Network Server download on the [[Software Overview#Operating System Support | page for your operating system]]
:*Wait some time (a few seconds, to start) before trying to do things with the Phidget upon first connecting remotely, sometimes delay occurs over a network
:*Check the network setup on both sides.  Typos can occur in the IP address, port number, server name, and password.
 
Slowing your program down by using a '''<code>sleep</code>''' or '''<code>wait</code>''' function will allow you to test whether network lag is at fault. Network delay will primarily affect (a) how quickly you can use the Phidget after opening and attaching it, and (b) the speed of reading continuous data from the device.  Putting wait delays in your code especially in data-reading loops will prevent the network from being totally overloaded, and let you see whether you can get 'any' data through.
 
Another problem might be an error in the 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 OS X or '''<code>avahi</code>''' on Linux).  The server name is set at the Network Server 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 the '''<code>open()</code>''' function to directly connect to the computer controlling the Phidget.  On [[OS - Linux|Linux]], the use of mDNS can be compiled out of the Network Server, and the Network Server can be tested without it.
 
===Version Mismatch===
If you are experiencing a "Version Mismatch" error this is due to either end of the connection having an out of date version of the Network Server.  To fix this make sure that both ends are fully updated and try again.  Note that on the SBC this means you will need to go to the System->Packages tab and upgrade all of the systems packages.  For more information on upgrading the SBC refer to the [[1073 User Guide#Recovery / Upgrade System|SBC's User Guide]].
 
 
==Contact Us==
 
If you are still having trouble after working through this guide, please {{ContactUs|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
*Photos or even videos when necessary

Revision as of 20:30, 4 April 2019


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 row is coloured red
Controlpanel windows firmwareupgrade.png

This means that a firmware update is available for your device. Double-clicking on the red bar 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: