Re: Timed out and 2 parallels scripts
Posted: Sat Feb 03, 2018 8:52 am
I'm still tyring but nothing...
No more ideas ?
Thanks
No more ideas ?
Thanks
Phidgets Support and Discussion forums
https://phidgets.com./phorum/
Code: Select all
INFO [netsrv][2018-03-16T10:02:45 server.c+305 main()]: Phidget22NetworkServer 1.1
Code: Select all
(136263) PhidgetInterfaceKit 0/16/16
(136263/0/0) Digital Input
(136263/0/1) Digital Input
(136263/0/2) Digital Input
(136263/0/3) Digital Input
(136263/0/4) Digital Input
(136263/0/5) Digital Input
(136263/0/6) Digital Input
(136263/0/7) Digital Input
(136263/0/8) Digital Input
(136263/0/9) Digital Input
(136263/0/10) Digital Input
(136263/0/11) Digital Input
(136263/0/12) Digital Input
(136263/0/13) Digital Input
(136263/0/14) Digital Input
(136263/0/15) Digital Input
(136263/0/0) Digital Output
(136263/0/1) Digital Output
(136263/0/2) Digital Output
(136263/0/3) Digital Output
(136263/0/4) Digital Output
(136263/0/5) Digital Output
(136263/0/6) Digital Output
(136263/0/7) Digital Output
(136263/0/8) Digital Output
(136263/0/9) Digital Output
(136263/0/10) Digital Output
(136263/0/11) Digital Output
(136263/0/12) Digital Output
(136263/0/13) Digital Output
(136263/0/14) Digital Output
(136263/0/15) Digital Output
Code: Select all
#!/usr/bin/python
import sys
import time
import mysql.connector
from Phidget22.Devices.DigitalInput import *
from Phidget22.PhidgetException import *
from Phidget22.Phidget import *
from Phidget22.Net import *
def StateChangeHandler(e, state):
print("Channel %d : %f" % (e.getChannel(), state))
def ErrorEvent(e, eCode, description):
print("Error %i : %s" % (eCode, description))
try:
print('debut')
Net.enableServerDiscovery(PhidgetServerType.PHIDGETSERVER_DEVICEREMOTE)
Net.addServer('Phidget22 Server', '192.168.0.11', 5661, '', 0)
print('add')
ch0 = DigitalInput()
ch0.setOnStateChangeHandler(StateChangeHandler)
ch0.setOnErrorHandler(ErrorEvent)
ch0.setDeviceSerialNumber(136263)
ch0.setChannel(0)
ch0.setIsRemote(1)
ch0.open()
except PhidgetException as e:
print("Runtime Exception %s" % e.details)
print("Press Enter to Exit...\n")
readin = sys.stdin.read(1)
exit(1)
while 1:
time.sleep(10)
exit(0)