Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interrupt serial port
#10
(Feb-15-2017, 06:43 AM)trainee1 Wrote:
(Feb-14-2017, 04:46 PM)nilamo Wrote: Threads merged.  Those of us that are here to help, check all the boards.  There's no reason to post in more than one place.

Anyway, how are you reading data?  Don't most interfaces just block until there's something to read?
With this line of code:

while true:
        s = serialport.readline()

which is run on the pi with the python script. A serial connection is between the pi and a desktop. As I type characters on the terminal (Putty) on the desktop, there should be an interrupt to say data is ready or a flag maybe. I dont want always listen to the serial port (Polling).

Start a thread that waits on a read of the serial port.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Messages In This Thread
RE: interrupt serial port - by nilamo - Feb-14-2017, 04:46 PM
RE: interrupt serial port - by trainee1 - Feb-15-2017, 06:43 AM
RE: interrupt serial port - by Ofnuts - Feb-15-2017, 08:19 AM
RE: interrupt serial port - by Larz60+ - Feb-14-2017, 05:31 PM
interrupt serial port - by trainee1 - Feb-14-2017, 01:55 PM
RE: interrupt serial port - by sparkz_alot - Feb-14-2017, 02:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Waiting for input from serial port, then move on KenHorse 3 1,120 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 467 Mar-19-2024, 09:02 AM
Last Post: zazas321
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 4,248 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  Serial Port As Global Prasanjith 2 1,523 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  add interrupt for next task kucingkembar 0 787 Oct-07-2022, 12:15 PM
Last Post: kucingkembar
  Determine if keyboard interrupt versus SIGINT trapped? Jibunnokage 5 1,816 Sep-30-2022, 06:54 AM
Last Post: Gribouillis
  python serial port barryjo 2 1,678 Dec-27-2021, 11:09 PM
Last Post: barryjo
  is there a way to mention port range or search for port dynamically with qConnection Creepy 0 1,500 Sep-09-2021, 03:15 PM
Last Post: Creepy
  How to Properly Open a Serial Port in a Function bill_z 2 4,506 Jul-22-2021, 12:54 PM
Last Post: bill_z
  Enabling interrupt on Adafruits button/led board Moris526 0 2,031 Apr-30-2021, 03:29 PM
Last Post: Moris526

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020