We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

This assume you are sending the random data stream from the Pi. pigpio waves will do what you want as long as you do not need better than 1 µs resolution. For Python see wave_add_generic. Perhaps have a look at the morse code example to get an idea of the sort of code you will need to write. If you just want to view a random data stream sent to the Pi ...


0

Thanks everyone for the suggestions. I suspected something like contact bounce wasn't the issue here because the button response works perfectly before the fingerprint sequence of the code executed, it was only after the get_fingerprint block returning True that the button would have the effect, making me think the python code was repeating somewhere it ...


0

At a guess it is because the code runs out of memory. The code reader = SimpleMFRC522() creates a new object every time around the loop. I suspect the old copy is hanging around in memory and not being garbage collected. That line should be before the while loop. Also the call to GPIO.cleanup() is almost certainly wrong and should probably be removed.


0

The error was in te location of the rpi-rf_send script. It was located in the local path of the user instead of being located in the /usr/bin path


1

Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it. You should use a systemd Unit file to start your script as service. Start with the following Unit file. If it doesn't work you ...


0

Question How to fix AdaFruit CircuitPython Blinka Servo Board Installation Problem? Answer There are many reasons for not successfully installing CircuitPython Blinka, including the following: (1) Not using pip3, (2) Not using latest version of raspbian update and upgrade I have successfull installed Blinka and CircuitPython on Rpi4B buster (...


2

Adafruit-Blinka requires Python 3. It seems you're trying to install it for Python 2, using pip. Use pip3 as instructed in the tutorial you link to. sudo pip3 install adafruit-circuitpython-servokit


0

Not an absolute answer, since there could be any number of issues, possibly overlapping. 1) Those modules are awful, place them close together or add a better antenna. They will most likely not pierce even a drywall obstacle. 2) Use a frequency counter at <=5mV sensitivity to verify the TX is actually transmitting. If <=5mV gets flooded, use <=9mV....


0

I appreciate that you've since circumnavigated the problem by implementing your own version of readStringUntil()/readBytesUntil() but, as @crasic and @evildemonic alluded to in the comments, I think the error message you are seeing is down to this part of your code: if (SerIn=='Got') { Serial.println('I got it'); }else{ Serial.println('Oopz'); } And ...


0

Your program says you are connected to 14 and 15. But your diagram shows echo 8, trigger 10. TRIG = 15 #Associate pin 15 to TRIG ECHO = 14 #Associate pin 14 to Echo Please confirm By the way I liked the way you put timeout :)


-1

Question Setup (1) I have installed micropython-mpu9250. (2) I have detected the i2c bus using "i2cdetect -y 1". Problem How come my program don't run? Answer (1) What does the command "i2cdetect ..." do? The commend "i2cdetect -y 1" is used to detect if there is any working I2C devices connected to the bus, and display the devices' ...


0

It's preferable that the code listing is in your question and that the error message is cut&pasted into your question. At a guess you should be importing I2C not i2c.


1

You will get that error if pigpio decides that you should not be writing to that GPIO. Typically it means you are trying to write to a GPIO which is not connected to the expansion header on the model of Pi running pigpio. In this case GPIO 13 is only available on the compute module or the Pis with a 40 pin expansion header.


1

Try using from gpiozero import LED, Button from signal import sleep Then you can do led = LED(24) button = Button(23) And do button.when_pressed = led.on button.when_released = led.off pause() This makes things simpler, and it might just work. And are you sure your wires are lined up with your button? In the real photo it's hard to tell. Maybe you ...


4

This is four lines, but here it is anyways. Probably isn't the best way, though. (oh, and in your script remember to use the shebang for python3) from os import popen str=popen("vcgencmd measure_clock arm").read() str = str[str.find("=")+1:-7] print(str)


0

You can not just install anything without a root permission . You must execute this command under root permission. Or you can use use sudo pip install numpy or sudo apt install python-numpy


1

run sudo apt install python-numpy (or preferably sudo apt install python3-numpy because python2 is terminally ill).


0

Import the python library and you can easily control the pins. There are a lot of tutorials online.You need and ide with python supports and basic knowlegde about python programming. The GPIO pins are available for inputsand outputs.


1

I've got Selenium and Chromium/chromedriver working on my RaspPi 3 Model B Rev 1.2 running Buster. Here's how I installed everything and below is code that works for me. I started with update and dist-upgrade: sudo apt-get upgrade sudo apt-get distgrade Install Selenium (if you haven't already): sudo pip install selenium Install chromedriver (these ...


1

Leamas, thank you very much! Dealt with the socket and the device. Confused by the old instructions for using lirc. I downloaded a good config file and ran irsend without specifying a socket and everything worked irsend SEND_ONCE PHILIPS_15PF4121 KEY_POWER


-1

Question How to talk to an ST7789 LCD connected to SPI #1? Answer Update 2019oct23hkt0928 For those with little experience of rewiring delicate ribbon cables, perhaps the follow 12 pin breakout version (Ref 8)is worth trying: I think we need to do two things: (1) Change ST7789 LCD's CS connection from Ground to CS1 (Note 1), (2) Change ...


0

clock_EN.py has the line: disp = TFT.ST7789(spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=SPI_SPEED_HZ), mode=SPI_MODE, rst=RST, dc=DC, led=LED) The intention appears to be that the bus is defined by SPI_PORT and the chip select by SPI_DEVICE. So set SPI_PORT and SPI_DEVICE and connect the device as follows ...


1

Put the command line from your .desktop file into /home/pi/.config/lxsession/LXDE-pi/autostart or /etc/xdg/lxsession/LXDE/autostart, whichever you use on your system. /home/pi/.config./autostart directory doesn't seem to exist or be used on Raspbian.


1

Ok I figured it out. I already had installed h5py by the following lines as in this link: sudo apt-get install libhdf5-dev sudo apt-get install libhdf5-serial-dev sudo python3 -m pip install h5py And after those following this link sudo apt-get install netcdf-bin libnetcdf-dev sudo python3 -m pip install netcdf4 And now import netCDF4 works. By the way,...


1

I ran into the same issue. You can solve it without using another library. This is how you do it. def button_callback(button): print('Button {} pressed'.format(button)) GPIO.add_event_detect(button, GPIO.FALLING, callback=lambda x: button_callback(1)) By using the lambda, you are executing an anonymous function which then calls your button_callback ...


0

As stated in the link that you provided, you should use Miniconda. The default installed channel (pkgs/free) has very limited capabilities, and the RPi channel is better. To add that, run conda config --add channels rpi from the command line. This will add the channel. Then you can run installation commands such as conda install numpy Enjoy! I got ...


0

To mitigate against unwanted events I suggest you use code similar to the following. Basically read the level of the GPIO in the callback to verify it is not a short term transient. #!/usr/bin/env python import time import signal import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) buttons=[24, 25, 13, 12, 16] def cb_buttons(channel): if GPIO....


Top 50 recent answers are included