Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:33:51+00:00 2026-06-05T10:33:51+00:00

Sometimes I do not get any data in via the serial interface and I

  • 0

Sometimes I do not get any data in via the serial interface and I want to catch this case with an exception in the following way:

ser          = serial.Serial(3)
ser.baudrate = 115200
timeout      = 1

while (some condidion)
  try:
    dump = ser.read(40)
  except ser1.SerialTimeoutException:
    print('Data could not be read')

ser.close()

However, when I run this program, the exception is never caught when no
data is in the buffer and I am stuck in an endless loop. Anyone an idea
what I am doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:33:52+00:00Added an answer on June 5, 2026 at 10:33 am

    I didn’t even know about that exception. After having a look at the API documentation, you’ll see that this exception only applies to write().

    If you read(), you’ll just have a shortened or even empty output.

    And this applies only if you have opened the connection with a timeout. Something like serial.Serial(3, timeout=.1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# application wherein serial (COM1) data appears to sometimes not get
If I'm not online, I sometimes want to package some changes to a commit,
I'm not sure how to ask this question so here goes... Software sometimes says
i have following function: function fnGetIdentifiers(id){ $.get( 'getCultureIdentifiers.php?cultureID=' + id, function(data){ if (data.length >
Is there any way of checking if data sent using winsock's send() or WSASend()
I'm using Backbone.js and sometimes the views events do not get bound correctly. I
I am trying to load large data to HDFS and I sometimes get the
I want to use a SELECT statement to get data from MYSQL DB and
I have the following code which sometimes return as true and sometimes doesn't. Any
I've got a problem in my database - somehow changes sometimes are not being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.