New answers tagged

1

Best way to install OpenCV on on Raspberry pi is to use: sudo apt install python3-opencv instead of pip. As suggested by https://stackoverflow.com/a/60237868/9697329


0

It is tricky to help because you don't know the format of the serial data being sent. Other people will not know the format as you are not giving enough detail about the device sending the data. Given this, you will need to explore and document the data better before developing the best strategy for handling the data. It appears that in addition to the data ...


2

I'm not sure if this is the best/cleanest answer but you could have annother button called Autonomos mode off which you would press before you press the sensor off relay on. That button would have go to a different script in that directory that you would call stop.py. fileObject = open("isAutonumous.txt", "w") fileObject.write(0) ...


1

I suspect there are several issues here. If you have both a terminal program and the python script talking to the port at the same time, only one of them is going to read the data. Both can write without difficulty. When reading from serial ports, it is often necessary to do some special things: setting raw mode, setting VTIME and VMIN parameters on the ...


2

Firstly servos are not controlled by dutycycle, they are controlled by pulse width. Small servos generally respond to pulses in the range 500 to 2500 µs. Larger servos generally respond to pulses in the range 1000 to 2000 µs. At 50Hz a PWM dutycycle of 2% results in a pulse width of 400 µs which is not safe for any servo. You will be grinding against the ...


3

This cannot be easily fixed. Upstream USB communication is polling-based: the host periodically sends a request to each device on the bus and checks their reply, and even an empty reply takes a time slot. The shortest polling interval is 1 millisecond. See if you can change the endpoint polling interval in the FTDI driver configuration (AFAIK 32 milliseconds ...


0

Some of these tasks can be asynchronous and need to occur either regularly or constantly; whereas others will have very strict sequencing (robotics and imaging, mainly). Regularly is not something belonging to time-shared systems. If you want to get regular, you don't want an OS - or you want to run an RTOS. The choice of language is then basically ...


0

Please read manuals. There is no 'AT' + '\r\n', use "AT\r" instead. No need for New Line '\n', only Carriage Return '\r'. Also, before any other commands, SIM800 is by default working at 115200 baudrate, so "AT\r" + "AT+IPR=9600\r" or any other baudrate is a MUST been sent to it.


1

Use a transistor as a switch and use 12V across that transistor. This is the safest way. Measure the relay resistance first to choose your transistor.


1

The 5V rating refers to the coil; 12V refers to the solenoid door lock rating. Here's how to set up the hardware: simulate this circuit – Schematic created using CircuitLab


1

I don't quite understand "playing music from a stream". Is it a stream like Twitch stream or is it a URL of a .mp3/.wav file? If it is the first type, could you please provide me the URL? Thanks! I'm not sure about the first type streaming. But for the second one, you can use wget to download the file and play it with omxplayer. Or you can use ...


0

MattG, analogRead a returns a float.. and the print() was probably getting confused too. Leave out the int inputPinA = A0; because you only need to put A0 in the AnalogRead. Make int pin = 0; a float, or better use float pin_value = 0.0; for clarity Then the stuff in your loop becomes: pin_value = analogRead(A0); Serial.println(pin_value); Dave


1

Aiden, the Pi is 3.3V, so on first glance the relay board may not work reliably. However the wiring should be straight forward, just do a search on raspberry pi gpio and relays.


0

The pop means you've got some control over the speakers. Good. Maybe, your program is telling the speakers to work too quietly. Look for things that would cause that: Have you tried volume=1.0 or maybe volume=0.99? Maybe Python isn't coercing the integer 1 into the float 1.0. Double check that your samples array is populated with values of the expected range....


0

This turned out to be an issue with the way PWM was interfacing with the Texas Instruments TPS61165 LED driver which made it switch control modes to EasyScale. As Joan kindly pointed out, increasing the PWM frequency to 1m stopped this from happening and provided reliable dimming.


0

from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LocalWebserverAuth() drive = GoogleDrive(gauth) folderName = 'FOLDER NAME' # Please set the folder name. folders = drive.ListFile( {'q': "title='" + folderName + "' and mimeType='application/vnd.google-apps.folder' and trashed=false&...


0

If you're using your Raspberry Pi via VNC or SSH, you won't see any preview on your screen. Now, you have two options. Try connecting using HDMI. Try turning on "Direct Capture mode". Follow these steps to do so: Open the VNC Server dialog (on the RPi), then navigate to Menu > Options > Troubleshooting, and select "Enable experimental ...


1

I believe Dmitry's answer is correct and there is something in the I2C communication that's going wrong. However, since I'm still waiting for access to a logic analyzer, I took the easier and cheaper route of simply buying a second screen with SPI wiring. That one works flawlessly out of the box. Thus another "answer" is to avoid purchasing OLED ...


0

This is a board from a company called Waveshare. I just bought the same one. Here is the documentation I found about it https://www.waveshare.com/w/upload/4/4a/GSM_GPRS_GNSS_HAT_User_Manual_EN.pdf I also spent quite some time trying to make it run. The solution is really simple though :) You have to use stable source of voltage, not the usb port from your ...


0

Try running sudo apt purge pulseaudio and rebooting. It can sometimes cause problems with audio output. If it's not installed, try running sudo apt install pulseaudio which ironically can also fix things.


0

Presumably rather than GPIO to LED+ then LED- to ground your connection is 3V3 to LED+ then LED- to GPIO. That would account for the dimming rather than brightening. I have ignored the resistor which will be somewhere in series in both the above cases. You can either change the LED connections or reverse the while loop to count down rather than up.


Top 50 recent answers are included