AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.19k stars 180 forks source link

No live view #1248

Closed WirthmU closed 2 years ago

WirthmU commented 2 years ago

I did do a re-install with the latest version here on GitHub yesterday.

There is no live view on the Website although the settings in config.sh did not change:

########## Images
# Set to "true" to upload the current image to your website.
IMG_UPLOAD="yes"
# Remove corrupt images before generating keograms, startrails, and timelapse videos.
# This only adds a few seconds per image as it's being processed.
REMOVE_BAD_IMAGES="true"

# If REMOVE_BAD_IMAGES is "true", images whose mean brightness is
# less than THRESHOLD_LOW or greater than THRESHOLD_HIGH percent (max: 100) will be removed.
# Set to 0 to disable the brightness checks.
REMOVE_BAD_IMAGES_THRESHOLD_LOW=0
REMOVE_BAD_IMAGES_THRESHOLD_HIGH=1

Allsky service is running:

pi@allsky:~/allsky/tmp $ sudo service allsky status
● allsky.service - All Sky Camera
     Loaded: loaded (/etc/systemd/system/allsky.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-05-30 11:17:34 CEST; 12min ago
   Main PID: 2962 (allsky.sh)
      Tasks: 2 (limit: 4164)
        CPU: 2min 2.897s
     CGroup: /system.slice/allsky.service
             ├─2962 /bin/bash /home/pi/allsky/allsky.sh
             └─3061 /home/pi/allsky/capture_RPiHQ -cmd libcamera -debuglevel 1 -tty 0 -alwaysshowadvanced 1 -angle -9 -awb 0 -camera RPiHQ -computer Raspberry Pi 4 Model B Rev 1.5 -da>

May 30 11:27:38 allsky allsky.sh[3061]:   > Saving DAY image 'image-resize-20220530112735.jpg'
May 30 11:27:38 allsky allsky.sh[3061]: Sleeping 60.0 seconds...
May 30 11:28:38 allsky allsky.sh[3061]: STARTING EXPOSURE at: 2022-05-30 11:28:38   @ 1 us
May 30 11:28:38 allsky allsky.sh[3061]:   > Capture command: libcamera-still --output '/home/pi/allsky/tmp/image-resize-20220530112838.jpg' --timeout 1 --nopreview --width 4056 --heig>
May 30 11:28:41 allsky allsky.sh[3061]:   > Saving DAY image 'image-resize-20220530112838.jpg'
May 30 11:28:41 allsky allsky.sh[3061]: Sleeping 60.0 seconds...
May 30 11:29:41 allsky allsky.sh[3061]: STARTING EXPOSURE at: 2022-05-30 11:29:41   @ 1 us
May 30 11:29:41 allsky allsky.sh[3061]:   > Capture command: libcamera-still --output '/home/pi/allsky/tmp/image-resize-20220530112941.jpg' --timeout 1 --nopreview --width 4056 --heig>
May 30 11:29:43 allsky allsky.sh[3061]:   > Saving DAY image 'image-resize-20220530112941.jpg'
May 30 11:29:43 allsky allsky.sh[3061]: Sleeping 60.0 seconds...

I have a second AllSky camera running with a prevoius version of the software with exactly the same config.sh and ftp-settings.sh which is working perfectly fine.

EricClaeys commented 2 years ago

@WirthmU When on the website, press F12, then >>, then Network, then refresh the browser and see what image it's trying to read. It will probably be in red. I suspect it's related to the "image-resize-YYYYMMDDHHMMSS.jpg" in the log file instead of "image-YYYYMMDDHHMMSS.jpg". Is your Image Name in the WebUI set to image-resize.jpg ? If so, I suggest setting it to image.jpg.

WirthmU commented 2 years ago

The Image Name in the WebUI ist set to image-resize.jpg. This used to work on this camera and it still does work on the second AllSky which has not been updated to the latest version. Even if I change the name to image.jpg it still does not work. Is there a way to force upload of the current image?

EricClaeys commented 2 years ago

The Image Name in the WebUI needs to match what's in the imageName setting in the Website's config.js file. See if yours does. If it does match, then please do the F12 thing per my last post.

Also, set your Debug Level in the WebUI to 4 and restart Allsky, then attach the log file. That will tell me if it's trying to upload the current image.

WirthmU commented 2 years ago

Debug Level is set to 4. All places for the file name are set to image.jpg. The log-file looks like this:

May 30 17:12:41 allsky allsky.sh[8178]: STARTING EXPOSURE at: 2022-05-30 17:12:41   @ 124 us
May 30 17:12:41 allsky allsky.sh[8178]:  > Kill command: pgrep 'libcamera-still' | xargs kill -9 2> /dev/null
May 30 17:12:41 allsky allsky.sh[8178]:   > Capture command: libcamera-still --output '/home/pi/allsky/tmp/image-20220530171241.jpg' --timeout 1 --nopreview --width 4056 --height 3040 --shutter 124 --gain 1 --exif IFD0.Artist=li_124_1 --awbgains 2.8,2 --rotation 180 --saturation 0 --brightness 1 --quality 100 > /tmp/capture_RPiHQ_debug.txt 2>&1
May 30 17:12:43 allsky allsky.sh[8178]:   > exposure: 0.000 sec, mean: 0.475, mean_value: 0.500, diff: 0.025
May 30 17:12:43 allsky allsky.sh[8178]:   > MeanCnt: 11, historySize: 3
May 30 17:12:43 allsky allsky.sh[8178]:   > i=1: mean_history[0]=0.527 exp_history[0]=-461
May 30 17:12:43 allsky allsky.sh[8178]:   > i=2: mean_history[1]=0.498 exp_history[1]=-467
May 30 17:12:43 allsky allsky.sh[8178]:   > i=3: mean_history[2]=0.475 exp_history[2]=-467
May 30 17:12:43 allsky allsky.sh[8178]:   > mean_forecast: 0.451, values: 9, mean_diff: 0.022
May 30 17:12:43 allsky allsky.sh[8178]:   > ExposureChange: 6 (3)
May 30 17:12:43 allsky allsky.sh[8178]:   > Mean: 0.478, diff: 0.022, Exposure level:-461 (6), Exposure time:139 us, analoggain:1.00
May 30 17:12:43 allsky allsky.sh[8178]:   > Got exposure: 500 us, shutter: 139 us, quickstart: 0, mean=0.475
May 30 17:12:43 allsky allsky.sh[8178]:   > Saving DAY image 'image-20220530171241.jpg'
May 30 17:12:43 allsky allsky.sh[8178]: Sleeping 60.0 seconds...
May 30 17:12:43 allsky allsky.sh[8572]: DEBUG: saveImage.sh DAY /home/pi/allsky/tmp/image-20220530171241.jpg EXPOSURE_US=124 BRIGHTNESS=100 MEAN=0.474720 AUTOEXPOSURE=1 AUTOGAIN=0 AUTOWB=0 WBR=2.800000 WBB=2 GAIN=0 GAINDB=1.00 BIN=1 FLIP=0 BIT_DEPTH=8
May 30 17:12:44 allsky allsky.sh[8572]: saveImage.sh: Resizing '/home/pi/allsky/tmp/image-20220530171241.jpg' to 1014x760
May 30 17:13:43 allsky allsky.sh[8178]: STARTING EXPOSURE at: 2022-05-30 17:13:43   @ 139 us
May 30 17:13:43 allsky allsky.sh[8178]:  > Kill command: pgrep 'libcamera-still' | xargs kill -9 2> /dev/null
May 30 17:13:43 allsky allsky.sh[8178]:   > Capture command: libcamera-still --output '/home/pi/allsky/tmp/image-20220530171343.jpg' --timeout 1 --nopreview --width 4056 --height 3040 --shutter 139 --gain 1 --exif IFD0.Artist=li_139_1 --awbgains 2.8,2 --rotation 180 --saturation 0 --brightness 1 --quality 100 > /tmp/capture_RPiHQ_debug.txt 2>&1
May 30 17:13:46 allsky allsky.sh[8178]:   > exposure: 0.000 sec, mean: 0.469, mean_value: 0.500, diff: 0.031
May 30 17:13:46 allsky allsky.sh[8178]:   > MeanCnt: 12, historySize: 3
May 30 17:13:46 allsky allsky.sh[8178]:   > i=1: mean_history[1]=0.498 exp_history[1]=-467
May 30 17:13:46 allsky allsky.sh[8178]:   > i=2: mean_history[2]=0.475 exp_history[2]=-467
May 30 17:13:46 allsky allsky.sh[8178]:   > i=3: mean_history[0]=0.469 exp_history[0]=-461
May 30 17:13:46 allsky allsky.sh[8178]:   > mean_forecast: 0.464, values: 9, mean_diff: 0.028
May 30 17:13:46 allsky allsky.sh[8178]:   > ExposureChange: 7 (1)
May 30 17:13:46 allsky allsky.sh[8178]:   > Mean: 0.472, diff: 0.028, Exposure level:-454 (7), Exposure time:159 us, analoggain:1.00
May 30 17:13:46 allsky allsky.sh[8178]:   > Got exposure: 500 us, shutter: 159 us, quickstart: 0, mean=0.469
May 30 17:13:46 allsky allsky.sh[8178]:   > Saving DAY image 'image-20220530171343.jpg'
May 30 17:13:46 allsky allsky.sh[8178]: Sleeping 60.0 seconds...
May 30 17:13:46 allsky allsky.sh[8613]: DEBUG: saveImage.sh DAY /home/pi/allsky/tmp/image-20220530171343.jpg EXPOSURE_US=139 BRIGHTNESS=100 MEAN=0.469374 AUTOEXPOSURE=1 AUTOGAIN=0 AUTOWB=0 WBR=2.800000 WBB=2 GAIN=0 GAINDB=1.00 BIN=1 FLIP=0 BIT_DEPTH=8
May 30 17:13:47 allsky allsky.sh[8613]: saveImage.sh: Resizing '/home/pi/allsky/tmp/image-20220530171343.jpg' to 1014x760

No signs of any upload activity.

EricClaeys commented 2 years ago

@WirthmU Change IMG_UPLOAD="yes" to IMG_UPLOAD="true".

WirthmU commented 2 years ago

What a silly typing mistake of me. Please excuse the trouble and thank you for the continous support @EricClaeys !I

t seems to try to upload - but there is a permission problem on the NAS. I have set the folders to 777 but still no success:

May 31 10:38:38 allsky allsky.sh[43665]: saveImage.sh: Resizing '/home/pi/allsky/tmp/image-20220531103835.jpg' to 1014x760
May 31 10:38:39 allsky allsky.sh[43678]: upload.sh: FTP '/home/pi/allsky/tmp/image-20220531103835.jpg' to '/web/Bern/allsky_2/image.jpg', TEMP_NAME=SaveImage-12423
May 31 10:38:39 allsky allsky.sh[43682]: /home/pi/allsky/scripts/upload.sh: line 177: /home/pi/allsky/tmp/lftp_cmds.txt: Permission denied
May 31 10:38:45 allsky allsky.sh[43678]: upload.sh: FTP '/home/pi/allsky/tmp/image-20220531103835.jpg' finished

If I do it by hand it works:

pi@allsky:~/allsky/tmp $ sudo bash /home/pi/allsky/scripts/upload.sh /home/pi/allsky/tmp/image.jpg /web/Bern/allsky_2/ image.jpg
upload.sh: FTP '/home/pi/allsky/tmp/image.jpg' to '/web/Bern/allsky_2/image.jpg', TEMP_NAME=x-368
EricClaeys commented 2 years ago

@WirthmU No problem. It gave me the opportunity to add another check to the "installation wizard" I want to create that checks everything. It will now also check that all true/false variables are either "true" or "false". I'm sure you aren't the first one to do this.

Try doing it by hand but don't use "sudo". Allsky runs as "pi", not "root". The WebUI and Website run as "www-data", but upload.sh is run from Allsky. First, though, I'd do this:

ls -ld /home/pi/allsky/tmp

That's the directory it's trying to create the lftp_cmds.txt file in when it gets permission denied. Is your tmp directory on the NAS, or on your Pi? If on the NAS, it would probably be a LOT easier just to make it a memory filesystem - it'll be faster too. There's a WiKi page for that.

EricClaeys commented 2 years ago

@WirthmU Any update?

WirthmU commented 2 years ago

It's working now!