I'm building Tweet-A-Watt and it's coming along pretty well. I've got watcher displaying the data in the Command Prompt window. But I'm getting an error when wattcher.py tries to post the data to Twitter. I modified wattcher.py with my username and password, but I get this error when wattcher tries to post:
twittertime!
Couldn't connect, check network, username and password!
I doubled checked my username and password were correct. I do have an Astaro firewall which uses HTTP Proxy and authentication to let users surf the web. To see if the firewall was the cause I temporarily disabled the HTTP proxy and even created a temporary packet filter rule to let everything through from my PC, but it didn't make a difference with Tweet-A-Watt. I never used Python before. How can I go about debugging this?
--Scott
Twitter Connection Error with Tweet-A-Watt
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- scott216
- Posts: 163
- Joined: Sun Apr 12, 2009 11:08 am
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Twitter Connection Error with Tweet-A-Watt
hmm, you could see if in the twitter python code you can make it print out a debug statement. we've never seen this problem before...
can you telnet to twitter.com port 80 from your computer?
maybe twitter was down?
can you telnet to twitter.com port 80 from your computer?
maybe twitter was down?
- scott216
- Posts: 163
- Joined: Sun Apr 12, 2009 11:08 am
Re: Twitter Connection Error with Tweet-A-Watt
How do I make it print out the debug code?
Twitter was up at the time. I had just made a regular post to insure I had my username and password correct.
I'll try the telnet to twitter. Do you know what ports tweet-a-watt uses when connecting to twitter?
--Scott
Twitter was up at the time. I had just made a regular post to insure I had my username and password correct.
I'll try the telnet to twitter. Do you know what ports tweet-a-watt uses when connecting to twitter?
--Scott
- scott216
- Posts: 163
- Joined: Sun Apr 12, 2009 11:08 am
Re: Twitter Connection Error with Tweet-A-Watt
To telnet twitter, do I just type "telnet www.twitter.com 80" from the DOS command prompt and if I don't get an error it's okay. I tried it just now from work (no firewall, just a wifi router) and it seemed to work (i.e. no error). I'll try it from home later and see what happens.
If tweet-a-watt only uses port 80 I don't see why my firewall would cause a problem.
BTW, I am running the python script this on Windows 7.
--Scott
If tweet-a-watt only uses port 80 I don't see why my firewall would cause a problem.
BTW, I am running the python script this on Windows 7.
--Scott
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Twitter Connection Error with Tweet-A-Watt
ok try at home. after you telnet in to port 80
type in "GET /" and hit return
if you get a bunch of HTML then at least that works
type in "GET /" and hit return
if you get a bunch of HTML then at least that works
- scott216
- Posts: 163
- Joined: Sun Apr 12, 2009 11:08 am
Re: Twitter Connection Error with Tweet-A-Watt
It's definitely my firewall. I got it working when I opened up the firewall. Now I need to figure out how to create a rule in the firewall for just twitter.
--Scott
--Scott
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Twitter Connection Error with Tweet-A-Watt
Good you figured it out! Pesky firewalls Telnet is great for debugging internet connections
Please be positive and constructive with your questions and comments.