VINT HUB5000_0 and TMP1101_1 detected but not
Posted: Thu Jun 01, 2023 12:31 pm
Hello, I am using 2 VINT HUB5000_0 (only one has a temp sensor attached currently) connected via ethernet. Problem is that my python code is not finding them even though the Phidget Control Panel does. I am using the example code too. Im at my wits end, am I missing something ridiculously small or...?
The error I get is:
"Phidget22.PhidgetException.PhidgetException: PhidgetException 0x03 (Timed Out)"
"Failed to open: No Phidgets were detected at all. Make sure your device is attached."
Code: Select all
from Phidget22.Phidget import *
from Phidget22.Devices.Log import *
from Phidget22.LogLevel import *
from Phidget22.Devices.TemperatureSensor import *
import time
#Declare any event handlers here. These will be called every time the associated event occurs.
def onTemperatureChange(self, temperature):
print("Temperature: " + str(temperature))
def main():
Log.enable(LogLevel.PHIDGET_LOG_INFO, "phidgetlog.log")
#Create your Phidget channels
temperatureSensor4 = TemperatureSensor()
#Set addressing parameters to specify which channel to open (if any)
temperatureSensor4.setDeviceSerialNumber(668200)
temperatureSensor4.setHubPort(0)
#temperatureSensor4.setIsHubPortDevice(True)
temperatureSensor4.setChannel(4)
#Assign any event handlers you need before calling open so that no events are missed.
temperatureSensor4.setOnTemperatureChangeHandler(onTemperatureChange)
#Open your Phidgets and wait for attachment
try:
temperatureSensor4.openWaitForAttachment(10000)
except PhidgetException as e:
print("Failed to open: " + e.details)
#Do stuff with your Phidgets here or in your event handlers.
time.sleep(5)
#Close your Phidgets once the program is done.
temperatureSensor4.close()
main()
"Phidget22.PhidgetException.PhidgetException: PhidgetException 0x03 (Timed Out)"
"Failed to open: No Phidgets were detected at all. Make sure your device is attached."