OpenWRT wget HTTP 400 error

71 views
Skip to first unread message

James Nichols

unread,
Sep 15, 2013, 10:44:45 AM9/15/13
to fo...@googlegroups.com
I had problem that I fixed despite my minimal programming knowledge!

The wunderground wget was giving 400 errors. I found the cause was spaces not being converted to %20 with OpenWRT's wget, while Ubuntu 12.04 wget happily converts spaces automatically.

highlighted below, I added a search&replace for spaces to %20


# Upload data to Wunderground

ID=$1
PASSWORD=$2
WGET="$WGET?action=updateraw&ID=$ID&PASSWORD=$PASSWORD&softwaretype=fowsr&"

while read line
do
  WGET2="$WGET`echo ${line// /%20}`"
  echo $WGET2
  wget -O /dev/null "$WGET2"
done < $WUGLOG

# Upload data to PWS Weather

Josch

unread,
Sep 16, 2013, 3:40:06 PM9/16/13
to fo...@googlegroups.com
Does  your modification also work on ubuntu? If yes, I'll put it into the script.

Josch

James Nichols

unread,
Sep 16, 2013, 11:32:51 PM9/16/13
to fo...@googlegroups.com
I'm not sure.  I think it only depends on bash which seems to be fairly universal.
OpenWRT appears to use something similar but different called "-ash"?


James

Josch

unread,
Sep 17, 2013, 9:29:03 AM9/17/13
to fo...@googlegroups.com
My hope was that you could have tested it because I have no wunderground account.

Josch

Josch

unread,
Oct 5, 2013, 6:07:16 PM10/5/13
to fo...@googlegroups.com
Version 2.0.131005 should work without the modifikation of the script.
Reply all
Reply to author
Forward
0 new messages