Bottom Page

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 New member with simple coding issue
#1
Hi All. 

This is my first post here and I am totally new to Python and coding in general. 

I have basically created a simple timing system for use at my work that uses a raspberry pi and a dotstar LED disk. 

Very simply it is triggered by a separate unit that sends out a RF timer signal. When the pi receives this signal it starts a timer and then makes the LED's go a certain colour at a certain time. 

I have also implemented a button connected to one of the pi's pins that 'resets' the programme. (See below)


def restart_program():

        
        lightoff()
        GPIO.output(Xbee, GPIO.LOW)
        os.execv(sys.executable, ['python'] + sys.argv)
        return;
Now the issue I have is that if i leave the code running for a extended period of time and the hit the reset button i get an error and the code stops running. 
The reset works fine if the code hasnt been running long (less than a couple minutes). 
The error i get is:


Error:
Traceback (most recent call last):      File"timer5.py", line 305, in <module>        read_str = ser2.readline()      File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 466, in read       ready,_,_=select.select([self.fd],[],[], self._timeout) ValueError: filedescriptor out of range in select()
Now i have no idea what this means of what the issue is. I assume it is something to do with my serial read. 

Any help would be hugely appreciated. 

Thanks
Larz60+ wrote Apr-24-2017, 05:50 PM:
Before posting code, remove formattion (A- icon)
Then highlight code and click python icon
For errors, highlight error text, and press X with circle icon
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Python Coding Issue! ankitdixit 3 157 Sep-25-2019, 06:31 AM
Last Post: rohanjoshi0894
  Coding issue 1557676 2 129 Aug-02-2019, 08:54 PM
Last Post: cvsae
  How I can recognize that member is classmethod of staticmethod? AlekseyPython 0 276 Feb-17-2019, 07:01 AM
Last Post: AlekseyPython
  How I can create reference to member of the class instance? AlekseyPython 8 537 Dec-05-2018, 06:24 AM
Last Post: AlekseyPython
  Simple Hangman Game Issue andrew95 2 1,545 Apr-02-2018, 02:24 PM
Last Post: andrew95
  List data-member of object not updating inside loop. Sagar 2 1,092 Aug-30-2017, 01:07 PM
Last Post: Sagar
  coding issue Lee 2 1,217 Feb-13-2017, 10:53 AM
Last Post: Lee

Forum Jump:


Users browsing this thread: 1 Guest(s)