Also check that gpio 4 in the node-red node is the same pin as is meant by 4 in the python script. There is often confusion over pin number vs gpio number.
Also check that gpio 4 in the node-red node is the same pin as is meant by 4 in the python script. There is often confusion over pin number vs gpio number.