473,400 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Unable to receive exact data only garbage data is collected

Beginner in python :)
I am trying to connect with equipment using miniterm.py , also tried some pyserial tutorials.
Here is the script:(am able to connect with equipment so excuse the code error)

Expand|Select|Wrap|Line Numbers
  1. import serial
  2. ser=serial
  3.  
  4. try:
  5.         ser=serial.Serial("COM3",baudrate=9600) 
  6.  
  7.         if ser.isOpen():
  8.  
  9.                 print('open')
  10.                 while 1:
  11.                         while ser.inWaiting > 0:
  12.                                 ser.timeout = 5 
  13.                 out = ser.readline().decode("utf-8",'ignore')
  14.                                 print ("Total Bytes Received => " + str(sys.getsizeof(out)) +out +" bytes")            
  15.         else :
  16.                 print('ERROR:unable to open com1 port')
  17.  
  18.         except serial.serialutil.SerialException:
  19.               print(serial.serialutil.SerialException.with_traceback)
  20.  

Solution tried :
1) baudrate - from 1200-19500
2) parity : n,e,o

And important point is , a software that is come with same equipment received data successfully with below :
baudrate :9600
parity : none

Any help is appreciated.

Thanks
pankaj
Dec 21 '15 #1
2 1365
Fixed , just need to change bytesize , that's it.
Hope this will help someone :)
Dec 24 '15 #2
dwblas
626 Expert 512MB
The "while 1:" loop never exits so it never gets to the ser.readline.
Dec 24 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: FabFreddy | last post by:
Hi, I can't find out what the problem is with the error message below! I get it when I go from one to another page with controls in these pages. Anyone knows??? THX Unable to validate...
2
by: Tim | last post by:
Please advise if you can. Presumably initialisation of members in member initialisation lists is perfomed by 'C' run-time startup. If the CRT was never started-up would those members be garbage?...
1
by: Uthuras | last post by:
Greetings, Machine : Pentium IV Os Windows 2000 server Product : DB2 UDB Release : 7.2 We are fail to load the following data file format into db2 database table that has long varchar...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
2
by: Keith Avery | last post by:
We have an ASP.NET application. This is loading data using XML from another ASP web site. It all works fine for small XML data files. For larger XML data file being streamed from the ASP web...
5
by: sjl | last post by:
I've got an .aspx webform for searching my database. It basically takes user input and passes it as a parm into a stored proc to search a table. The results are returned in a SQLDataReader and...
2
by: ken | last post by:
Hello everyone, I'm new to visual VB and I am trying to setup communications using the Function ReceiveSerialData() As String example found in the help section of Microsoft Visual Basic 2005...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
6
by: Solje | last post by:
Im developing an ASP.NET application used for maintinance purpose and it may be idle for some ours. The application crash with the error shown below when the user click on some contol in the...
7
by: Jay Balapa | last post by:
Hello, We have a Pocket PC client application which just connects to our webservice. When a client connects his Pocket PC through his WIFI he gets the following- Unable to read data from the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.