Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 6.0.0
Hello, first of all I need to thank everybody who is/was involved in developing this great software! I have already two players running and I am looking for the next one because I want to replace my SB Receiver. But I am using both outputs of the Receiver: digital goes to my AVR and the analogue output feeds my headphone amp. The "HifiBerry DAC+ DSP" can provide the same outputs (analogue and digital) but the question is whether piCorePlayer supports both outputs of the "HifiBerry DAC+ DSP" in parallel (or at all)? >From the HifiBerry page I learned that the "HifiBerry DAC+ DSP" is able to output via both but I found nothing about his HAT here in this forum. Any feedback is highly appreciated. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=111787 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 6.0.0
Hi Viragored, I will get the "HifiBerry DAC+ DSP" probably next week. Hence, I will soon be able to try some of the proposed solutions and I am optimistic that we will get it work as expected. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=111787 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 6.0.0
paul- wrote: > I have no idea, I don't have the card to play with. But there is no > special driver for this card, so music path must be set via a mixer. Hi, the HifiBerry DAC+ DSP uses an old overlay (dtoverlay=hifiberry-dac). Therefore I used an older Audio Output Device Setting: HifiBerry DAC Zero/MiniAMP. With this configuration, I get music on both outputs, analogue and digital. Hence, from pCP point of view, everything is fine. But unfortunately, the HifiBerry HAT doesn't work as I expected. The sampling rate of the digital output is always 48 kHz because the DSP has to run with a fixed sample rate to process the audio samples. HifiBerry confirmed this behaviour: https://support.hifiberry.com/hc/en-us/community/posts/360011545658-DAC-DSP-Output-Samplerate This transformation is also done if the input signal has 44.1 kHz as sampling rate. I am not sure whether I can live with this kind of transformation. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=111787 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Hi WadDad, I am sure you will find for most light sensors a description how to use it with a RaspberryPi. Unfortunately, these descriptions are in most cases based on the Raspian OS and not on TinyCore Linux. For a transfer of these how-to's from Raspian to Tiny Core, you need to know you can save changes in the TinyCore image (i.e. piCorePlayer image). pCP uses an image on the SD card to create a Linux system in the RAM of the RPi. Any changes that you do on the running system, are normally lost after a reboot of the pCP. On the homepage of TinyCoreLinux is a description how to save changes (see section 'Backup/Restore' at the end of the page): http://tinycorelinux.net/concepts.html A useful picture: http://tinycorelinux.net/arch_core.html The according tools of the pCP is the command "pcp bu" on the CLI and the "Backup" button on the piCorePlayer web page (Main Page, section "Additional functions"). jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
he EEPROMs of an HAT. I recommend not to activate i2c0 at all because it causes instabilities in my system. If the sensor is recognized by the I2C bus can be checked by the command 'i2cdetect -y 1': $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- The address 0x23h represents the BH1750. A simple test program from sends the control code for a one-time measurement in high resolution mode with 1 lux precision to the BH1750. The value 0x20h, corresponds to 0010. After a short wait, the code reads the measurement results. The bytes then return to the correct order, and display the measurement result. $ cat lux.c #include #include #include int main (void) { /* BH1750 uses address 0x23 on the I2C bus */ int handle = wiringPiI2CSetup(0x23); if (handle == -1) return 1; /* The control code 0x20 tells BH1750 to execute a One-Time measurement with high resolution (i.e. 1 lx resolution) */ wiringPiI2CWrite(handle,0x20); sleep(1); // Measurement Time is typically 120ms. int word=wiringPiI2CReadReg16(handle,0x00); int lux=((word & 0xff00)>>8) | ((word & 0x00ff)<<8); printf("%d \n",lux); return 0 ; } I stored the file in a new folder of the $HOME-directory of the user 'tc', i.e. under '/home/tc/lux/'. The complete $HOME-directory is normally saved with a 'pcp bu'. Save your changes: $ pcp bu Now we compile our source code, rename the executable and set the permissions accordingly. $ cc lux.c -lwiringPi $ mv a.out lux && chmod 755 lux Some results when running 'lux': tc@SB-Bedroom:~/lux$ ./lux 20 tc@SB-Bedroom:~/lux$ ./lux 304 Next we need a tool that sets the brightness of the display according to the measured light intensity. I use a shell script for this task because it can be easily adapted. Currently it is still a very basic script but it fulfils its main task. $ cat display-control.sh #!/bin/sh WDIR=/home/tc/lux # if the measured value is below MIN_THRESHOLD then the display is set to MIN_BRIGHTNESS MIN_THRESHOLD=10 MIN_BRIGHTNESS=10 # if the measured value is above MAX_THRESHOLD then the display is set to MAX_BRIGHTNESS MAX_THRESHOLD=1010 MAX_BRIGHTNESS=255 LUX_RANGE=`echo "$MAX_THRESHOLD-$MIN_THRESHOLD" | bc` BRIGHTNESS_RANGE=`echo "$MAX_BRIGHTNESS-$MIN_BRIGHTNESS" | bc` STEPSIZE=$(echo "scale=2 ; $LUX_RANGE/$BRIGHTNESS_RANGE" | bc -l | cut -f1 -d\.); # time interval between two measurements INTERVAL=5 # Debugging ... echo `date` > $WDIR/deleteme # Let's wait until pCP is up & running sleep 20 while true; do # Measuring the current LUX value LUX=$($WDIR/lux) # Calculating the target brightness of the display if [ $LUX -lt $MIN_THRESHOLD ]; then TRGT=$MIN_BRIGHTNESS elif [ $LUX -gt $MAX_THRESHOLD ]; then TRGT=$MAX_BRIGHTNESS else TRGT=$(echo "$MIN_BRIGHTNESS+(($LUX-$MIN_THRESHOLD)/$STEPSIZE)" | bc -l | cut -f1 -d\.); fi # Setting the brightness value of the display echo $TRGT > /sys/class/backlight/rpi_backlight/brightness # Uncomment for debugging & testing #echo $LUX #echo $TRGT # Wait some seconds before the next calculation sleep $INTERVAL done For verifying the configuration, you can execute the script manually (you should uncomment the lines with 'echo $LUX' and 'echo $TRGT'). $ ./display-control.sh The script prints now the measured light intensity and the target value for the brightness of the display. Save your changes: $ pcp bu This script must be executed automatically when the piCorePlayer has started. This is done by enhancing the BH1750 part in the file /opt/bootlocal.sh: ### BH1750 start ------ # Enabling kernel module i2c-dev /sbin/modprobe i2c-dev # starting shell script to control display brightness /home/tc/lux/display-control.sh ### BH1750 stop -- Save your changes: $ pcp bu tbc jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
(my previous post reached the maximum number of 1 letters) The software part is nearly done now. In my case, the content of the display was upside down so that I needed to change the rotation of the display. This is done in the file config.txt. Search for 'lcd_rotate' and change its value accordingly: # Screen rotation 0 => 0 degrees, 2 => 180 degrees lcd_rotate=0 Save your changes: $ pcp bu The assembling of the hardware (case, display, RPi and HAT) is described on smarticase.com/setup. I placed the BH1750 at tzhe place which is intended for the official camera. Even the jumper cables of the BH1750 take the same path as the ribbon cable of the camera. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Thanks for the info about wiringpi, paul-. Do you know whether there is an alternative to wiringpi for C/C++ programming? Nevertheless, I will try to create the same task with Python. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
prabbit wrote: > With this sensor and code (setting aside wiringpi), does the brightness > go dimmer or darker than what can be achieved by manually setting the > screen brightness to 0, which is bright enough for me during the day and > too bright for nighttime? > > I would love to have a way to make my screen even dimmer. Until I do, my > RPi 4 with its 7 inch touchscreen is stuck in the living room and cannot > come into the bedroom. Sorry, prabbit, I missed your question. I am not sure if I get your question correctly but I am using the dimmer for the pCP in my bedroom. Its main target is to dim the display when I switch off the light and that works very well. Actually, the adaptive brightness of the display works generally very well. I am happy with the solution. I have already changed to a solution based on Python/smbus and will post later a description. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
I followed the recommendation of @paul- and changed to a solution based on Python/smbus. The following replaces the part with C-programming and the shell script in my previous how-to. All related to I2C is still valid. *Requirement: *You just need to install the extension "smbus-python3.6.tcz". pCP will add all dependencies, i.e. all other required extensions. *Script: * Code: #!/usr/local/bin/python3 import smbus import time # Define some constants from the datasheet ADDRESS= 0x23 # I2C-Adresse des BH1750 if ADDR is seto GND #ADDRESS= 0x5C # I2C-Adresse des BH1750 if ADDR is seto 3.3V POWER_DOWN = 0x00 # No active state POWER_ON = 0x01 # Power on RESET = 0x07 # Reset data register value # Start measurement at 1 lx resolution. Time typically 120 ms CONTINUOUS_HIGH_RES_MODE_1 = 0x10 # Start measurement at 1l x resolution. Time typically 120 ms # Device is automatically set to Power Down after measurement. ONE_TIME_HIGH_RES_MODE_1 = 0x20 # Set DEBUG to 'True' if you want to print some debug info DEBUG = False # Creating an I2C instance bh1750 = smbus.SMBus(1) def convertToNumber(data): # Simple function to convert 2 bytes of data # into a decimal number. Optional parameter 'decimals' # will round to specified number of decimal places. result=(data[1] + (256 * data[0])) / 1.2 return (result) def readLight(addr=ADDRESS): # Read data from I2C interface data = bh1750.read_i2c_block_data(addr,ONE_TIME_HIGH_RES_MODE_1) return convertToNumber(data) def calcTargetVal(lightLevel): # Simple algorithm to calculate the new brightness value of the # display. MIN_THRESHOLD = 10# minimum LUX value to consider MAX_THRESHOLD = 1010 # maximum LUX value to consider MIN_BRIGHTNESS = 10# minimum brightness value of the display MAX_BRIGHTNESS = 255 # maximum brightness value of the display LUX_RANGE = MAX_THRESHOLD - MIN_THRESHOLD BRIGHTNESS_RANGE = MAX_BRIGHTNESS - MIN_BRIGHTNESS # STEPSIZE: actually the LUX value that represents one brightness step STEPSIZE = LUX_RANGE / BRIGHTNESS_RANGE if lightLevel < MIN_THRESHOLD: target = MIN_BRIGHTNESS elif lightLevel > MAX_THRESHOLD: target = MAX_BRIGHTNESS else: target = MIN_BRIGHTNESS + ((lightLevel + MIN_THRESHOLD) // STEPSIZE) return (int(target)) def main(): while True: # Measuring the current LUX value lightLevel=readLight() if DEBUG: print("Light Level : " + format(lightLevel,'.2f') + " lx") # Calculating the target brightness of the display dsply_brightness = calcTargetVal(lightLevel) # Setting the brightness value of the display dsply_file = '/sys/class/backlight/rpi_backlight/brightness' f = open(dsply_file, 'wt') f.write(str(dsply_brightness)) f.close() if DEBUG: print("Display: " + str(dsply_brightness)) # Wait 5 seconds before the next calculation time.sleep(5) # main() is only invoked if display-control.py runs as a script if __name__=="__main__": main() I stored this script as "display-control.py" in the folder /home/tc/lux/. To ensure that the Python script is executed with startup of pCP, it must be started by the boot script /opt/bootlocal.sh. Together with the I2C stuff, I added the following lines to /opt/bootlocal.sh: Code: ### BH1750 start -- # Enabling kernel module i2c-dev /sbin/modprobe i2c-dev # starting shell script to control display brightness /home/tc/lux/display-control.py ### BH1750 stop -- This solution runs since yesterday on the pCP in my bedroom and I am happy with it. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Hi WadDad, I have used the following board/sensor: https://www.reichelt.de/developer-boards-digital-light-sensor-bh1750-debo-bh-1750-p224217.html?GROUPID=9008&START=0&OFFSET=50&SID=94XmgKMvs5T6H6VhWg2gBb26e9f577541908efb16ce4723de64f9&LANGUAGE=EN&&r=1 On the board is written "GY-302" and the referenced datasheet is "BH1750FVI". Hence, "GY-302" seems to be the name of the I2C board and it uses the "BH1750FVI" as light sensor. It has the dimensions 18 x 14 mm. But my description can also be used with other I2C light sensors, e.g. Adafruit VEML7700. They will have different I2C addresses and might use different commands to start the measurement -- but in general it will be the same procedure. I have chosen the BH1750 because I found some web pages which described how to use it. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
WadDad wrote: > You are recommending another case called SmartPi Touch. I'm allredy use > 'this case' > (https://www.amazon.com/Raspberry-Pi-7-Inch-Touch-Screen/dp/B01GQFUWIC). > I think it will be more difficult. Yes, the SmartPi case is very useful together with the light sensor. :) With your case, you should check if the light sensor must point to the same direction as the display or if it can point to another direction. For example, if the sensor is placed on the back of the case and it points to the other direction than the display, then the sensor will not detect correctly the sunlight that shines directly on your display. But that is normally not an important use case for a player in the bedroom. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 6.0.0
mount.nfs is located under /usr/local/sbin/ as part of the extension 'nfs-utils.tcz': /usr/local/sbin/mount.nfs You might want to call it directly with your manual command. And maybe you need to rearrange the order of target, dir and options: Code: $ /usr/local/sbin/mount.nfs -V usage: mount.nfs remotetarget dir [-rvVwfnsh] [-o nfsoptions] options: -rMount file system readonly -vVerbose -VPrint version -wMount file system read-write -fFake mount, do not actually mount -nDo not update /etc/mtab -sTolerate sloppy mount options rather than fail -hPrint this help nfsoptionsRefer to mount.nfs(8) or nfs(5) ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=111787 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 6.0.0
According to the data sheet of HifiBerry, it should work: Overlay for config.txt: dtoverlay=hifiberry-dacplushd jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=111787 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Congratulations so far, WadDad! Regarding the Python repository: Are you sure that you have enough disk space available to download the required repositories? The "Extensions" window of pCP shows the available free space: 31184 "smbus-python3.6.tcz" and its dependencies require 16-17 MB. You might need to increase the size of the partition as described in the screen shot. To investigate your problems with the shell script, I suggest to change the following lines in the script as below: Code: # Uncomment for debugging & testing #echo $LUX #echo $TRGT to Code: # Uncomment for debugging & testing echo $LUX echo $TRGT If you start now the script in a terminal, you will see the measured LUX value and the resulting brightness of the display ($TRGT). Now you change the brightness in your room and you see what is measured by the sensor. The measured LUX values can be used to adapt the parameters MIN_THRESHOLD and MAX_THRESHOLD. +---+ |Filename: pCP-extensions.png | |Download: http://forums.slimdevices.com/attachment.php?attachmentid=31184| +---+ ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
OK, This is the difference in our configurations: my screensaver is set to "Switch off" when the pCP is switched off. Hence, I don't care about the adaptive brightness control when pCP is not running. But your wish of two stages of the adaptive brightness control can be handled by the shell script. We just need to find a way to know whether pCP is ON or OFF. Maybe @paul- can tell us if there exists a file (or something else) that tells us the state of pCP. When we have this information then we just add an if-else loop to the shell script to distinguish between the two states: "pCP on" or "pCP off". ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Oops, that is a bit embarrassing! I have definitely seen and read your post but I forgot it because I didn't need it. Thanks, Paul. The "power" part is exactly what we need. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
@WadDad, you can try the following script: Code: #!/bin/sh # Enabling some useful piCorePlayer functions . /var/www/cgi-bin/pcp-functions . /var/www/cgi-bin/pcp-lms-functions WDIR=/home/tc/lux # if the measured value is below MIN_THRESHOLD then the display is set to MIN_BRIGHTNESS MIN_THRESHOLD=1 MIN_BRIGHTNESS=20 # minimum display brightness if piCorePlayer is running MIN_BRIGHTNESS_OFF=10 # minimum display brightness if piCorePlayer is switched off # if the measured value is above MAX_THRESHOLD then the display is set to MAX_BRIGHTNESS MAX_THRESHOLD=400 MAX_BRIGHTNESS=255 # maximum display brightness if piCorePlayer is running MAX_BRIGHTNESS_OFF=150 # maximum display brightness if piCorePlayer is switched off # Calculation of some variables # a) if piCorePlayer is running LUX_RANGE=$(echo "$MAX_THRESHOLD-$MIN_THRESHOLD" | bc) BRIGHTNESS_RANGE=$(echo "$MAX_BRIGHTNESS-$MIN_BRIGHTNESS" | bc) STEPSIZE=$(echo "scale=2 ; $LUX_RANGE/$BRIGHTNESS_RANGE" | bc -l | cut -f1 -d\.); # b) if piCorePlayer is switched off BRIGHTNESS_RANGE_OFF=$(echo "$MAX_BRIGHTNESS_OF-$MIN_BRIGHTNESS_OFF" | bc) STEPSIZE_OFF=$(echo "scale=2 ; $LUX_RANGE/$BRIGHTNESS_RANGE_OFF" | bc -l | cut -f1 -d\.); # time interval between two measurements INTERVAL=5 # Let's wait until pCP is up & running sleep 20 while true; do # Measuring the current LUX value LUX=$($WDIR/lux) # Determining state of piCorePlayer (on/off) REQUEST=$(pcp_lms_build_request "$NAME" "status -") RESULT=$(pcp_lms_build_result result "power") PCP_STATE=$(pcp_lms_json_request) # Calculating the target brightness of the display # a) if piCorePlayer is running if [ $PCP_STATE -eq "1" ]; then if [ $LUX -lt $MIN_THRESHOLD ]; then TRGT=$MIN_BRIGHTNESS elif [ $LUX -gt $MAX_THRESHOLD ]; then TRGT=$MAX_BRIGHTNESS else TRGT=$(echo "$MIN_BRIGHTNESS+(($LUX-$MIN_THRESHOLD)/$STEPSIZE)" | bc -l | cut -f1 -d\.); fi # b) if piCorePlayer is switched off elif [ $PCP_STATE -eq "0" ]; then if [ $LUX -lt $MIN_THRESHOLD ]; then TRGT=$MIN_BRIGHTNESS_OFF elif [ $LUX -gt $MAX_THRESHOLD ]; then TRGT=$MAX_BRIGHTNESS_OFF else TRGT=$(echo "$MIN_BRIGHTNESS_OFF+(($LUX-$MIN_THRESHOLD)/$STEPSIZE_OFF)" | bc -l | cut -f1 -d\.); else # error exit 1 fi # Setting the brightness value of the display echo $TRGT > /sys/class/backlight/rpi_backlight/brightness # Uncomment for debugging & testing #echo $LUX #echo $TRGT # Wait some seconds before the next calculation sleep $INTERVAL done The script defines new variables (ending with "_OFF") for the use case when pCP is switched off. These new variables are later used to calculate the display brightness when pCP is not running. Hence, you can play with these variables to get the result your are looking for. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Sorry, my fault. I should have tested the script before posting it. I only tested that the check for the power state is working as expected. I have added the missing "fi" into the script and fixed a typo of a variable in my post #33. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer 7.0.0 - Public Beta
@slartibartfast, I have a udev file in /etc/udev/rules.d/ (instead of /lib/udev/rules.d/) and it is executed during reboot. Maybe it is a matter of file location. But I must admit that I don't know how udev is working. ;) jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=113199 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer 7.0.0 - Public Beta
I just a read Ralphy's instruction completely and it is strange that your udev task is not activated after reboot. According to the man pages of udev, udev reads the files in /etc/udev/rules.d/ as well as in /lib/udev/rules.d/ (and some other folders). Hence, that should actually not be the root cause of your issue. But I am still using pCP 6.0.0 while you run version 7.0.0 which is still in beta stadium. And it is possible that Ralphy's test system includes some updates which are not part of 7.0.0b6 (e.g. there was an issue with UTF support of CIFS). Therefore I suggest to wait for the feedback from Ralphy. All we are doing right now is guessing. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=113199 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Jivelite for piCorePlayer
You probably have not just killed the jivelite process but also the shell script that controls its startup and spossible restarts. Code: ~$ ps -eaf | grep jivelite root 5852 1 0 Feb09 ?00:00:00 /bin/sh /opt/jivelite/bin/jivelite.sh root 7751 5852 1 Feb09 ?00:35:03 /opt/jivelite/bin/jivelite You could try to kill only the process '/opt/jivelite/bin/jivelite': Code: 0 2 1,16 * * /usr/bin/pkill -x /opt/jivelite/bin/jivelite ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=103330 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Jivelite for piCorePlayer
yes, it's indeed an attempt to outsmart the timer issue which happens every 20 days 4 hours. But it seems that I have additional cases when Jivelite is not reacting to commands from Squeezelite or LMS. For example, the player starts in the morning (because of the alarm clock) but the screen is still black. But I haven't investigated deeper into these issues because it happens at irregular intervals. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=103330 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Jivelite for piCorePlayer
I don't know what "reboot issue" you mean. Jivelite just stops (or hangs) after 24 days and 20 hours because of "timer overflow". The cron job shall restart Jivelite so that the timer starts from 0 and never reaches its maximum value. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=103330 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Jivelite for piCorePlayer
The root cause is the same and it is still in Jivelite as mentioned by Ralphy in this thread: 'https://forums.slimdevices.com/showthread.php?113247-piCorePlayer-6-and-watchdog-timer&p=994917&viewfull=1#post994917' (https://forums.slimdevices.com/showthread.php?113247-piCorePlayer-6-and-watchdog-timer&p=994917&viewfull=1#post994917|this) ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=103330 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 7.0.0
Zabizabo wrote: > Just in case. Do you have a good wifi dongle to recommand? Thanks a lot > :) Since it is already difficult to use your current wifi dongle with normal Linux, I am sure that it is really hard work to do the same with tinyCoreLinux/pCP. I use two USB wifi dongles with pCP: - Edimax EW-7811UTC - Edimax EW-7811UAC The first is a simple and short USB stick while the other has a long antenna and an extension cable. Both use the same hardware and are supported by pCP. You will need the following extension package: - wireless-5.4.83-pcpCore-v7l.tcz And this one provides useful commands (iwlist, iwconfig): - wireless_tools.tcz ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=113512 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Bogg wrote: > I've tried following this guide, but it hasn't worked for me. > > I did the steps in post #8 upto > > The address 0x23h represents the BH1750. > OK, I assume that you see the BH1750 on I2C bus with 'i2cdetect -y 1', right? > > Then followed post #23, except used the script from post #33 > > But nothing happens. I have no idea where I might have gone wrong. > Any help, particularly from @jd68 would be great. > Thanks. Well, actually you don't need the shell script from post #33 because it is only needed when the C program is used. Now the tasks of C program and shell script are covered by the Python script from post #23. Just executing the instructions of post #23 should be sufficient. Please let me know if not. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
You need at least three hands for soldering. :-) You should verify that you haven't created a shortcut between two of the pins. Yes, -python3.8-smbus.tcz- is the correct extension. If there are not shortcuts then we can search step by step for the failure. 1) The kernel module -i2c_dev- is loaded? You can check if the command was successful with $ lsmod | grep i2c One line of the output should start with i2c_dev: i2c_dev20480 2 2) The Python script should be executable. You can verify it with the command "ls -l": tc@SB-Kitchen:~/lux$ ls -l display-control.py -rwxr-xr-x1 tc staff 4261 Mar 19 21:40 display-control.py Important are the three 'x' for executable. If they are missing then you can change it with $ chmod 755 display-control.sh 3) Verify that the script measuring something. The script is able to print the measuring results to stdout (i.e. your command line). To enable this feature, you need to edit the script. Change line 21 from DEBUG = False to DEBUG = True If the script is still running in the background then we have to stop it. $ ps -ef | grep display root 6647 6414 0 21:40 pts/000:00:00 /usr/local/bin/python3 /home/tc/lux/display-control.py tc7400 6414 0 21:53 pts/000:00:00 grep display in this case, 6647 is the PID of the process 'display-control.py'. You will get a different number.To stop the script, you need to kill the process with 'sudo kill . In my case: $ sudo kill 6647 Now we execute the script manually: $ ./display-control.py You should get output similar to the following (I used a electric torch so that some values are extremely high): Light Level : 25.00 lx Display: 18 Light Level : 29.17 lx Display: 19 Light Level : 450.00 lx Display: 121 Light Level : 466.67 lx Display: 125 Light Level : 2408.33 lx Display: 255 Light Level : 16787.50 lx Display: 255 Light Level : 29.17 lx Display: 19 Light Level : 0.00 lx Display: 11 4) Are you able to write to the file '/sys/class/backlight/rpi_backlight/brightness'. You can check it these two commands: $ echo 60 > /sys/class/backlight/rpi_backlight/brightness and $ cat /sys/class/backlight/rpi_backlight/brightness 60 The first command should be executed without an error message and the second should return value that you wrote into the file (in this case 60). So, let's see how far you get with your tests. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Congratulations! Good to know that you could fix your problem. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 7.0.0
kbpro wrote: > When I power it up the backlight comes on and the screen fades to grey > (with some light vertical lines). > I don't get the rainbow display and subsequent boot text. The Pi boots > successfully and is accessible via the network but the display never > updates. > [...] > The manufacturing date of the first (problem) touchscreen appears to be > 2012, and the second (working) one appears to be 2009. Attached is a > picture of the numbers printed on the back of the screen. > Just another idea to check (): There are two generations of these displays: With the newer one you can control the brightness of the backlight while the first generation has only an on/off capability. In both types, the backlight is controlled by the content of the file '/sys/class/backlight/rpi_backlight/brightness'. For the first generation, a value greater than '0' will switch on the the backlight while '0' means 'backlight off'. The second generations accepts values between 0 and 255. The higher the value the higher the brightness. Now comes the important part for you, kbpro: values lower than 10 (or 11) lead to a black (or dark) display what is similar to the behaviour of your display. Hence, I suggest to check the value in the file '/sys/class/backlight/rpi_backlight/brightness' whether it is in the range of 1 ... 10. If yes, then choose an higher one (50 is more than sufficient. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=113512 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Which Linux with Intel NUC & LMS? Anyone here using Clear Linux?
Hi, I am using since several years an Intel NUC with i3 running on Ubuntu Linux as LMS server. Since you are not familiar with Linux, I suggest to choose a distro that is widely-used, e.g. Ubuntu or Debian. It would be easier to get support (e.g. here in the forum) if you have problems. Another suggestion is to use a "long term support (LTS)" version of the distro. These versions receive security updates for around 5 years. Other versions require a distro update once a year. For Ubuntu, it would be 20.04 LTS. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114576 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Which Linux with Intel NUC & LMS? Anyone here using Clear Linux?
I would have mentionedCentOS, too, but it is officially declared as being discontinued. There will be a fork that continues the work of CentOS but I don't want a beginner to go this unforeseeable way. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114576 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] ANNOUNCE: piCorePlayer 7.0.0
yage wrote: > Hi all, > > Apologies for the potentially dumb question but I just downloaded and > installed piCorePlayer 7.0.0 (64 bit kernel) and I'm beating my head > against the wall trying to find the ethtool extension - it doesn't seem > to be listed in any of the repositories. Do I need to install a > different version or is it included with some other extension? I am using the 32Bit version of pCP 7.0.0 and I see an ethtool extension: ethtool.tcz Maybe it is not yet available for 64Bit. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=113512 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Announce: piCorePlayer 8.0.0
paul- wrote: > It should not be hard to build it yourself. Just a little sdcard space > for the source code. > > Did anyone try to build drivers yet? Not yet but it is on my todo list. I will do it for '8812au'. Which pCP extensions do I need to install? ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114828 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Announce: piCorePlayer 8.0.0
Well, I meant the extensions required to compile the driver. Is compiletc.tcz sufficient? jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114828 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Announce: piCorePlayer 8.0.0
paul- wrote: > The scripts should walk you through it. I'm trying to be vague, to see > how it goes. Ok, understood. I am a beta tester. :D The scripts are great. It worked like a charm. But the README.md could be improved because at some points I was unsure what to do: in Step 2: instead of Code: pcp_prepare_kernel_src -k -s add the missing parameter value: Code: pcp_prepare_kernel_src -k -s Additionally, you could add a hint where to save the kernel source. On my RPi 3B+, the / partition has a size of 876 MB but the script failed to uncompress the kernel sources. Therefore I created a subfolder below /mnt/mmcblk0p2 and changed its ownership to tc:staff. Afterwards the script run through with the new target folder. in Step 3: I was unsure where to download the driver source. Should it be a subfolder of the kernel sources? Or on the contrary, it must not be in the directory of the kernel sources? I used a parallel folder below /mnt/mmcblk0p2 which was obviously a good idea because the build of the driver was done succesfully. Hence, you might want to add a hint in Step 3 where to download the driver source. Nevertheless, many thanks for providing such an easy way to create this Realtek driver. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114828 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] PiCorePlayer NFS and CIFS mounts not working
markab wrote: > Some quick browsing on "you might need a /sbin/mount. helper > program." suggest that nfs-utils, nfs-common, cifs-utils or sshfs are > not installed or not working. > > But this is getting beyond me I installed on the rpi4 from image so > would have thought that would all be present and working to support this > function? You can install additional software via "Extensions": Web interface => Main page => Additional functions => Extensions. In the tab "Available" you will find nfs-utils.tcz and cifs-utils.tcz. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115173 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Need troubleshooting help for LMS installation on Debian
gordonb3 wrote: > I think many of these questions might be avoided though if the > build-your-own requirement was advertised better and in fact the sources > for these easier to find. You are probably right. But who shall do it? Are you volunteering for this task? jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115271 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Need troubleshooting help for LMS installation on Debian
With 'git clone' you have downloaded the files. Then you have to change into the folder that you have created: cd slimserver-vendor Now you can decide which branch you want to use, e.g. 8.2 or 8.3. That is done by the commands 'git checkout public/8.2' or 'git checkout public/8.3'. You can switch from one branch to the other if you change your mind. But these git commands must be executed in the folder slimserver-vendor or in a subfolder. That is probably the reason for your error. Then you go to the CPAN folder and execute the buildme.sh shell script. By the way, I suggest to use the 8.2 branch. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115271 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Need troubleshooting help for LMS installation on Debian
in addition to the comments by gordonb3: You will get the green button on the web page https://github.com/Logitech/slimserver-vendor , which is the home page of the repository. https://github.com/Logitech/slimserver-vendor/CPAN is just the URL a subfolder of the repository. On my Ubuntu server with LMS, the "CPAN folder" is located in /usr/share/squeezeboxserver/. Probably it is the same for you so that your copy command may look as below: cp -r build/arch/5.26/aarch64-linux-thread-multi /usr/share/squeezeboxserver/CPAN/arch/5.26/ ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115271 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] PicorePlayer - how to enable I2C ?
You need to add /sbin/modprobe i2c-dev to the file /opt/bootlocal.sh. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115030 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] VU Meter Not Working
What is the format of the music tracks? AFAIK not all formats are supported by the VU Meter, e.g. DSD. I can imagine that LMS might transcode the signal for the coax pCP but uses the original signal for the USB pCP. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115597 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Announce: piCorePlayer 8.0.0
Narcos wrote: > As I intend on running 2 RPI4 (server+client configuration) do I have > to give both RPIs a seperate Static IP address? The existing Pi has > 192.168.1.6. ? If possible I would use DHCP but define in the router to assign always the same IP address to these RPi's. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=114828 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Raspberry Pi3b+ with piCorePlayer 8.1.0 looses ethernet interface
Why don't you use the command "sudo ifconfig eth0 up" in your script instead of "sudo reboot"? jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115599 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] PiCoreplayer and nfs kernelserver
Well, "nfs-utils.tcz" should be sufficient. Configuration is probably done in /usr/local/share/nfs-utils/files/exports The Server is started with /usr/local/etc/init.d/nfs-server start Maybe this command needs to be added into /opt/bootlocal.sh so that it is executed during start-up. But there is one problem where paul- might help: Code: tc@SB-Kitchen:~$ sudo /usr/local/etc/init.d/nfs-server start modprobe: FATAL: Module nfsd not found in directory /lib/modules/5.10.42-pcpCore-v7 /usr/local/sbin/rpcbind is already running /usr/local/sbin/rpc.statd is already running rpc.mountd: svc_tli_create: could not open connection for udp6 rpc.mountd: svc_tli_create: could not open connection for tcp6 rpc.mountd: svc_tli_create: could not open connection for udp6 rpc.mountd: svc_tli_create: could not open connection for tcp6 rpc.mountd: svc_tli_create: could not open connection for udp6 rpc.mountd: svc_tli_create: could not open connection for tcp6 nfs-server utilities are started. tc@SB-Kitchen:~$ sudo /usr/local/etc/init.d/nfs-server status NFS-server is not running. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115990 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] PiCoreplayer and nfs kernelserver
Ok, one additional extension that needs to be installed to get nfsd: filesystems-$KERNEL with KERNEL=`uname -r` But I am not sure if this is enough to get the NFS server up and running. You have to try it by yourself and ask paul- for further help. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=115990 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] piCorePlayer and automatic screen brightness control.
Hi Norfolk, the state of ADDR (High or Low) defines which address of the I2C bus is used by BH1750: Low: 0V on ADDR: 0x23h High: 3,3V on ADDR: 0x5Ch If you don't set the voltage of ADDR then its state is undefined, i.e. it can be high or low or even toggle between both states. Here is a description how to use the BH1750 with a Raspberry Pi: https://www.raspberrypi-spy.co.uk/2015/03/bh1750fvi-i2c-digital-light-intensity-sensor/ jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=112460 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Would someone else mind checking to see if the main repository is down
Hi Howard, "Checking Internet and repository accessiblity. . . " => every item is green except "piCorePlayer *mirror* repository not accessible (http://picoreplayer.sourceforge.net/tcz_repo/)." And I was able to download bc.tcz from the main repository. ---- jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=116869 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Would someone else mind checking to see if the main repository is down
Can you reach the website of the main repo (https://repo.picoreplayer.org/repo/) from a web browser when you are in your home network (i.e. the same network as your pCP)? If not, then maybe the domain or URL is blacklisted by your provider or router. Just guessing. If yes, then the problem is with your pCP. jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795 View this thread: http://forums.slimdevices.com/showthread.php?t=116869 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix