diff --git a/raspberry/roberto/Serial.py b/raspberry/roberto/Serial.py index c5c3d08..8de2b65 100644 --- a/raspberry/roberto/Serial.py +++ b/raspberry/roberto/Serial.py @@ -49,12 +49,12 @@ class Serial(object): if data: print(data) command = data[0] - argument = data[2:] - if command in data: + argument = data[2:].strip() + if isalnum(command) and command in self._callbacks: cb = self._callbacks[command] if cb: cb(argument) - + except serial.SerialException: pass #self.alive = False