AllskyTeam / allsky

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

FTP issue #21

Closed perulero closed 5 years ago

perulero commented 6 years ago

Hi All

I am sending the images to my ftp server from a pi zero W (works well) ! However I am finding the images are sent through as the same image (image resize.jpg) filename.. I want all my images sent through (full size) with date and time in filename to my ftp server How should I modify the Saving.sh file to do this?

Joe

thomasjacquin commented 6 years ago

Hi Joe,

Here's what I would do around line 34:

[...]
# Save image in images/current directory
DATE=$(date +'%Y%m%d%H%M%S')
cp $IMAGE_TO_USE "images/$CURRENT/$FILENAME-$DATE.$EXTENSION"

echo -e "Saving $FILENAME-$DATE.$EXTENSION\n" >> log.txt

# If upload is true, create a smaller version of the image and upload it
if [ "$UPLOAD_IMG" = true ] ; then
    echo -e "Resizing\n"
    echo -e "Resizing $FULL_FILENAME\n" >> log.txt

    # Create a thumbnail for live view
    # Here's what I use with my ASI224MC
    convert "$IMAGE_TO_USE" -resize 962x720 -gravity East -chop 2x0 "$FILENAME-$DATE.$EXTENSION";
    # Here's what I use with my ASI185MC (larger sensor so I crop the black around the image)
    #convert "$IMAGE_TO_USE" -resize 962x720 -gravity Center -crop 680x720+40+0 +repage "$FILENAME-$DATE.$EXTENSION";

    echo -e "Uploading\n"
    echo -e "Uploading $FILENAME-resize.$EXTENSION\n" >> log.txt
    lftp "$PROTOCOL"://"$USER":"$PASSWORD"@"$HOST":"$IMGDIR" -e "set net:max-retries 1; set net:timeout 20; put $FILENAME-$DATE.$EXTENSION; bye" &
fi

Basically, you create a DATE variable and you replace the word 'resize' by the date so it will be a different timestamp for each upload. I haven't tested it so let me know if it's still not working.

Thomas

perulero commented 6 years ago

Thnx Thomas

Joe

From: Thomas Jacquin [mailto:notifications@github.com] Sent: Saturday, 30 June 2018 1:55 AM To: thomasjacquin/allsky allsky@noreply.github.com Cc: perulero perulero@internode.on.net; Author author@noreply.github.com Subject: Re: [thomasjacquin/allsky] FTP issue (#21)

Hi Joe,

Here's what I would do around line 34:

[...]

Save image in images/current directory

DATE=$(date +'%Y%m%d%H%M%S') cp $IMAGE_TO_USE "images/$CURRENT/$FILENAME-$DATE.$EXTENSION"

echo -e "Saving $FILENAME-$DATE.$EXTENSION\n" >> log.txt

If upload is true, create a smaller version of the image and upload it

if [ "$UPLOAD_IMG" = true ] ; then echo -e "Resizing\n" echo -e "Resizing $FULL_FILENAME\n" >> log.txt

    # Create a thumbnail for live view
    # Here's what I use with my ASI224MC
    convert "$IMAGE_TO_USE" -resize 962x720 -gravity East -chop 2x0 "$FILENAME-$DATE.$EXTENSION";
    # Here's what I use with my ASI185MC (larger sensor so I crop the black around the image)
    #convert "$IMAGE_TO_USE" -resize 962x720 -gravity Center -crop 680x720+40+0 +repage "$FILENAME-$DATE.$EXTENSION";

    echo -e "Uploading\n"
    echo -e "Uploading $FILENAME-resize.$EXTENSION\n" >> log.txt
    lftp "$PROTOCOL"://"$USER":"$PASSWORD"@"$HOST":"$IMGDIR" -e "set net:max-retries 1; set net:timeout 20; put $FILENAME-$DATE.$EXTENSION; bye" &

fi

Basically, you create a DATE variable and you replace the word 'resize' by the date so it will be a different timestamp for each upload. I haven't tested it so let me know if it's still not working.

Thomas

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasjacquin/allsky/issues/21#issuecomment-401397201 , or mute the thread https://github.com/notifications/unsubscribe-auth/AmOzwM-xydOdFozl2VVcW4uU68Q8GY8Wks5uBk3XgaJpZM4U8s3L . https://github.com/notifications/beacon/AmOzwMpUIJvAdGSOR3q2C4H4PUtltYsCks5uBk3XgaJpZM4U8s3L.gif


This email has been checked for viruses by AVG. https://www.avg.com

perulero commented 6 years ago

Hi Thomas

Got this allsky camera working on a pi zero W and even though the cpu runs at 100% all night the system held up very well and did what it was expected to do.. got the images uploading to my ftp.

How do I get the video and star trails to upload as well

Cheers

Joe

From: Thomas Jacquin [mailto:notifications@github.com] Sent: Saturday, 30 June 2018 1:55 AM To: thomasjacquin/allsky allsky@noreply.github.com Cc: perulero perulero@internode.on.net; Author author@noreply.github.com Subject: Re: [thomasjacquin/allsky] FTP issue (#21)

Hi Joe,

Here's what I would do around line 34:

[...]

Save image in images/current directory

DATE=$(date +'%Y%m%d%H%M%S') cp $IMAGE_TO_USE "images/$CURRENT/$FILENAME-$DATE.$EXTENSION"

echo -e "Saving $FILENAME-$DATE.$EXTENSION\n" >> log.txt

If upload is true, create a smaller version of the image and upload it

if [ "$UPLOAD_IMG" = true ] ; then echo -e "Resizing\n" echo -e "Resizing $FULL_FILENAME\n" >> log.txt

    # Create a thumbnail for live view
    # Here's what I use with my ASI224MC
    convert "$IMAGE_TO_USE" -resize 962x720 -gravity East -chop 2x0 "$FILENAME-$DATE.$EXTENSION";
    # Here's what I use with my ASI185MC (larger sensor so I crop the black around the image)
    #convert "$IMAGE_TO_USE" -resize 962x720 -gravity Center -crop 680x720+40+0 +repage "$FILENAME-$DATE.$EXTENSION";

    echo -e "Uploading\n"
    echo -e "Uploading $FILENAME-resize.$EXTENSION\n" >> log.txt
    lftp "$PROTOCOL"://"$USER":"$PASSWORD"@"$HOST":"$IMGDIR" -e "set net:max-retries 1; set net:timeout 20; put $FILENAME-$DATE.$EXTENSION; bye" &

fi

Basically, you create a DATE variable and you replace the word 'resize' by the date so it will be a different timestamp for each upload. I haven't tested it so let me know if it's still not working.

Thomas

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomasjacquin/allsky/issues/21#issuecomment-401397201 , or mute the thread https://github.com/notifications/unsubscribe-auth/AmOzwM-xydOdFozl2VVcW4uU68Q8GY8Wks5uBk3XgaJpZM4U8s3L . https://github.com/notifications/beacon/AmOzwMpUIJvAdGSOR3q2C4H4PUtltYsCks5uBk3XgaJpZM4U8s3L.gif


This email has been checked for viruses by AVG. https://www.avg.com

thomasjacquin commented 6 years ago

You have to enable the upload in config.sh

# Set to true to upload current image to your website
UPLOAD_IMG=true

# Set to true to upload timelapse video to your website at the end of each night
UPLOAD_VIDEO=true

# Set to true to generate a timelapse at the end of the night
TIMELAPSE=true

# Set to true to generate a keogram at the end of the night (image summary of the night)
KEOGRAM=true

# Set to true to upload the keogram after it has been generated
UPLOAD_KEOGRAM=true

# Set to true to generate a startrails image of the night. Will skip brighter images to avoid over-exposure
STARTRAILS=true

# Set to true to upload the startrails after it has been generated
UPLOAD_STARTRAILS=true

Timelapse, keogram and startrails are generated at the end of the night and uploaded if they are set to TRUE.