Code: Select all
runfile('C:/Phidget/Phidget_HUM1001_0_Python_Example/example.py', wdir='C:/Phidget/Phidget_HUM1001_0_Python_Example')
Traceback (most recent call last):
File "C:\Phidget\Phidget_HUM1001_0_Python_Example\example.py", line 38, in <module>
main()
File "C:\Phidget\Phidget_HUM1001_0_Python_Example\example.py", line 29, in main
humiditySensor0.openWaitForAttachment(20000)
File "C:\Users\Nicol\anaconda3\lib\site-packages\phidget22-1.7.20210504-py3.8.egg\Phidget22\Phidget.py", line 574, in openWaitForAttachment
raise PhidgetException(result)
PhidgetException: PhidgetException 0x03 (Timed Out)
No matching devices were found to open. Make sure your device is attached, and that your addressing parameters are specified correctly. If your Phidget has a plug or terminal block for external power, ensure it is plugged in and powered.
Make sure to enable server discovery, or add the server, and to set the server password if autentication is enabled.
My PhidgetSBC 4 is connected to my laptop with an eternet cat6 connection.
I tried to check the ports to which my Humidity sensor is attached. I read that it doesn't support two open windows and so I closed everything. I write the code (it is that of the example).
Code: Select all
from Phidget22.Phidget import *
from Phidget22.Net import *
from Phidget22.Devices.Log import *
from Phidget22.LogLevel import *
from Phidget22.Devices.HumiditySensor import *
import time
def onHumidityChange(self, humidity):
print("Humidity: " + str(humidity))
def onError(self, code, description):
print("Code: " + ErrorEventCode.getName(code))
print("Description: " + str(description))
print("----------")
def main():
Log.enable(LogLevel.PHIDGET_LOG_INFO, "phidgetlog.log")
Net.enableServerDiscovery(PhidgetServerType.PHIDGETSERVER_DEVICEREMOTE)
humiditySensor0 = HumiditySensor()
humiditySensor0.setHubPort(0)
humiditySensor0.setIsRemote(True)
humiditySensor0.setDeviceSerialNumber(592071)
humiditySensor0.setOnHumidityChangeHandler(onHumidityChange)
humiditySensor0.setOnErrorHandler(onError)
humiditySensor0.openWaitForAttachment(20000)
try:
input("Press Enter to Stop\n")
except (Exception, KeyboardInterrupt):
pass
humiditySensor0.close()
main()