__author__ = 'sachinpatney'

import serial
import time
import binascii

ser = serial.Serial('/dev/ttyUSB0', baudrate=9600, timeout=1.0)

s = b''

while True:
        bytesToRead = ser.inWaiting()

        if bytesToRead > 0:
            s += ser.read(bytesToRead)
        else:
            if len(s) > 0:
                print('Hex string')
                print(binascii.hexlify(s))
            s = b''

@@ -234,11 +234,10 @@
     
-s +
+w 
 = se
@@ -243,27 +243,155 @@
 er.read(
-bytesToR
+3)%0A            s += w%0A            l = int.from_bytes(w%5B2%5D + w%5B3%5D, byteorder='big')%0A            print('len: '+l)%0A            s += ser.r
 ead
+(l
 )%0A      

update prototype