Author Topic: How to FTP camplus.jpg to WU  (Read 2952 times)

0 Members and 1 Guest are viewing this topic.

Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
How to FTP camplus.jpg to WU
« on: April 13, 2020, 11:45:39 AM »
Hi all,

This is my webcam image with overlays, processed by Meteobridge Weather Camera in the Weather Network tab: -

http://content.meteobridge.com/cam/ff270973649e081b8f41c2288fcfd859/camplus.jpg

And this is the image uploaded from Weather Underground Camera in the same tab: -

http://www.wessexweather.net/iegeek/webcamimage/webcamimage.jpg

How can I upload the camplus.jpg with all the overlays to WU rather than the unprocessed image that Meteobridge uploads? Could a php or shell script be used to be run by a cron job every 5 minutes, which gets the camplus.jpg, renames it to image.jpg and sends it to WU with the required credentials (username,password,webcam.wunderground.com)?

I have managed to run a php script every 5 minutes that saves the camplus.jpg as image.jpg to my server every 5 minutes, but have been stumped from here. Uploading this from my server every 5 minutes with FTP, or automating the whole get/rename/upload process as above, is what I would like to achieve.

FTP seems to be the way to go. Asking WU to retrieve the images from a URL no longer seems to work.

Thanks in advance,
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #1 on: April 13, 2020, 01:42:23 PM »
Personally I ftp my image to my Webserver and from there it is converted and uploaded (ftp) to WU.

image must be less than 150kb and named "image.jpg" from my recollection.

I use Imagik's "convert" to convert the webserver is to the correct size.


Code: [Select]
convert /share/htdocs/weather/skywebcam.jpg -define jpeg:extent=150kb /share/htdocs/weather/image.jpg;
then i use lftp to upload the image to WU.

Code: [Select]
lftp -e 'put /share/htdocs/weather/image.jpg; bye' -u <USERNAME,password  webcam.wunderground.com
« Last Edit: April 13, 2020, 01:47:25 PM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: How to FTP camplus.jpg to WU
« Reply #2 on: April 13, 2020, 02:08:54 PM »
Since you are using a Meteobridge, the simplest thing to do is to just change your WU webcam device to URL type. Then point the WU URL to the Meteobridge.com address. You can then choose the cam.jpg or the camplus.jpg with overlay.
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #3 on: April 13, 2020, 06:47:16 PM »
I’ve been trying this but it never works, as I said in my original post. The webcam remains “offline” - ie WU don’t pull the image from that url. If they did, then this would be the perfect solution!
« Last Edit: April 13, 2020, 06:49:42 PM by WessexWeather »
Cheers,

Simon (WessexWeather)


Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: How to FTP camplus.jpg to WU
« Reply #4 on: April 13, 2020, 08:40:29 PM »
Okay I see that. Missed that line.

Try creating a new URL webcam device?
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #5 on: April 14, 2020, 03:20:44 AM »
Tried that several times too. FTP works, as the uploaded image from Meteobridge is showing on Wundermap, but this is the unprocessed image without overlays. It’s the processed image I want to send to WU.

It’s such a pity Meteobridge has this brilliant feature of processing webcam overlays, and uploading a webcam image to WU, but uploads the unprocessed image. I’m sure there must be a good reason for this limitation.

EDIT 18th April. Even this image has stopped uploading now!
« Last Edit: April 19, 2020, 06:05:27 AM by WessexWeather »
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #6 on: April 14, 2020, 03:27:44 AM »
I upload an image with overlays so it's not that limitation.

Is you image less than 150kb?

Sent from my OnePlus 7 Pro using Tapatalk

Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #7 on: April 14, 2020, 03:39:01 AM »
Ah, that could be why the url fetch isn’t working as it’s 179.4kb...
Cheers,

Simon (WessexWeather)


Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #8 on: April 14, 2020, 06:39:25 AM »
So I wrote a php script that reduces the image size and saves the smaller image with overlays to my server, which ensures it stays under 150mb: -

http://www.wessexweather.net/iegeek/mbwebcamimage/image.jpg

I then created a new url webcam device on WU, using the above url. And lo and behold it’s still not updating, and showing as offline...

EDIT 18th April. I have abandoned this as well, so the above link no longer works.
« Last Edit: April 19, 2020, 06:07:06 AM by WessexWeather »
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #9 on: April 14, 2020, 11:49:51 AM »
Are you FTPing the image to WU or expecting them to grab the file? There are two ways of collection or sending.

The topic title suggests you want to FTP the file to them.  You last post mentions URL so are you now expecting WU to collect the file?

Sent from my OnePlus 7 Pro using Tapatalk
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #10 on: April 14, 2020, 12:01:26 PM »
My first post asked how to FTP the overlaid image to WU from my server. I can successfully do this using my Meteobridge, but the image is without the data overlay.

Galfert then you suggested to try url upload instead, as long as the image size was under 150kb. You also suggested trying a new url upload. So I made the image smaller and created a new url device, as you suggested.

As stated in my original post url upload doesn’t work, even using the smaller image size.

I know there are two ways to do this, and I am now doing both, following your suggestion to create a new url device in addition to my ftp device. The former has the overlays (but doesn’t work) and the latter works but doesn’t have the overlays.

I appreciate your help. but can you please stop confusing things? It is (or was) quite clear.
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #11 on: April 14, 2020, 12:10:22 PM »
So the overlays are done on meteobrige or the webserver?

Most webservers have FTP capabilities. Do you own your own webserver or is it a hosted plan with something like cpanel?

Both should have to option to FTP the overlayed image to wu via terminal/crontab

It's what I do and works well.

Sent from my OnePlus 7 Pro using Tapatalk
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #12 on: April 14, 2020, 12:20:39 PM »
The overlays are processed by Meteobridge and the resultant image retrieved by a url from their server (first link in original post). You can also FTP a webcam image to WU direct from the Meteobridge, which I am doing, but the image uploaded is without the overlays.

However I save the overlaid images to my web server every 5 minutes, so yes if I could then upload these via cron every 5 minutes that would solve my problem. I access my server regularly via cPanel. Can I set up a cron to fTP the image direct to WU or do I need a script to do this, which is executed by a cron job every 5 mins?

What do you do?
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #13 on: April 14, 2020, 12:32:02 PM »
Yes just a simple bash script with one line to FTP the overlayed 150kb image to wu server. Call the script via the cronjob

Sent from my OnePlus 7 Pro using Tapatalk

Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #14 on: April 14, 2020, 12:39:22 PM »
I’m not familiar with bash scripts. Do I just use the code in your original reply above (with my own credentials), place it in a text file, rename it with a .sh extension, and fun it with a cron job every 5 minutes?
Cheers,

Simon (WessexWeather)


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: How to FTP camplus.jpg to WU
« Reply #15 on: April 14, 2020, 01:16:54 PM »
Bash scripts are named .sh and are text based files.

they need to be executable. you need to change the permission on the file with chmod

Something like:

sudo chmod +x /filepath/ftptestfile.sh

Next is the command to ftp within the bash script file.

You will need to see what FTP program is installed on the server

Then use that program with a command line like my example to upload to wu.

You can test the script works but just calling the script in a terminal session on the webserver.

Your web hosting company maybe able to help you too in regards to cronjobs and FTP commands on your webserver




Sent from my OnePlus 7 Pro using Tapatalk
« Last Edit: April 14, 2020, 01:22:32 PM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline docbee

  • Moderator
  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: How to FTP camplus.jpg to WU
« Reply #16 on: April 19, 2020, 06:48:46 PM »
Meteobridge does overlaying data on the Meteobridge server. The Meteobridge device itself can't do that (not enough resources to run ImageMagick) . So the overlayed image is not on the Meteobridge device, but on the Meteobridge server. That is the reason, why Meteobridge cannot upload this image via FTP to WU.
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline WessexWeather

  • Senior Member
  • **
  • Posts: 83
    • WessexWeather
Re: How to FTP camplus.jpg to WU
« Reply #17 on: April 20, 2020, 05:20:01 AM »
Thanks, I know all this, but such a powerful little box could easily pull the overlaid image from its servers to update Weather Underground, surely.
Cheers,

Simon (WessexWeather)


Offline LaFloresta.cat

  • Member
  • *
  • Posts: 5
    • La Floresta - Spain
Re: How to FTP camplus.jpg to WU
« Reply #18 on: August 05, 2022, 06:00:08 PM »
Hi all,

This is my webcam image with overlays, processed by Meteobridge Weather Camera in the Weather Network tab: -

http://content.meteobridge.com/cam/ff270973649e081b8f41c2288fcfd859/camplus.jpg

Sorry for bumping this old thread. Question: How did you the nice overlaying? I guess you configured it at Meteobridge in the cam area....

http://content.meteobridge.com/cam/ff270973649e081b8f41c2288fcfd859/camplus.jpg

Thank you very much for details.

Saludos

Gerald

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1246
  • FN25ie61jw
    • MorewoodW34
Re: How to FTP camplus.jpg to WU
« Reply #19 on: August 05, 2022, 10:01:27 PM »
This is what I have on the Overlay Text box of the camera settings on MB:

-fill black -draw "fill-opacity 0.7 rectangle 0 1040 1920 1080" -pointsize 24 -fill orange -draw "text 5 1069 '[YYYY]-[MM]-[DD] [hh]:[mm]'" -fill white -draw "text 210 1069 'Temp: [th0temp-act.1:--] °C    Humidity: [th0hum-act.0:--] %    Pressure: [thb0seapress-act.1:--] hPa     Wind Chill: [wind0chill-act.1:--] °C    Wind: [wind0avgwind-act=kmh.1:--] km/h    Gust: [wind0wind-max5=kmh.1:--] km/h   Rain today: [rain0total-sumday.1:--] mm'" -fill white -draw "text 1800 1069 'FW4738'"

You can see the result in my signature. Many other configurations must be possible. Background colours and text are all configurable.

The one you are asking about looks much more detailed than mine though.

Offline LaFloresta.cat

  • Member
  • *
  • Posts: 5
    • La Floresta - Spain
Re: How to FTP camplus.jpg to WU
« Reply #20 on: August 05, 2022, 10:24:53 PM »
Hi David,

thank you for your quick reply. Yes - I also tried this configuration as on your webcam with the preconfigured templates included in Meteobridge...and it works.

I really wonder how @WessexWeather did it with the colors etc.

http://content.meteobridge.com/cam/ff270973649e081b8f41c2288fcfd859/camplus.jpg

To complicated for me as I am not really a programmer, LOL....

Saludos from Spain & thank you for your comment!

Gerald

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1246
  • FN25ie61jw
    • MorewoodW34
Re: How to FTP camplus.jpg to WU
« Reply #21 on: August 05, 2022, 11:01:31 PM »
Yeah, I can change colours and what not but those rounded corner blocks are different.

Offline docbee

  • Moderator
  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: How to FTP camplus.jpg to WU
« Reply #22 on: September 08, 2022, 04:51:14 AM »
It’s such a pity Meteobridge has this brilliant feature of processing webcam overlays, and uploading a webcam image to WU, but uploads the unprocessed image. I’m sure there must be a good reason for this limitation.

Yes, there is. Image processing is done on the Meteobridge server as the needed libraries will not fit into the Meteobridge HW limitations. Therefore, Meteobridge does not have the processed image locally. It is provided via an individual URL on the server and can be grabbed from there but it is out of reach for the Meteobridge to upload it via FTP to somewhere.
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline jasonmfarrow

  • Member
  • *
  • Posts: 10
  • JMFweather
    • JMFweather
Re: How to FTP camplus.jpg to WU
« Reply #23 on: October 03, 2022, 08:45:35 AM »
Yeah, I can change colours and what not but those rounded corner blocks are different.

You need code that looks like this
Code: [Select]
-resize 1706x960 -fill green -draw "fill-opacity 0.7 roundrectangle 10 820 210 950 10 10" -fill red -draw "fill-opacity 0.7 roundrectangle 220 820 420 882 10 10" -fill blue -draw "fill-opacity 0.7 roundrectangle 220 888 420 950 10 10" -fill black -draw "fill-opacity 0.7 roundrectangle 430 820 610 950 10 10" -fill black -draw "fill-opacity 0.7 roundrectangle 620 820 840 950 10 10" -fill black -draw "fill-opacity 0.7 roundrectangle 850 820 1050 950 10 10" -fill black -draw "fill-opacity 0.7 roundrectangle 1060 820 1260 950 10 10" -fill blue -draw "fill-opacity 0.7 roundrectangle 1270 820 1470 950 10 10" -fill black -draw "fill-opacity 0.7 roundrectangle 1480 820 1690 950 10 10" -pointsize 24 -fill white -draw "text 20 850 'Temperature'" -fill white -draw "text 440 850 'Humidity'" -fill white -draw "text 630 850 'Pressure'" -fill white -draw "text 860 850 'Wind'" -fill white -draw "text 1070 850 'Gust'" -fill white -draw "text 1280 850 'Rain'" -fill white -draw "text 1490 850 'Air Quality'" -pointsize 38 -fill white -draw "text 20 894 '[th0temp-act.1:--]C'" -fill white -draw "text 440 894 '[th0hum-act.0:--]%'" -fill white -draw "text 630 894 '[thb0seapress-act.1:--] hPa'" -fill white -draw "text 860 894 '[wind0avgwind-act=mph.1:--] mph'" -fill white -draw "text 1070 894 '[wind0wind-dmax=mph.1:--] mph'" -fill white -draw "text 1280 894 '[rain0total-daysum.1:--] mm'" -pointsize 22 -fill white -draw "text 20 930 '[hh]:[mm]'" -fill white -draw "text 440 930 'DewPt [th0dew-act.1:--]C'" -fill white -draw "text 630 930 '[thb0seapress-delta3h=enbarotrend]([thb0seapress-delta3h=barotrend.2:--] hPa)'" -fill white -draw "text 860 930 '[wind0dir-avg10.000:--]°'" -fill white -draw "text 1490 890 'PM2.5: [air1!1pm-act.1:--] µg/m³'" -fill white -draw "text 1490 930 'PM10: [air1!0pm-act.1:--] µg/m³'" -pointsize 28 -fill white -draw "text 230 850 'Max [th0temp-dmax.1:--]C'" -fill white -draw "text 230 918 'Min [th0temp-dmin.1:--]C'" -pointsize 18 -fill white -draw "text 1070 930 '[MMM]: [wind0wind-mmax=mph.1:--]  [YYYY]: [wind0wind-ymax=mph.1:--]'" -fill white -draw "text 1280 930 '[MMM]: [rain0total-monthsum.1:--]  [YYYY]: [rain0total-yearsum.1:--]'" -pointsize 16 -fill white -draw "text 230 875 '[MMM]: [th0temp-mmax.1:--]C  [YYYY]: [th0temp-ymax.1:--]C'" -fill white -draw "text 230 942 '[MMM]: [th0temp-mmin.1:--]C  [YYYY]: [th0temp-ymin.1:--]C'" -fill black -draw "fill-opacity 0.7 roundrectangle 10 750 420 810 10 10" -pointsize 44 -fill white -draw "text 20 795 'JMFweather.uk'"
Which should look like this:
 [ You are not allowed to view attachments ]
JMFweather.uk

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1246
  • FN25ie61jw
    • MorewoodW34
Re: How to FTP camplus.jpg to WU
« Reply #24 on: October 03, 2022, 09:27:14 AM »
That's awesome. Thanks for sharing. I think I will do some upgrades.  \:D/

 

anything