diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 425a04b..7675131 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -22,7 +22,7 @@ void setup() pinMode(A1, INPUT); // Init the serial connection - Serial.begin(57600); + Serial.begin(115200); // initialize the command control module cc_init(); diff --git a/tools/meas.py b/tools/meas.py index 1a7758b..3344a7b 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -157,7 +157,7 @@ def cc_dataReceiverThread(): #print bytesToRead # TODO incoming = list(ser.read(64)) - print incoming # TODO + #print incoming # TODO # 2. process the received data for c in incoming: @@ -292,11 +292,13 @@ def openSerialDevice(d): # Why 115200? Because the host defines the baudrate for the USB serial connection. try: - ser = serial.Serial(d, 57600, timeout=0) + ser = serial.Serial(d, 115200, timeout=0) except: print "ERROR: Can't open the serial device " + device exit(1) + #time.sleep(2) + ##### def closeSerialDevice(): @@ -313,6 +315,8 @@ def sendSerialData(data): ser.write(bytearray(data)) ser.write(bytearray([ MSG_EOD1, MSG_EOD2 ])) + ser.flush() + ############################################################################### if __name__ == "__main__": @@ -398,7 +402,7 @@ if __name__ == "__main__": elif e[1] == MSG_TYPE_ANSWER_NOK: print "recv: NOT OK" - elif e[1] == MSG_TYPE_MEAS_FREQ_INFO_: + elif e[1] == MSG_TYPE_MEAS_FREQ_INFO: print "recv: FREQ INFO" freq = e[3][0] << 24 freq += e[3][1] << 16