$config->{ssl_version} = undef; $config->{ssl_version_http} = undef; $config->{ssl_cipher_list} = 'HIGH:!aNULL:!eNULL:!kRSA:!aDSS:!AES128:!3DES:!CAMELLIA:!PSK:!SRP:!SSLv2:!SSLv3:@STRENGTH'; $config->{ssl_cipher_list_http} = 'HIGH:!aNULL:!eNULL:!kRSA:!aDSS:!AES128:!3DES:!CAMELLIA:!PSK:!SRP:!SSLv2:!SSLv3:@STRENGTH'; $config = { %$config, #aliveled_gpio_pin => 20, #aliveled_on_time => 1, #aliveled_off_time => 1, #tcpserver_client_connected_gpio_pin => 7, #tcpclient_connected_gpio_pin => 7, ######################################################################## # # !!! BBB I/O works on 3.3V (ADC is even 1.8V) !!! RISK OF DAMAGE !!! # # # GPIO pin 125 was wrong name for what was actually GPIO pin 115 # # GPIO pin 69 failing as input seems to be fixed now # # GPIO pin 122 was never valid (?) external GPIO pin # # # GPIO pins 53,54,55,56 - USR 0|1|2|3 LED's # #valid_gpios => # [ 53, 54, 55, 56, ], # # BBB non-shared GPIO-only pins # #valid_gpios => # [ 7, 20, 26, 44, 45, 46, 47, 60, 61, 65, 117, 115, ], # # All BBB GPIO-capable pins from P9 pinblock # #valid_gpios => # [ 30, 60, 31, 40, 48, 51, 4, 5, 13, 12, 3, 2, 49, # 15, 117, 14, 115, 113, 111, 112, 110, 20, 7, ], # # Whole BBB P8 pinblock, minus pins 1|2 (DGND) # #valid_gpios => # [ 38, 39, 34, 35, 66, 67, 69, 68, 45, 44, 23, 26, 47, 46, 27, # 65, 22, 63, 62, 37, 36, 33, 32, 61, 86, 88, 87, 89, 10, 11, # 9, 81, 8, 80, 78, 79, 76, 77, 74, 75, 72, 73, 70, 71, ], # # All GPIO-capable pins from BBB P9 pinblock # and whole BBB P8 pinblock, minus pins 1|2 (DGND) # #valid_gpios => # [ 30, 60, 31, 40, 48, 51, 4, 5, 13, 12, 3, 2, 49, # 15, 117, 14, 115, 113, 111, 112, 110, 20, 7, # 38, 39, 34, 35, 66, 67, 69, 68, 45, 44, 23, 26, 47, 46, 27, # 65, 22, 63, 62, 37, 36, 33, 32, 61, 86, 88, 87, 89, 10, 11, # 9, 81, 8, 80, 78, 79, 76, 77, 74, 75, 72, 73, 70, 71, ], # # All GPIO-capable pins from BBB P9 pinblock # and whole BBB P8 pinblock, minus pins 1|2 (DGND), MMC, LCD(/boot config!!!) # #valid_gpios => # [ 30, 60, 31, 40, 48, 51, 4, 5, 13, 12, 3, 2, 49, # 15, 117, 14, 115, 113, 111, 112, 110, 20, 7, # 66, 67, 69, 68, 45, 44, 23, 26, 47, 46, 27, # 65, 22, 61, ], # # All GPIO-capable pins from BBB P9 pinblock # and whole BBB P8 pinblock, minus pins 1|2 (DGND), MMC, LCD(/boot config!!!) # and USR 0|1|2|3 LED's # #valid_gpios => # [ 30, 60, 31, 40, 48, 51, 4, 5, 13, 12, 3, 2, 49, # 15, 117, 14, 115, 113, 111, 112, 110, 20, 7, # 66, 67, 69, 68, 45, 44, 23, 26, 47, 46, 27, # 65, 22, 61, # 53, 54, 55, 56, ], ######################################################################## #gpio_poll_delay => 0.003000, ######################################################################## # # BBB PWM pins are shared: # # FreeBSD sysctl FreeBSD GPIO TI AM335x mux & GPIO BBB header pins #----------------------------------------------------------------------- # PWM 0A GPIO_110 EHRPWM0A GPIO3_14 block P9, pin 31 # PWM 0B GPIO_111 EHRPWM0B GPIO3_15 block P9, pin 29 # PWM 1A GPIO_50 EHRPWM1A GPIO1_18 block P9, pin 14 # PWM 1B GPIO_51 EHRPWM1B GPIO1_19 block P9, pin 16 # PWM 2A GPIO_22 EHRPWM2A GPIO2_6 block P8, pin 19 # PWM 2B GPIO_23 EHRPWM2B GPIO2_7 block P8, pin 13 # #valid_pwms => [ '0a', '0b', '1a', '1b', '2a', '2b', ], ######################################################################## ######################################################################## # # BBB UART pins are shared: # # This needs custom FDT # # FBSD UART UART pin FBSD GPIO TI AM335x mux(N) & GPIO BBB header #----------------------------------------------------------------------- # cuau0 TX GPIO_43 GPIO1_11 # cuau0 RX GPIO_42 GPIO1_10 # # cuau1 TX GPIO_15 uart1_txd(0) GPIO0_15 P9 24 # cuau1 RX GPIO_14 uart1_rxd(0) GPIO0_14 P9 26 # # cuau2 TX GPIO_3 uart2_txd(1) GPIO0_3 P9 21 # cuau2 RX GPIO_2 uart2_rxd(1) GPIO0_2 P9 22 # # cuau3 TX GPIO_7 uart3_txd(1) GPIO0_7 P9 42 # # cuau4 TX GPIO_31 uart4_txd(6) GPIO0_31 P9 21 # cuau4 RX GPIO_30 uart4_rxd(6) GPIO0_30 P9 22 # cuau4 RTS GPIO_9 uart4_rts(6) GPIO0_9 P8 33 # cuau4 CTS GPIO_8 uart4_cts(6) GPIO0_8 P8 35 # # cuau5 TX GPIO_78 uart5_txd(4) GPIO2_14 P8 37 # cuau5 RX GPIO_79 uart5_rxd(4) GPIO0_15 P8 38 # cuau5 RTS GPIO_11 uart5_rts(6) GPIO0_11 P8 32 # cuau5 CTS GPIO_10 uart5_cts(6) GPIO0_10 P8 31 # ######################################################################## ######################################################################## # # BBB I2C pins are shared: # # FBSD I2C I2C pin FBSD GPIO TI AM335x mux(N) & GPIO BBB header #----------------------------------------------------------------------- # iic0 *INTERNAL* # iic0 *INTERNAL* # # iic1 SCL GPIO_4 GPIO0_4 P9 17 # iic1 SDA GPIO_5 GPIO0_5 P9 19 # # iic2 SCL GPIO_13 GPIO0_13 P9 18 # iic2 SDA GPIO_12 GPIO0_12 P9 20 # ######################################################################## ######################################################################## # # !!! BBB ADC pins !!! *** ONLY ACCEPT 1.8 VOLTS MAXIMUM *** !!! # # Number BBB header #----------------------------------------------------------------------- # ADC0 P9 39 # ADC1 P9 40 # ADC2 P9 37 # ADC3 P9 38 # ADC4 P9 33 # ADC5 P9 36 # ADC6 P9 35 # ADC7 (internal, 2 * value = voltage on vdd_3v3b bus) # GND_ADC P9 34 # VDD_ADC P9 32 # #valid_adcs => [ 0 .. 7 ], ######################################################################## ######################################################################## # # USB1_OCn signal from BBB schematics, LOW when USB1 is over current # (500mA maximum) # USB1 is BBB default host port, USB female type A socket # # FBSD GPIO TI AM335x GPIO #----------------------------------------------------------------------- # GPIO_58 GPIO1_26 # # # USB 0/1 bus supply control # # Name FBSD GPIO TI AM335x mux(N) & GPIO #----------------------------------------------------------------------- # USB0_DRVVBUS GPIO_18 USB0_DRVVBUS(0) GPIO0_18 # USB1_DRVVBUS GPIO_109 USB1_DRVVBUS(0) GPIO3_13 # ######################################################################## #all_valid_out_pins_internal => [], #onewire_port => '/dev/null', #nodelay_disabled => 1, #bind_address_inet => '0.0.0.0', #bind_address_inet6 => '::', #bind_port => 11513, bind_port_ssl => 11514, #bind_port_http => 11515, #bind_port_ssl_http => 11516, bind_reuse => 1, bind_sctp => 1, tcpclient_address => '2001:ad0:91f::241', tcpclient_port => 11514, nonssl_server_acl => qr/^(?:(?:(?:::ffff:)?127\.0\.0\.|::)1|2001:ad0:91f:(?::241|a107:21b:11ff:feb8:7d89))$/i, fastcgi_acl => qr/^(?:(?:(?:::ffff:)?127\.0\.0\.|::)1)$/i, http_acl => qr/^(?:(?:(?:::ffff:)?127\.0\.0\.|::)1|(?:::ffff:)?10\.0\.0\.(?:21|241)|2001:ad0:91f::(?:241|21a:6bff:fe66:2ad3))$/i, admin_cn_acl => qr/^ketas-laptop$/i, poeserver_cn_acl => qr/^(?:bbb|local-client-test|shcp)$/i, fastcgi_cn_acl => qr/^$/i, tcpserver_poe_filter_ssl_new_params => { crt => 'ssl/server.crt', key => 'ssl/server.key', cacrt => 'ssl/ca.crt', cacrl => 'ssl/ca.crl', dhcert => 'ssl/server.dh', version => $config->{ssl_version}, cipher => $config->{ssl_cipher_list}, #debug => 1, clientcert => 1, blockbadclientcert => 1, }, tcpserver_poe_filter_ssl_new_params_http => { crt => 'ssl/server.crt', key => 'ssl/server.key', cacrt => 'ssl/ca.crt', cacrl => 'ssl/ca.crl', dhcert => 'ssl/server.dh', version => $config->{ssl_version_http}, cipher => $config->{ssl_cipher_list_http}, #debug => 1, #clientcert => 1, #blockbadclientcert => 1, }, tcpclient_poe_filter_ssl_new_params => { crt => 'ssl/client.crt', key => 'ssl/client.key', cacrt => 'ssl/ca.crt', cacrl => 'ssl/ca.crl', dhcert => 'ssl/client.dh', version => $config->{ssl_version}, cipher => $config->{ssl_cipher_list}, client => 1, }, log_timestamp_uptime => 1, log_timestamp_millisecond_diff => 1, log_sslcn_on_io_lines => 1, #log_sslcipher_on_io_lines => 1, #log_raw_websocket_io => 1, #log_httpfilter_io => 1, #log_sql_queries => 1, #log_enable_in_quiet_mode => 1, #syslog_high_priority_debug => 0, #poesession_mode => '', #poesession_mode => 'miniclient', #poesession_mode => 'client', poesession_mode => 'server', #poesession_mode => 'ioserver', sunrise => { # Saue, Estonia longitude => 24.554083, latitude => 59.324054, timezone => 2, }, sql => { dsn => 'DBI:Pg:host=2001:ad0:91f::246;dbname=poe;sslmode=require', username => 'poe', #password => '', }, #limits => #{ # max_client_count_per_addr => 10, # max_accepts_per_second => 10, # max_http_requests_per_second => 10, #}, # # #shcp => #{ # use_inline_files => undef, # # inline_files => [], # # get_cached_items_map => {}, # # http_useragent_extra => '', # # ip_acl => qr/^$/i, # password => qr/^$/i, #}, }; $config->{event_namemap}->{input} = { 'toggle-1' => 'remote-gpio:bbb:2', 'toggle-2' => 'remote-gpio:bbb:3', 'toggle-4' => 'remote-gpio:bbb:14', 'alarm-1' => 'remote-gpio:bbb:15', 'alarm-0' => 'remote-gpio:bbb:26', 'alarm-2' => 'remote-gpio:bbb:27', 'latch-1' => 'remote-gpio:bbb:30', 'latch-2' => 'remote-gpio:bbb:31', 'latch-0' => 'remote-gpio:bbb:44', 'toggle-0' => 'remote-gpio:bbb:45', 'toggle-all' => 'remote-gpio:bbb:48', 'toggle-3' => 'remote-gpio:bbb:68', 'off-all' => 'remote-gpio:bbb:117', 'interrupt-0' => 'remote-gpiointerrupt:bbb:7', 'bbb-adc0' => 'remote-adc:bbb:0', 'bbb-adc1' => 'remote-adc:bbb:1', 'bbb-adc2' => 'remote-adc:bbb:2', 'bbb-adc3' => 'remote-adc:bbb:3', 'bbb-adc4' => 'remote-adc:bbb:4', 'bbb-adc5' => 'remote-adc:bbb:5', 'bbb-adc6' => 'remote-adc:bbb:6', 'bbb-adc7_vdd_3v3b' => 'remote-adc:bbb:7', 'test-1' => 'fastcgi:test_1', 'test-2' => 'fastcgi:test_2', 'test-3' => 'fastcgi:test_3', 'test-4' => 'fastcgi:test_4', 'dummy-1' => 'fastcgi:dummy_1', 'dummy-2' => 'fastcgi:dummy_2', 'dummy-3' => 'fastcgi:dummy_3', 'dummy-4' => 'fastcgi:dummy_4', 'dummy-5' => 'fastcgi:dummy_5', 'bbb-gpio-test' => 'fastcgi:bbb_gpio_test', 'bbb-user-led-2' => 'fastcgi:bbb_user_led_2', 'auto-nightlight' => 'fastcgi:auto_nightlight', 'sun' => 'sun', 'time' => 'time', }; $config->{event_namemap}->{output} = { 'led-4' => 'remote-gpio:bbb:46', 'led-3' => 'remote-gpio:bbb:47', 'bbb-user-led-0' => 'remote-gpio:bbb:53', 'bbb-user-led-1' => 'remote-gpio:bbb:54', 'bbb-user-led-2' => 'remote-gpio:bbb:55', 'bbb-user-led-3' => 'remote-gpio:bbb:56', 'led-1' => 'remote-gpio:bbb:60', 'led-6' => 'remote-gpio:bbb:61', 'led-5' => 'remote-gpio:bbb:65', 'led-2' => 'remote-gpio:bbb:69', 'led-0' => 'remote-gpio:bbb:115', 'latch' => 'latch', 'alarm' => 'alarm', 'vdd_3v3b_ok' => 'poe-state:bbb_vdd_3v3b_ok', 'vdd_3v3b_err' => 'poe-state:bbb_vdd_3v3b_err', }; $config->{eventmap} = { i('toggle-0') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ] ] }, i('toggle-1') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ] ] }, i('toggle-2') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ] ] }, i('toggle-3') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ] ] }, i('toggle-4') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ] ] }, i('toggle-all') => { ON() => [ [ o('led-0'), TOGGLE, { wait => 0.1 } ], [ o('led-1'), TOGGLE, { wait => 0.1 } ], [ o('led-2'), TOGGLE, { wait => 0.1 } ], [ o('led-3'), TOGGLE, { wait => 0.1 } ], [ o('led-4'), TOGGLE, { wait => 0.1 } ], [ o('led-5'), TOGGLE, { wait => 0.1 } ], [ o('led-6'), TOGGLE, { wait => 0.1 } ], [ o('bbb-user-led-2'), TOGGLE, { wait => 0.1 } ], [ o('bbb-user-led-3'), TOGGLE, { wait => 0.1 } ], ], }, i('off-all') => { ON() => [ [ o('led-0'), OFF, { wait => 0.1 } ], [ o('led-1'), OFF, { wait => 0.1 } ], [ o('led-2'), OFF, { wait => 0.1 } ], [ o('led-3'), OFF, { wait => 0.1 } ], [ o('led-4'), OFF, { wait => 0.1 } ], [ o('led-5'), OFF, { wait => 0.1 } ], [ o('led-6'), OFF, { wait => 0.1 } ], [ o('bbb-user-led-2'), OFF, { wait => 0.1 } ], [ o('bbb-user-led-3'), OFF, { wait => 0.1 } ], ], }, i('latch-0') => { OFF() => [ o('latch') ] }, i('latch-1') => { OFF() => [ o('latch') ] }, i('latch-2') => { OFF() => [ o('latch') ] }, i('alarm-0') => { OFF() => [ o('alarm') ] }, i('alarm-1') => { OFF() => [ o('alarm') ] }, i('alarm-2') => { OFF() => [ o('alarm') ] }, #i('test-1') => #{ # ON() => [ [ o('led-0'), ON ] ], # OFF() => [ [ o('led-0'), OFF ] ], #}, #i('test-2') => #{ # ON() => [ [ o('led-1'), ON ] ], # OFF() => [ [ o('led-1'), OFF ] ], #}, i('test-3') => { ON() => [ [ o('led-2'), ON ] ], OFF() => [ [ o('led-2'), OFF ] ], }, i('test-4') => { ON() => [ [ o('led-3'), ON ] ], OFF() => [ [ o('led-3'), OFF ] ], }, #i('dummy-1') => { }, #i('dummy-2') => { }, #i('dummy-3') => { }, i('dummy-4') => { }, i('dummy-5') => { }, i('bbb-gpio-test') => { ON() => [ [ o('led-2'), ON ] ], OFF() => [ [ o('led-2'), OFF ] ], }, i('bbb-user-led-2') => { ON() => [ [ o('bbb-user-led-2'), ON ] ], OFF() => [ [ o('bbb-user-led-2'), OFF ] ], }, i('auto-nightlight') => { ON() => [ [ o('bbb-user-led-3'), ON ] ], OFF() => [ [ o('bbb-user-led-3'), OFF ] ], }, i('interrupt-0') => { }, i('sun') => { RISE() => [ [ o('led-2'), OFF ], [ o('bbb-user-led-3'), OFF ], ], SET() => [ [ o('led-2'), ON ], [ o('bbb-user-led-3'), ON ], ], }, i('bbb-adc0') => { }, i('bbb-adc1') => { }, i('bbb-adc2') => { }, i('bbb-adc3') => { }, i('bbb-adc4') => { }, i('bbb-adc5') => { }, i('bbb-adc6') => { }, i('bbb-adc7_vdd_3v3b') => { '1485-1815' => [ #[ o('vdd_3v3b_ok') ], ], '!1485-1815' => [ #[ o('vdd_3v3b_err') ], ], '>1485' => [ ], '<1815' => [ ], }, i('time') => { '....-..-.. 00:00:00' => [ ], '....-..-.. 09:00:00' => [ ], '....-..-.. 17:00:00' => [ ], }, }; $config->{ws2801_pincfg} = { bbb => [ 66, 67 ], }; #$config->{poll_gpio_pins} = $config->{valid_gpios}; #$config->{change_gpio_pins} = $config->{valid_gpios}; #$config->{tcpclient_valid_gpios} = $config->{valid_gpios}; #$config->{tcpclient_valid_pwms} = $config->{valid_pwms}; #$config->{tcpclient_valid_adcs} = $config->{valid_adcs}; #$config->{poll_gpio_pins} = [ @{$config->{poll_gpio_pins}}, @{$config->{change_gpio_pins}} ]; #$config->{all_valid_out_pins_internal} = [ @{$config->{change_gpio_pins_extra}} ];