Installing serial library in python12/27/2022 ![]() Python-Serial is pre-installed in Ubuntu 14.04. 04 4.4.0 kernel integrated the USB driver, eliminating the installation trouble. Press Linux to the driver installation package in the README, directly Make error, solve the search for the official technical support of Yutai Technology, I suggest I update the system kernel (I refuse!), And then provide a document (ftdi.txt), verified this machine ubuntu14. Reference link: 'Serial' Object Has No Attribute 'Is_Open' error resolution、 Second, ubuntu14.04 & python2.7 Python programming implements USB to RS485 serial communication Return_data = ser.read(len_return_data) # Read buffer data # BYTES (2) Convert to HEX (16), pay attention to the difference between Python3.7 and python2.7, and turn into a string, intercept the required data field, and turn to 10įeedback_data = int(str_return_data, 16 ) Len_return_data = ser.inWaiting() # Get buffer data (received data) length if len_return_data: Time.sleep(0.1) # Delay, otherwise len_return_data will return 0, which is easy to ignore! ! ! # HEX (16) converted to BYTES (2), pay attention to Python3.7 and python2.7 conversion Ser = serial.Serial( " com3 ", 9600) # Select the serial port and set the baud rate if ser.is_open: # Operating environment for Windows7 & Python3.7 import serial Install the serial library, execute the command PIP3 Install Pyserial in CMD exe fool installation, visible Usb turn serial connecting line and serial debug assistant。 Reference link: Usb turn serial connecting line and serial debug assistant、 Collect RS485 Temperature and Humidity Sensor Information with Python Windows7 & Python3.7 under python programming implementation USB to RS485 serial communication ![]() Operating environment: Windows7 & Python3.7 and Ubuntu 14.04 & Python 2.7, Yutai UT-890A USB RS-485/422 serial cableįile download: Source code Click to download vsl7ġ. Click here to link to the original text of the blog-įunction Description: Python programming implements USB to RS485 serial communication (send data, received data is 16 credit format) Welcome to correct, need source and files to contact private letter in the station. Author, not allowed, it is strictly forbidden to reprint, violations must be based on
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |