Hot answers tagged

2

Maybe a Queue could work for you? Link. Queues are FirstInFirstOut so you could have your threads putting stuff in it and then have, I don't know, a fourth thread that will be grabbing stuff from the queue as they come and write them to the file. Hope this helps.


2

This is kind of a python question, but is dependent on the Pi specific RPi.GPIO. The GPIO.PWM creates a thread which is responsible for the PWM operation. This stores data in a structure, which is (eventually) destroyed when you call PWM.stop(). You don't do this, but it will happen when the variables are garbage collected on function exit. Effectively the ...


2

With pip and python you have installed the Python version 2 of spacy. This isn't supported any longer, and it's not surprising that you have problems. Use Python version 3: pip3 install spacy


1

If you search this Forum you will find MANY questions about DHT22. The Adafruit code is notoriously unreliable and CAN NOT be run from PHP because it requires root access. See Reliable temperature/humidity logging with Python and a DHT11 for the code I use.


1

It should be possible BUT not if you use the (depreciated) Sysfs interface which requires root privileges.


1

The code Joan posted will work, but that does not mean the relays will. These relay modules are unsuitable for the Pi as they are only controllable from 5V. Attempting to run them risks damage to the Pi and they do not work reliably. Can you use a 5V Relay Module with the Pi? describes these and suggests modifications to make them work. In addition you could ...


1

See gpiozero OutputDevice. E.g. import gpiozero RELAY_PIN = 4 # Triggered by the output pin going high: active_high=True # Initially off: initial_value=False relay = gpiozero.OutputDevice(RELAY_PIN, active_high=True, initial_value=False) relay.off() # switch off relay.on() # switch on print(relay.value) # see if on or off


1

p.start(1) starts RPi.GPIO PWM with a 1% dutycycle. You need to use p.start(100) if you want 100%. https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/


1

If you don't want it to blink @0.5Hz DON'T try to run it at 0.5Hz - leave it at the default 1kHz.


1

Here are some methods using my Python modules. You can also use the Python smbus module. pigpio import time import pigpio pi = pigpio.pi() h = pi.i2c_open(1, 0x78) pi.i2c_write_device(h, [0xAC]) time.sleep(0.05) (b, d) = pi.i2c_read_device(h, 6) print(d[0], d[1], d[2], d[3], d[4], d[5]) pi.i2c_close(h) pi.stop() rgpio import time import rgpio sbc = ...


1

My question is: How do I configure the pi so that i can plug it back in, it boots up itself and runs the program without having to use ssh or a keyboard and monitor to login. You don't have to do anything to the RPi to have it start (boot) when power is connected - this is the way it works! You can use cron to start a Python program upon startup - this is ...


1

check this link https://www.interelectronix.com/raspberry-pi-4-autostart-qt-application-during-boot.html this was helpful for me I could autostart qt application on a raspberry pi os lite so I think you can run your python program you just need to create a .service file in the /etc/systemd/system cd /etc/systemd/system sudo nano application_one.service [...


1

Python is case sensitive, and you misspelled/capitalized the module name. Change: import RPI.GPIO as GPIO to: import RPi.GPIO as GPIO Note: the lowercase i.


1

I think (unless you have not corrected it yet) you have your wires wrong. The green one is the signal (data) and you have it connected to the 3V3. Source: DFRobot - SEN0137 DHT22 Temperature and humidity module Hint: Try running it in the loop like in the dht_simpletest.py - as @Milliways mentioned the python library is not stable. Running in the loop and ...


1

Following on from @Techraf you need to install the geckodriver. Here is the latest version supported for Rasp Pi: https://github.com/mozilla/geckodriver/releases/tag/v0.23.0 Download geckodriver-v0.23.0-arm7hf.tar.gz This is the latest release supporting arm7hf, which I believe is required for Selenium on Rasp Pi. You need to inform your script to load the ...


Only top voted, non community-wiki answers of a minimum length are eligible