title: How to solve "ValueError: The channel sent is invalid on a Raspberry Pi" error?
body: <p>I have a python code to get readings from a light sensor. I have upgraded the raspberry pi too. But when I tried to execute the code it gives me an error as follows            </p>
  
  <p><img src="https://i.stack.imgur.com/k1unK.png" alt="Error message"></p>
  
  <p>Here is my python code        </p>
  
  <pre><code>#!/usr/local/bin/python
  
  import RPi.GPIO as GPIO
  import time
  
  
  GPIO.setmode(GPIO.BOARD)
  pin_to_circuit = 17
  
  def rc_time (pin_to_circuit):
      count = 0
      GPIO.setup(pin_to_circuit, GPIO.OUT)
      GPIO.output(pin_to_circuit, GPIO.LOW)
      time.sleep(0.1)
  
      GPIO.setup(pin_to_circuit, GPIO.IN)
  
      while (GPIO.input(pin_to_circuit) == GPIO.LOW):
           count += 1
  
      return count
  
  try:
      while True:
          print rc_time(pin_to_circuit)
  except KeyboardInterrupt:
      pass
  finally:
      GPIO.cleanup()
  </code></pre>
  
  <p>I have tried so many solutions found on the internet but none of it worked. Please help.</p>