GeekMagicClock / smalltv-ultra

Ultra version firmware of GeekMagic smalltv
112 stars 9 forks source link

Gif not loading after changing theme #46

Open Pucur opened 2 months ago

Pucur commented 2 months ago

Hey,

I made a script which changing the clock themes different period with curl, but whenever it’s rotate the themes and then it changes back to “Weather Clock Today” the gif is disappearing.

I think it’s some issues in the code maybe causes this issue, can you check the issues is only happening on my thing?

GeekMagicClock commented 2 months ago

Yes, this will happen if there's no enough ram space, and will recover when ram is available.

albertrebel commented 2 months ago

Same here. I change the GIF in the Weather section, and then I click on the "Clear" button but the original astronaut GIF doesnt come back. Could you share the Astronaut Gif, please?

raikyo92 commented 2 months ago

Yes, this will happen if there's no enough ram space, and will recover when ram is available.

My RAM still has more than 700kb free and it still happens

GeekMagicClock commented 2 months ago

Same here. I change the GIF in the Weather section, and then I click on the "Clear" button but the original astronaut GIF doesnt come back. Could you share the Astronaut Gif, please?

Check it here.

GeekMagicClock commented 2 months ago

Yes, this will happen if there's no enough ram space, and will recover when ram is available.

My RAM still has more than 700kb free and it still happens

Oh, that's ROM space on the web, RAM availble only less than 50KB. The gif will recover to display when there's enough free ram.

pmout commented 2 months ago

Hey,

I made a script which changing the clock themes different period with curl, but whenever it’s rotate the themes and then it changes back to “Weather Clock Today” the gif is disappearing.

I think it’s some issues in the code maybe causes this issue, can you check the issues is only happening on my thing?

How you do that? How do you send the gif with curl? Thanks

albertrebel commented 2 months ago

Hey, I made a script which changing the clock themes different period with curl, but whenever it’s rotate the themes and then it changes back to “Weather Clock Today” the gif is disappearing. I think it’s some issues in the code maybe causes this issue, can you check the issues is only happening on my thing?

How you do that? How do you send the gif with curl? Thanks

https://github.com/GeekMagicClock/gif/blob/main/gif%2080x80px/spaceman.gif

Pucur commented 2 months ago

Hey, I made a script which changing the clock themes different period with curl, but whenever it’s rotate the themes and then it changes back to “Weather Clock Today” the gif is disappearing. I think it’s some issues in the code maybe causes this issue, can you check the issues is only happening on my thing?

How you do that? How do you send the gif with curl? Thanks

Change gif randomly:


#!/bin/bash

# Check if the input file exists
if [ ! -f "links.txt" ]; then
    echo "Error: File 'links.txt' not found!"
    exit 1
fi

# Shuffle the URLs in the input file
#shuffled_urls=$(shuf "links.txt")

# Iterate through each shuffled URL and perform HTTP request using curl
while :; do
shuffled_urls=$(shuf "links.txt")
while IFS= read -r url; do
    echo "Sending HTTP request to: $url"
    curl -sS "$url"  # -sS to silence curl's output except for errors
    echo "---------------------------------------------"
    sleep 3600
done <<< "$shuffled_urls"
done
echo "All HTTP requests completed."

In links.txt file:

http://192.168.4.18/set?gif=%2Fgif%2F80x80-eyes.gif
http://192.168.4.18/set?gif=%2Fgif%2F80x80-gus.gif
http://192.168.4.18/set?gif=%2Fgif%2F80x80-booms.gif
http://192.168.4.18/set?gif=%2Fgif%2F80x80-heart.gif
http://192.168.4.18/set?gif=%2Fgif%2F80x80-planet.gif
http://192.168.4.18/set?gif=%2Fgif%2Fezgif-5-5bbe8aed2b.gif

thats the url for changing it, you can check it also in developer mode in the browser.

Change theme in different times:

while :; do
curl http://192.168.4.18/set?theme=1
sleep 60
curl http://192.168.4.18/set?theme=2
sleep 15
#curl http://192.168.4.18/set?theme=3
#sleep 30
done