[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4678: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4680: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4681: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4682: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
virt2real.ru • Просмотр темы - Пуск скрипта по нажатию кнопки
Страница 1 из 1

Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 22 июн 2016, 14:09
pek
Привет всем.
Хочу, чтоб виртурилка запускала скрипт по нажатию кнопки.
Есть скрипт /root/1.sh
Нужно запустить его по появлению 1 на 62. GPIO79 или по наличию >3 вольт на pwm0
Помогите реализовать или куда посмотреть.

Re: Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 26 июн 2016, 16:57
pek
В общем я перевесил кнопку на пин 54. GPIO3
Сконфигурировал пин так:
gpio-event 3:b:255
echo "set gpio 3 input 0" > /dev/v2r_gpio

Используя gpio-event вижу

[root@virt2real button]# gpio-event --execute echo
3 R 946708678.480582
3 F 946708678.736845
3 R 946708678.993817
3 R 946708679.823240
3 F 946708681.053265

Похоже, шума много или параметр debounce не работает :(

Есть в админке виртурилки монитор состояний, так он исправно работает.

Кнопка с фиксацией у меня. Хотелось бы запуск скрипта по изменению состояния.

Как в админке реализован опрос?

Re: Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 27 июн 2016, 01:49
realizator
Так речь о нажатие физической кнопки, или о кнопке на клаве компьютера? О каком именно опросе в админке идет речь?

Re: Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 27 июн 2016, 12:39
pek
Физическая кнопка , один пин которой на +3,3 другой на gpio3

Опрос в админке состояния пинов. Задавал вопрос об этой страничке здесь

Re: Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 27 июн 2016, 14:00
realizator
Несколько мыслей есть.
Первое - "ловить на PWM больше 3 вольт". Это же не постоянное напряжение. Вы точно хотите именно напряжение на PWM словить?
Второе: если то, как работает в админке, вас устраивает - гляньте код, он там в открытом виде лежит.
Третье: тема по ловле уровня на одном GPIO с помощью другого тут уже обсуждалась, например тут:
viewtopic.php?f=44&t=14194&p=20452&hilit=gpio+in#p20452

Re: Пуск скрипта по нажатию кнопки

СообщениеДобавлено: 28 июн 2016, 16:45
pek
Я разобрался, расписал как сделал в .