I just got a raspberry pi 3 B+ model and have wrote some scripts to create an LED pattern. Everything worked and then suddenly stopped. Now every time I run a python script through sudo python #scriptName the console crashes meaning I can't run anymore python code or shutdown the computer without pulling the power chord, I can't ctrl+C as it just prints ^c on the console screen and there in no python program to use the kill command on. Without the Cobbler connected code will run sometimes, but with it connected the console freezes. Also the led connected in the bread board dimly glows without the GPIO being turned on on startup and stays on until I turn it off from the console. Did I burn something out? Can someone please offer me advice as to what is happening? My Trial Script
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(12, GPIO.OUT)
GPIO.output(12, GPIO.HIGH)
time.sleep(1)
GPIO.output(12,GPIO.LOW)
Here is a picture of the problem.
Here is a picture of the circuit I set up
^C
indicates you are pressing Ctrl-C, which sends a polite stop request to the foreground process. However, the process is not required to obey this, but in general they politely should and if not, something is probably wrong, e.g., an I/O error. If you can get another console, have a look atsudo tail /var/log/syslog
when this happens. – goldilocks♦ Jul 25 '16 at 13:56Alt-Ctrl-F[1-6]
(cycle through each F-key up to 6); you should get a non-GUI console (or possibly another GUI login screen). If nothing happens that way then the system is truly locked up. In that case you could try pulling the plug, rebooting, and looking back through/var/log/syslog
to when before the reboot occurred (the reboot will be indicated with kernel timestamps that are all zero, eg.[ 0.000000]
). – goldilocks♦ Jul 25 '16 at 14:04GPIO.setwarnings(False)
toGPIO.setwarnings(True)
and see if any warnings appear ? – Shreyas Murali Sep 27 '16 at 6:27uname -a
andcat /etc/os-release
? – Shreyas Murali Sep 27 '16 at 6:31