I want to read an analog value from a domotica controller called 'Nodo'. After sending 'Status WiredAnalog 1;' to the serial port, the domotica controller immidiately responds with 'WiredAnalog 1, 31)' terminated with 0x10. I want to catch this string so I can extract the value 31, but my Python script does not catch the string properly.
This is (a part of) my pyton script:
Code: Select all
Serial = eg.plugins.Serial print 'Get the analog value...' Serial.Write(u'Status WiredAnalog 1;') ReceivedString = "" b=0 # receive all input until \n while b != "\n": b=Serial.Read(1, 0.1) if b != "": ReceivedString += b print "Return value: " + ReceivedString
Can anybody help?