When ever I run a python script my vnc connection disconnects?

September 2, 2023, 10:13

remliv

This is my script
py
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)  # BCM numbering
pin = 37
GPIO.setup(pin, GPIO.OUT)


GPIO.output(pin, GPIO.HIGH)
print(f"Enabled GPIO {pin}")
time.sleep(1) 
GPIO.output(pin, GPIO.LOW)
print(f"Disabled GPIO {pin}")

GPIO.cleanup()
I'm using vnc viewer, it's literally a fresh install...

illegitimate_egg

You could be using SSH for this which probably wouldn't disconnect

remliv

Well I prefer a gui, a terminal is not something I'm used to using

remliv

also I added a monitor and when I ran the script it became blank

remliv

or black

remliv

but I want to use gpio and I don't read anywhere that using gpio would make the system break

remliv

though...

remliv

I did enable remote gpio I think

illegitimate_egg

that's

illegitimate_egg

very strange

remliv

I'm confused why it would do that because I don't even have anything connected to the pin

illegitimate_egg

maybe the video generator on the BCM is some how internally shorted to one of the GPIO pins

illegitimate_egg

it's extremely unlikely

remliv

hmm

illegitimate_egg

but all I can think of rn

remliv

hmm

remliv

is board better?

remliv

I don't know what the difference between bcm and board is

illegitimate_egg

the bcm is the chip on the pi

remliv

hmm

illegitimate_egg

It houses the CPU and the GPU

remliv

I'm confused why that would be related to the pins?

illegitimate_egg

Because that's what the pins are connected to

remliv

Well all I have heard is that board is when you have multiple pi's

illegitimate_egg

what?

remliv

I was trying to figure out what mode I should be using

illegitimate_egg

The mode isn't what I'm talking about

remliv

Hmm okay

remliv

I see what I'm doing wrong

remliv

trying to change gpio37 which doesn't exist

remliv

It might be that...

illegitimate_egg

maybe

remliv

yes it is that

remliv

it doesn't crash now

remliv

thank you

illegitimate_egg

I wonder what bcm pin 37 actually is

remliv

oh... damn

remliv

I feel as lost as I was when I was trying to figure out arduino's lol

remliv

the resources are difficult to find

illegitimate_egg

Not really

illegitimate_egg

although the actualy BCM pinout isn't well documented

illegitimate_egg

because it's not open source

illegitimate_egg

arduino is

remliv

dam

k9t33n

nvm I only just read that you figured it out