Hot answers tagged

2

Realistically, the earliest moment for the boot sound is right after the SystemD sound target: [Unit] Description=Boot Sound Requires=sound.target After=sound.target [Service] Type=oneshot RemainAfterExit=no ExecStart=/usr/bin/aplay /boot/sound.wav [Install] WantedBy=default.target


2

With a 1kΩ resistor you can't pull the pin LOW. You will get ~1.2V which is HIGH. Just get rid of it or reduce to 100Ω. There is no need for a resistor; it is a protection mechanism to prevent excessive current for an unlikely combination of circumstances. An opto-isolator would never be capable of pulling enough current to cause problems.


1

Add some error checking to your scripts. I would specifically check for libcomposite module to be present in the kernel, no other gadget drivers loaded (lsmod | grep g_ gives no output), configfs is mounted and one and only one UDC file exists in /sys/class/udc before you bind the driver. Printing errors from your Python code would also help: except, e: ...


1

Try using pip3. It is used only for Python 3. Differences: pip: If you are in a Python 3 venv then it will operate in the Python 3 environment. So if you are in a Python 2 venv it will operate in the Python 2 evironment. pip3: Operates in the Python 3 environment pip2: Operates in the Python 2 environment


1

Just for reference, there are two well-known approaches for addressing multiple keys with fewer pins: voltage ladder if you have analog pins and key matrix if you have digital pins. The Pi itself has no analog pins, but if you use an ADC, it's possible to use some of its channels for buttons. Any non-standard wiring schemes are either suboptimal compared to ...


1

You could try something like the following - which will at least isolate buttons. Pushing the centre button will activate both inputs - the others a single input. Strictly no diode is required on the isolated buttons. simulate this circuit – Schematic created using CircuitLab


1

You could maybe try a web interface with flask if your remote device and controller are both connected to wifi - here's some links to help you with that Intro to flask on raspberry pi Flask video streaming Using GPIO with flask Hope that helps and good luck with your project :)


1

You're asking some interesting questions (IMHO), but you're not likely to get the best answers here because your question is somewhat "off topic". Understand that just because Raspberry Pi can be applied to some computing task, does not make questions about that task relevant here. As a ludicrous example, consider the fiendish plan by one of our ...


1

As long as you have both Raspberry Pis connected to a WiFi router, then you can do it. I don't think you can just communicate between two WiFi devices without a router (that is, the router can receive/send all the signals, the Pis can only communicate with a router). Here is a post on the raspberrypi forum that talks about that issue. They do mention about ...


1

The Raspberry Pi wifi may use 2.4 GHz but wifi is unlikely to be the protocol used by your 8-channel receiver. You need to find details of your receiver and then find a module which talks the same protocol.


1

That seems to be odd behaviour. Can't help with the spidev module. Perhaps use a different library. My pigpio, lgpio, and rgpio Python modules will work okay. pigpio (own SPI driver) import pigpio tx1 = [0xCA, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ...


1

I will just point out that the callback function is called from the event thread. The event thread will be blocked until the callback returns. The second behaviour you see is the correct behaviour. You only see the incorrect first behaviour because you are corrupting the Python system by killing one of its processes improperly.


1

Warning DO NOT DO THIS sudo nano .bashrc Go to the bottom of the .bashrc file and include the path of the python script and save the changes & exit Reboot the raspberry-pi and your script starts as soon as the Raspberry pi turn's on


1

Here's the instruction for everyone who wants to make Bluetooth Serial communication to work without dealing with Python or other piggybacked programs running inside Raspberry Pi Model 3 B+ or 4 and Pi Zero easily. This configuration (below) works well with Android (old Android with BT 4.0 or later) and iPhone (8 or newer) with Bluetooth 4.0 or higher, ...


1

Reduce or remove bouncetime=200 entirely in GPIO.add_event_detect(button, GPIO.BOTH, callback=buttonpressed, bouncetime=200) Then in your callback, add a static variable and a condition statement that will accept the input only if the edge is different from the previous one : def buttonpressed(channel): if "previous_edge" not in buttonpressed....


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