yoctopuce / yoctolib_python

Official Yoctopuce Library for Python
https://www.yoctopuce.com/EN/article/how-to-start-in-python-with-yoctopuce-modulesp
20 stars 12 forks source link

Can't connect with python, but can connect with VirtualHub. #2

Closed spott closed 8 years ago

spott commented 8 years ago

YGenericSensor.FirstGenericSensor() == None, when a device is connected, and the VirtualHub still finds it.

I am on OS X Sierra, and I'm not sure how to debug this further. This is a Thermistor-C module.

yoctopuce commented 8 years ago

Did you check the result of YAPI.RegisterHub ? Remember, you can't have more than one application accessing the device in USB native mode at the same time. see: http://www.yoctopuce.com/EN/article/error-message-another-process-is-already-using-yapi

yoctopuce commented 8 years ago

The Thermistor-C has 6 Temperatures interface so you need to use the YTemperatureclass not the YGenericSensor class.

The right code is : YTemperature.FirstTemperature()

Note: You could also use the YSensor or YFunction class since YTemperature is a subclass of YSensor witch is a subclass of YTemperature. YGenericSensor it a class that is used in module that emulate a sensor from another protocol (ex Yocto-RS232, Yocto-4-20mA-Rx, Yocto-SPI, etc...)

spott commented 8 years ago

Thank you very much. I must have missed this in the documentation.