Send File Serial Port Python

Using Pyserial to send a file? Ask Question. Up vote 2 down vote favorite. Install Checkpoint Gaia Virtualbox Android. Send file through serial port with Python. PySerial: Can't read data more than 8. I am trying to send a hexadecimal string to a serial port and it. Python sending a hex string to serial port. How do I check whether a file exists using Python? Sending data from txt file over serial. Here is a python program you. Jwpat7's that would wait a second after opening the port and then send the file. Sending byte strings to serial device. I guess that my code doesn't send the correct bytes to the serial port. Browse other questions tagged python python-3.x.
I am trying to send this command ':01050801FF00F2' over serial in python 2.7, with no success. The code that i use is: import serial, sys,socket from time import sleep port = 'COM9' baudRate = 9600 try: ser = serial.Serial(port, baudRate, timeout=1) if not ser. Drivers Trio Stealth. isOpen(): ser.open() except Exception, e: print('Error opening com port. +str(e)) sys.exit(0) print('Opening ' + ser.portstr) #this is few ways i am trying to send with c = '01050801FF00F2' ser.write(c.encode('utf-8')) sleep(3) ser.flushInput() #flush input buffer, discarding all its contents ser.flushOutput()#flush output buffer, aborting current output #and discard all that is in buffer c = ':01050801FF00F2' ser.write(c.encode('hex')) sleep(3) ser.write(':01050801FF00F2').
