Getting GPS's Data: GPS receives data from output NMEA0183, tcp: // 2947, class: TPV & amp; tag: GPGGA.
Next is the step in the terminal to access GPS data:
Install: gpsd, gpsd-clients. (Note: install both use apt-get install)
Reboot (sudo reboot or sudo init 6)
Sudo dpkg-reconfigure gpsd (Note: configuration baudrate = 9600, 8 N 1 data format).
To determine what your program is doing, you need to save the output of the program to a file. Use this type of call to start the program
/path/to/script >> /path/to/log/file 2>&1 &
This will start the program in the background, and send all output (both stdout and stderr) to a file of your choice.
Keep in mind that if the script is long ...
PIR motion sensor always on and stays on. Why?
Part 1 - HC SR501 Analog Sensor - Not Recommended
This analog sensor is difficult to adjust sensitivity and delay time using the two little trim potentiometers. It is also be easility be interferenced by noises.
I googled to find that analog PIR sensors such as HC SR-501 have a noise ...
If I've understood your question the alarm condition triggers correctly but pressing the button again to cancel it early does not work and you have to wait for your 3 minutes timeout?
I think part of the problem is the logic on the while... : line in the swState function. You want the code to stay in the loop "while" two conditions are true:
The timer has ...
Have to press key 2 quite hard but it works.
A button press turns them on but they stay on.
What do you mean by "quite" hard"? Do you mean "quite long" (even
quite soft)? Perhaps the hardware bouncing is worst than 200mS.
Or better use level trigger if edge trigger is being used.
Driven events are hard to ...
I think the problem is you are trying to use the variable btnState as an integer sometimes and as a boolean (True/False) sometimes.
btnState = 1 sets it to an integer 1.
btnState = not btnState sets it to a boolean False.
The line if btnState == 1: will then always fail as True or False are not the same as 1.
It's probably simplest to use
if btnState == ...
This is an old question, and while the answers were relevant at the time, more recent Raspbian distributions include functionality to detect safe poweroff.
While there is no means of detecting loss of power (without additional circuitry) there are indicators to show when it is safe to remove power.
You can set the Pi to assert a GPIO output on poweroff.
The Python spidev module uses the Linux SPI driver. The Linux SPI driver sets the SPI GPIO into the appropriate mode when it initialises. Thereafter it assumes the SPI GPIO are in the correct mode.
The correct mode is ALT0 for the main SPI device and ALT4 for the auxiliary SPI device.
By setting the SPI GPIO to the wrong mode you are disconnecting the ...
Reading only zero value from ADC board, why?
You mentioned that you already tested serial loopback. So I studied you program to see how you send and received bytes. I found one thing wierd - you setup GPIO MOSI, and MISO to output mode, input mode and so on. But I never did that, because the serial module will take care of that. You ...
Spawn a new thread to read keypad while RFID is being scanned, then read its data and kill it the moment RFID is done being scanned. In the code below, I'll demonstrate the use of processes.
At the top of your script (new_main.py) add
from multiprocessing import Process, Pipe, Value
then, before line 79 (which shall be line 80 once you insert the above), ...
How to use Rpi python to detect motion sensor signal and switch on a relay.
Your Russian connection looks OK. I can write you a python program (no guarantee your Ppi won't explode!) to detect the motion output signal.
The problem now is: If you cat comes in, the motion sensor gives a warning signal to Rpi (at GPIO pin 17), so Rpi will ...
If the relay pins are a simple contact closure (which seems likely, but no one can confirm - although it is easy to verify with a multimeter) then you can use any button code.
Connecting to ...
I removed the plastic stopper from the gears so they are moving
Now the motor won't rotate or do anything.
I can rotate the DC motor by applying 5v to the motor pins itself.
Well, newbies of course carelessly kill their servos. So I have killed a couple, or have their little and big gears scattered all around and ...