diff --git a/README.md b/README.md index 6a2e2cc39..09f398935 100755 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ A contactless jukebox for the Raspberry Pi, playing audio files, playlists, podc * **Gitter Community** we got ourselves a gitter community; chat us up at https://gitter.im/phoniebox -* **Phoniebox [2.1](https://github.com/MiczFlor/RPi-Jukebox-RFID/milestone/3?closed=1) released (2020-10-12)** +* **Phoniebox [2.1.1](https://github.com/MiczFlor/RPi-Jukebox-RFID/milestone/5?closed=1) released (2020-10-14)** -The 2.1 release was pushed through the doors with many contributors (some of which in alphabetical order): @andreasbrett @BerniPi @juhrmann @Luegengladiator @MarkusProchaska @MarlonKrug @patrickweigelt @princemaxwell @RalfAlbers @s-martin @themorlan @veloxidSchweiz @xn--nding-jua. [List of all contributors](https://github.com/MiczFlor/RPi-Jukebox-RFID/graphs/contributors) +The [2.1](https://github.com/MiczFlor/RPi-Jukebox-RFID/milestone/3?closed=1) release was pushed through the doors with many contributors (some of which in alphabetical order): @andreasbrett @BerniPi @juhrmann @Luegengladiator @MarkusProchaska @MarlonKrug @patrickweigelt @princemaxwell @RalfAlbers @s-martin @themorlan @veloxidSchweiz @xn--nding-jua. [List of all contributors](https://github.com/MiczFlor/RPi-Jukebox-RFID/graphs/contributors) -## What's new in version 2.1? +## What's new in version 2.1.1? * Use [multiple readers](https://github.com/MiczFlor/RPi-Jukebox-RFID/pull/1012#issue-434052529) simultaneously * Improved [GPIO control](components/gpio_control/README.md) and integrated in **one-line install script** diff --git a/components/gpio_control/GPIODevices/simple_button.py b/components/gpio_control/GPIODevices/simple_button.py index e63e4dbd3..199c5c8bb 100644 --- a/components/gpio_control/GPIODevices/simple_button.py +++ b/components/gpio_control/GPIODevices/simple_button.py @@ -58,7 +58,7 @@ def checkGpioStaysInState(holdingTime, gpioChannel, gpioHoldingState): class SimpleButton: def __init__(self, pin, action=lambda *args: None, name=None, bouncetime=500, edge=GPIO.FALLING, - hold_time=.1, hold_repeat=False,pull_up_down=GPIO.PUD_UP): + hold_time=.1, hold_repeat=False, pull_up_down=GPIO.PUD_UP): self.edge = parse_edge_key(edge) self.hold_time = hold_time self.hold_repeat = hold_repeat @@ -120,6 +120,7 @@ def __repr__(self): self.name, self.pin, self.hold_repeat, self.hold_time ) + if __name__ == "__main__": print('please enter pin no to test') pin = int(input()) diff --git a/components/gpio_control/gpio_control.py b/components/gpio_control/gpio_control.py index 2d2617a4d..6bb958ed5 100755 --- a/components/gpio_control/gpio_control.py +++ b/components/gpio_control/gpio_control.py @@ -51,7 +51,7 @@ def generate_device(config, deviceName): edge=config.get('edge', fallback='FALLING'), hold_repeat=config.getboolean('hold_repeat', False), hold_time=config.getfloat('hold_time', fallback=0.3), - pull_up_down=config.get('pull_up_down', fallback='GPIO.PUD_UP')) + pull_up_down=config.get('pull_up_down', fallback=GPIO.PUD_UP)) elif device_type == 'LED': return LED(config.getint('Pin'), name=deviceName, @@ -63,8 +63,7 @@ def generate_device(config, deviceName): name=deviceName ) elif device_type == 'RotaryEncoder': - return RotaryEncoder( - config.getint('pinUp'), + return RotaryEncoder(config.getint('pinUp'), config.getint('pinDown'), getFunctionCall(config.get('functionCallUp')), getFunctionCall(config.get('functionCallDown')), diff --git a/scripts/Reader.py.Multi b/scripts/Reader.py.Multi index 752c34b9e..e727d7b5d 100644 --- a/scripts/Reader.py.Multi +++ b/scripts/Reader.py.Multi @@ -55,7 +55,7 @@ class Reader: sys.exit('Could not find the device %s\n. Make sure is connected' % dev.name) str_devs = ','.join([str(x) for x in devs]) - #print("Devs: " + str_devs) + # print("Devs: " + str_devs) self.devices = map(InputDevice, str_devs) self.devices = {dev.fd: dev for dev in devs} diff --git a/scripts/RegisterDevice.py.Multi b/scripts/RegisterDevice.py.Multi index 9974ca875..66dc16898 100644 --- a/scripts/RegisterDevice.py.Multi +++ b/scripts/RegisterDevice.py.Multi @@ -5,6 +5,7 @@ import subprocess JUKEBOX_HOME_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + def runCmd(cmd, wait=True): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() @@ -12,6 +13,7 @@ def runCmd(cmd, wait=True): p.wait() return output + def setupPN532(): answer = input('Please make sure that the PN532 reader is wired up correctly ' 'to the GPIO ports before continuing...\n Continue?: [Y/n]') @@ -53,6 +55,7 @@ from Reader import get_devices, EDevices list_dev_ids = list() devices = get_devices() + def addDevice(): i = 0 print("Choose the reader from list") @@ -98,6 +101,3 @@ runCmd("sudo chown pi:www-data {}/scripts/deviceName.txt".format(JUKEBOX_HOME_DI runCmd("sudo chmod 644 {}/scripts/deviceName.txt".format(JUKEBOX_HOME_DIR)) print("Register Device(s) Done!") - - - diff --git a/scripts/daemon_rfid_reader.py b/scripts/daemon_rfid_reader.py index 83e0e9d94..5bf13d43a 100755 --- a/scripts/daemon_rfid_reader.py +++ b/scripts/daemon_rfid_reader.py @@ -26,7 +26,7 @@ file_path = os.path.dirname(__file__) if file_path != "": os.chdir(file_path) - + # vars for ensuring delay between same-card-swipes ssp = open('../settings/Second_Swipe_Pause', 'r') same_id_delay = ssp.read().strip() @@ -35,7 +35,7 @@ previous_id = "" previous_time = time.time() -#create array for control card ids +# create array for control card ids cards = [] # open file and read the content in a list @@ -74,7 +74,7 @@ logger.info('Trigger Play Cardid={cardid}'.format(cardid=cardid)) subprocess.call([dir_path + '/rfid_trigger_play.sh --cardid=' + cardid], shell=True) previous_id = cardid - + else: logger.debug('Ignoring Card id {cardid} due to same-card-delay, delay: {same_id_delay}'.format( cardid=cardid, diff --git a/scripts/rfid_trigger_play.sh b/scripts/rfid_trigger_play.sh index 47eac6d44..5e62645bb 100755 --- a/scripts/rfid_trigger_play.sh +++ b/scripts/rfid_trigger_play.sh @@ -266,7 +266,7 @@ if [ "$CARDID" ]; then $PATHDATA/playout_controls.sh -c=recordstop ;; $RECORDPLAYBACKLATEST) - $PATHDATA/playout_controls.sh -c=recordplaybacklatest + $PATHDATA/playout_controls.sh -c=recordplaylatest ;; $CMDREADWIFIIP) $PATHDATA/playout_controls.sh -c=readwifiipoverspeaker @@ -400,7 +400,7 @@ if [ ! -z "$FOLDER" -a ! -z ${FOLDER+x} -a -d "${AUDIOFOLDERSPATH}/${FOLDER}" ]; if [ "${DEBUG_rfid_trigger_play_sh}" == "TRUE" ]; then echo " Completed: toggle pause/play" >> $PATHDATA/../logs/debug.log; fi elif [ "$SECONDSWIPE" == "PLAY" -a $PLLENGTH -gt 0 ] then - # The following involves NOT playing the playlist, so we set: + # The following involves NOT playing the playlist, so we set: PLAYPLAYLIST=no sudo $PATHDATA/playout_controls.sh -c=playerplay &>/dev/null if [ "${DEBUG_rfid_trigger_play_sh}" == "TRUE" ]; then echo " Completed: Resume playback" >> $PATHDATA/../logs/debug.log; fi @@ -409,7 +409,7 @@ if [ ! -z "$FOLDER" -a ! -z ${FOLDER+x} -a -d "${AUDIOFOLDERSPATH}/${FOLDER}" ]; # The following involves NOT playing the playlist, so we set: PLAYPLAYLIST=no # following needs testing (see https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/914) - # Special case for NOAUDIOPLAY because once the playlist has finished, + # Special case for NOAUDIOPLAY because once the playlist has finished, # it needs to be noted by the system that the second swipe is like a *first* swipe. currentSong=`mpc current` if [[ -z "$currentSong" ]]; then diff --git a/settings/version-number b/settings/version-number index 879b416e6..3e3c2f1e5 100755 --- a/settings/version-number +++ b/settings/version-number @@ -1 +1 @@ -2.1 +2.1.1