VINT HUB5000_0 and TMP1101_1 detected but not

Comments & issues
Post Reply
thunderbooty
Fresh meat
Posts: 2
Joined: Thu Jun 01, 2023 12:25 pm
Contact:

VINT HUB5000_0 and TMP1101_1 detected but not

Post by thunderbooty »

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...?

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()
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."
User avatar
Patrick
Lead Developer
Posts: 3399
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: VINT HUB5000_0 and TMP1101_1 detected but not

Post by Patrick »

Hi,

HUB5000 is a network Phidget, so you'll need to select 'Remote (Network)' in the code sample generator.

-Patrick
thunderbooty
Fresh meat
Posts: 2
Joined: Thu Jun 01, 2023 12:25 pm
Contact:

Re: VINT HUB5000_0 and TMP1101_1 detected but not

Post by thunderbooty »

Oh wow that worked thanks! :oops: I was under the impression that that was for when the wireless was being used.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests