Error after changing configuration file
fcebreros opened this issue · 2 comments
fcebreros commented
Hi,
I'm trying to configure de pistomp to have one button for each preset but get an error and pistomp
keeps rebooting some seconds after loading. (log at the end)
# This file provides some default configuration for the system
# Most of this configuration can be overriden by pedalboard specific configuration. To accomplish that, add
# a file, named config.yml to the pedalboard directory (ie. ~/data/.pedalboards/<pedalboard-name>)
---
hardware:
# Hardware version (1.0 for original pi-Stomp, 2.0 for pi-Stomp Core)
version: 2.0
# midi definition
# channel: midi channel used for midi messages
midi:
channel: 14
# footswitches definition
# bypass: relay(s) to toggle (LEFT, RIGHT or LEFT_RIGHT)
# color: color to use for enable status halo on LCD
# debounce_input: debounce chip pin to which switch is connected
# disable: disable the switch
# gpio_input: gpio pin if not using debounce
# gpio_output: gpio pin used to drive indicator (LED, etc.)
# id: integer identifier
# midi_CC: msg to send (0 - 127 or None)
#
footswitches:
- id: 0
debounce_input: 0
bypass: LEFT
preset: 0
- id: 1
debounce_input: 1
bypass: LEFT
preset: 1
- id: 2
debounce_input: 2
bypass: LEFT
preset: 2
- id: 3
debounce_input: 3
bypass: LEFT
preset: 3
- id: 4
debounce_input: 4
bypass: LEFT
preset: 4
- id: 5
gpio_input: 0
bypass: LEFT
preset: 5
- id: 6
gpio_input: 13
bypass: LEFT
preset: 6
- id: 7
gpio_input: 26
bypass: LEFT
preset: 7
# analog control definition
# adc_input: adc chip pin to which control is connected
# disable: disable the control
# midi_CC: msg to send (0 - 127 or None)
# threshold: minimum value change to trigger a midi msg (16 default, 1024 full scale)
# type: control type (KNOB, EXPRESSION)
#
analog_controllers:
- adc_input: 0
midi_CC: 70
type: EXPRESSION
#- adc_input: 1
# midi_CC: 71
# type: KNOB
#- adc_input: 7
# midi_CC: 77
# type: EXPRESSION
Log:
Started MOD-ALA-PI-STOMP.
Jan 18 11:08:43 pistomp python3[2092]: Traceback (most recent call last):
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/modalapistomp.py", line 149, in <module>
Jan 18 11:08:43 pistomp python3[2092]: main()
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/modalapistomp.py", line 98, in main
Jan 18 11:08:43 pistomp python3[2092]: handler.set_current_pedalboard(handler.pedalboards[current_pedal_board_bundle])
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/modalapi/mod.py", line 484, in set_current_pedalboard
Jan 18 11:08:43 pistomp python3[2092]: self.update_lcd()
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/modalapi/mod.py", line 995, in update_lcd
Jan 18 11:08:43 pistomp python3[2092]: self.lcd.draw_bound_plugins(self.current.pedalboard.plugins, self.hardware.footswitches)
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/pistomp/lcdcolor.py", line 200, in draw_bound_plugins
Jan 18 11:08:43 pistomp python3[2092]: self.base_draw_bound_plugins(zone, plugins, footswitches)
Jan 18 11:08:43 pistomp python3[2092]: File "/home/pistomp/pi-stomp/pistomp/lcdbase.py", line 194, in base_draw_bound_plugins
Jan 18 11:08:43 pistomp python3[2092]: x = self.footswitch_pitch[len(fss)] * fs_id
Jan 18 11:08:43 pistomp python3[2092]: IndexError: list index out of range
Jan 18 11:08:44 pistomp systemd[1]: mod-ala-pi-stomp.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 11:08:44 pistomp systemd[1]: mod-ala-pi-stomp.service: Failed with result 'exit-code'.
Jan 18 11:08:44 pistomp systemd[1]: mod-ala-pi-stomp.service: Consumed 4.519s CPU time.
Jan 18 11:08:46 pistomp systemd[1]: mod-ala-pi-stomp.service: Scheduled restart job, restart counter is at 14.
Jan 18 11:08:46 pistomp systemd[1]: Stopped MOD-ALA-PI-STOMP.
Jan 18 11:08:46 pistomp systemd[1]: mod-ala-pi-stomp.service: Consumed 4.519s CPU time.
Best regards
Frank
rreichenbach commented
That's erroring trying to render icons for that many footswitches. If you replace line 96 of ~/pistomp/lcdili9341.py with this, it'll render up to 8 footswitches and avoid the index out of range error. I'll commit this eventually, along with some bounds checking.
self.footswitch_pitch = [120, 120, 120, 128, 86, 65, 52, 43, 38]
fcebreros commented
OK,thanks.
Pistomp is booting now.