Max2Play Home › Forums › Max2Play on Raspberry PI › Max2Play on STRETCH + FHEM + 97_SB_SERVER problem › Reply To: Max2Play on STRETCH + FHEM + 97_SB_SERVER problem
hi,
I received my RPI 4B and i installed the new M2P 1.53.
After that i did all RPI update.
it seem that 97_SB_SERVER.pm work with M2P 1.53 and FHEM 6.0.23320 with the file here :
https://github.com/ChrisD70/FHEM-Modules/blob/master/autoupdate/sb/FHEM/97_SB_SERVER.pm
This file is uptaded from 2019-04-15 while the file installed with FHEM is older.
however
when i reboot M2P FHEM didn’t work anymore (service is lauch but the web interface don’t load).
To fix this
-i had to click on „kill“ FHEM process. The process failed to stop but FHEM work again.
-I had to comment this 2 lines in fhem.
`#define initialUsbCheck notify global:INITIALIZED usb create
#setuuid initialUsbCheck xxx`
Now it’s work well for me.
If somebody need this, i use fhem to activate a relay and a amplifier power supply if one of my squeezeboxplayer (multi usb DAC with multisqueeze plugin) play music:
define squeezebox_Server SB_SERVER 192.168.1.xxx
define SB_PLAYER_b825ebc171f0 SB_PLAYER b8:25:eb:c1:71:f0
(auto detected by 98_SB_PLAYER.pm when SB_SERVER is define with the previous line)
define etat_playstatus dummy
(a variable for save the state if one player is running)
define GPIO17 RPI_GPIO 17
attr GPIO17 direction output
define GPIO17 RPI_GPIO 18
attr GPIO18 direction output
define SB_PLAYER_playStatus notify SB_PLAYER_b823ebc171f0:.*|SB_PLAYER_b824ebc171f0:.*|SB_PLAYER_b825ebc171f0:.*|SB_PLAYER_b826ebc171f0:.*|SB_PLAYER_b827ebc171f0:.*|SB_PLAYER_b828ebc171f0:.*|SB_PLAYER_b829ebc171f0:.* {\
if (\
ReadingsVal ("SB_PLAYER_b823ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b824ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b825ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b826ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b827ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b828ebc171f0", "playStatus", "") eq "playing" ||\
ReadingsVal ("SB_PLAYER_b829ebc171f0", "playStatus", "") eq "playing"\
)\
{\
fhem ("set etat_playstatus on");;\
}\
else\
{\
fhem ("set etat_playstatus off");;\
}\
}
(catch notification from squeezebox player and look the state of „playStatus“. If one of them is „playing“ etat_playstatus is set to „on“)
define ETAT_AMPLIFICATEUR DOIF ([etat_playstatus] eq "on")\
(set GPIO17 off)\
(set GPIO18 off)\
DOELSE\
(set GPIO17 on)\
(set GPIO18 on)
attr ETAT_AMPLIFICATEUR wait 0,0:30,0
(look for „etat_playstatus“ state. If „etat_playstatus“ is on then GPIO turn off and switch on the amplifier power supply (reverse logic pin). If „etat_playstatus“ is off then GPIO turn on and switch off the power supply after 30s).
It’s work very well!