I want to communicate with the phone via serial port. After writing some command to phone, I used ser.read(ser.inWaiting()) to get its return value, but I always got total 1020 bytes of characters, and actually, the desired returns is supposed to be over 50KB.
I have tried to set ser.read(50000), but the interpreter will hang on.
How would I expand the input buffer to get all of the returns at once?
pySerial uses the native OS drivers for serial receiving.  In the case of Windows, the size of the input driver is based on the device driver.  
You may be able to increase the size in your Device Manager settings if it is possible, but ultimately you just need to read the data in fast enough.
How to expand input buffer size of pyserial