|
Post by snakn1 on Sept 4, 2022 7:42:42 GMT -8
Hello all I was thinking this was already asked and fixed. As we all know that the WiringPi was discontinued but worse does not work on my Le Potato (AML-S905X-CC) I need to use the gpiod app (see below). I need help to modify or replace the current "SDL_PI_WeatherRack.py" program to use the new way of controlling the GPIO on non Pi OS.... any help or examples on how to read the wind speed. I do not use the rain gage.
This is the preferred method of operating GPIO pins.
sudo apt-get install gpiod
gpioget $GPIOCHIP $GPIONUM
gpioset $GPIOCHIP $GPIONUM=0
Replace $GPIOCHIP and $GPIONUM with the GPIO chip and unquoted Linux
gpiodetect - list all gpiochips present on the system, their names, labels and number of GPIO lines
gpioinfo - list all lines of specified gpiochips, their names, consumers, direction, active state and additional flags
gpioget - read values of specified GPIO lines
gpioset - set values of specified GPIO lines, potentially keep the lines exported and wait until timeout, user input or signal
gpiofind - find the gpiochip name and line offset given the line name
gpiomon - wait for events on a GPIO line, specify which events to watch, how many events to process before exiting or if the events should be reported to the console
|
|
|
Post by snakn1 on Sept 5, 2022 10:04:16 GMT -8
FYI I have it tracked down to help with this code the replacement command I founds that will return the falling edge to my GPIO port is Current part of the SDL_Pi_WeatherRack.py program:
GPIO.add_event_detect(pinAnem, GPIO.RISING, callback=self.serviceInterruptAnem, bouncetime=40 ) GPIO.add_event_detect(pinRain, GPIO.RISING, callback=self.serviceInterruptRain, bouncetime=40 )
My replacement command line that I found that will get the data. but do not know how to add it so the rest of the program will work. Sorry still learning
sudo gpiomon -f gpiochip1 82 #pin38 sudo gpiomon -f gpiochip1 84 #pin37
if it helps:
sudo gpiomon --help Usage: gpiomon [OPTIONS] <chip name/number> <offset 1> <offset 2> ...
Wait for events on GPIO lines and print them to standard output
Options: -h, --help: display this message and exit -v, --version: display the version and exit -l, --active-low: set the line active state to low -B, --bias=[as-is|disable|pull-down|pull-up] (defaults to 'as-is '): set the line bias -n, --num-events=NUM: exit after processing NUM events -s, --silent: don't print event info -r, --rising-edge: only process rising edge events -f, --falling-edge: only process falling edge events -b, --line-buffered: set standard output as line buffered -F, --format=FMT specify custom output format
Biases: as-is: leave bias unchanged disable: disable bias pull-up: enable pull-up pull-down: enable pull-down
Format specifiers: %o: GPIO line offset %e: event type (0 - falling edge, 1 rising edge) %s: seconds part of the event timestamp %n: nanoseconds part of the event timestamp
thanks for any help
|
|
|
Post by SDL on Sept 5, 2022 14:46:17 GMT -8
You have to put an interrupt on the line you have connected to the wind speed. Then you measure the time between interrupts and you can determine the speed. Check out the drivers at GitHub.com/switchdoclabs
BP
|
|
|
Post by snakn1 on Sept 9, 2022 5:31:56 GMT -8
thank you I think may be searching for a sampling program or support program that uses something like the Adafruit_python_gpio.py that I can modify the table for my needs. I just need the sampling program to use the local GPIO chip pin VS the older wiringPi way and RDI.GPIO with all your GitHub branches, can you give me a pointer where to look what project would use the older weather rack , or something that I can merge the code to get it to work. Sorry I can not afroed a Pi right now I do not need a Pi 4 for this, but I need at lease a 3B but the Raspbian OS is not happy with any non Pi bds. AML-S905X-CC-V1.0A Headers.xlsx (65.32 KB)
|
|
|
Post by SDL on Sept 11, 2022 15:44:43 GMT -8
|
|