Author Topic: Help - Webcam, wunderground, raspberry pi camera  (Read 685 times)

0 Members and 1 Guest are viewing this topic.

Offline ToddJ

  • Member
  • *
  • Posts: 2
Help - Webcam, wunderground, raspberry pi camera
« on: November 11, 2017, 04:26:50 PM »
Hi everyone,
I was wondering if someone could give me some tips/help to see if I can fix a problem.  I am using a raspberry pi camera to upload webcam pictures to the wunderground ftp site.  I did the programming in Python myself (I'm a beginner), and everything was working as it should for the first 2 days.  Now, it seems to upload the first photo and then I receive error messages and the program stops running.  I have included my code, along with an error message.  I was wondering if it is a wunderground problem, since everything worked fine for the first two days, not it is not working.

Thanks,

Todd

The code:
from picamera import PiCamera,Color
from time import sleep
from datetime import datetime
# set counter to 0
counter = 0
# define the camera
camera = PiCamera()
# set the camera parameters
# resolution to be set such that picture is no more than 150kb as this is required by weatherunderground.com
camera.resolution = (492,328)
camera.framerate = 15
camera.brightness = 50
camera.contrast = 0
camera.vflip = False
camera.hflip = False
import ftplib

# turn on the camera and take the picture and capture the current time
camera.start_preview()
# set counter up to work for about 2 months - 18,000 counts
while counter < 18000:
   
    camera.annotate_text_size = 18
    camera.annotate_background = Color('blue')
    camera.annotate_foreground = Color('yellow')
    camera.annotate_text = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    camera.capture('/home/pi/Desktop/image.jpg')
    sleep(5)
    # upload the picture to the www.wunderground.com ftp site
    session = ftplib.FTP('webcam.wunderground.com','cameraname','password')
    file = open('/home/pi/Desktop/image.jpg','rb') # file to send
    session.storbinary('STOR image.jpg', file)     # send the file
    file.close()                                   # close file and FTP
    session.quit()
    # Pause for 5 minutes (300 s) before taking the next photo   
    sleep(300)
    counter = counter + 1
   
camera.stop_preview()


The error message:

======================== RESTART: /home/pi/camera4.py ========================
Traceback (most recent call last):
  File "/home/pi/camera4.py", line 31, in <module>
    session = ftplib.FTP('webcam.wunderground.com','TJinPGCAM1','yd401$icom')
  File "/usr/lib/python3.5/ftplib.py", line 118, in __init__
    self.connect(host)
  File "/usr/lib/python3.5/ftplib.py", line 156, in connect
    self.welcome = self.getresp()
  File "/usr/lib/python3.5/ftplib.py", line 243, in getresp
    raise error_temp(resp)
ftplib.error_temp: 421 50 users (the maximum) are already logged in, sorry


Offline bchwdlks

  • Contributor
  • ***
  • Posts: 120
Re: Help - Webcam, wunderground, raspberry pi camera
« Reply #1 on: November 11, 2017, 04:57:49 PM »
Don't spend a lot of effort debugging this - WU webcam photos are probably being discontinued by the end of the year. You probably should look for a different method to display webcam photos.  :-(

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 465
Re: Help - Webcam, wunderground, raspberry pi camera
« Reply #2 on: November 11, 2017, 05:04:34 PM »
Quote
Don't spend a lot of effort debugging this
Agree, I don't think it is your program. Just have a look how many posts there are the last day or two about WU and camera uploads that does not work.

WS-1200-IP | ObserverIP | Meteobridge
WU, PWSWeather - KTXCONRO61
CWOP - FW0717
Blitzortung 2100

Offline ToddJ

  • Member
  • *
  • Posts: 2
Re: Help - Webcam, wunderground, raspberry pi camera
« Reply #3 on: November 12, 2017, 12:50:15 PM »
Thanks....I didn't think it was the program, because it was initially working. 
Any word why Wunderground may be quiting webcams by the end of the year?
Are there any other weather services that are good to share data and weather webcam photos with?

Thanks,
Todd

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 465
Re: Help - Webcam, wunderground, raspberry pi camera
« Reply #4 on: November 12, 2017, 01:16:55 PM »
Quote
Any word why Wunderground may be quiting webcams by the end of the year?
Are there any other weather services that are good to share data and weather webcam photos with?

Check these posts.

http://www.wxforum.net/index.php?PHPSESSID=1a892042fee1b3a6bad5c32d33b88bbf&topic=33105.msg336186;topicseen#msg336186

http://www.wxforum.net/index.php?PHPSESSID=1a892042fee1b3a6bad5c32d33b88bbf&topic=33174.msg336194;topicseen#msg336194
WS-1200-IP | ObserverIP | Meteobridge
WU, PWSWeather - KTXCONRO61
CWOP - FW0717
Blitzortung 2100