rigers
Posts: 3
Joined: Wed Apr 03, 2013 2:42 am

Raspberry Pi server access

Wed Apr 03, 2013 2:49 am

Hi,
I have a python script running that sends data to a server via http. When I run the script on my mac it works fine and the data is displayed on the server, but when running it from the Raspberry Pi, it can't access the server. They are connected in the same network so I figure it has to do with the Raspberry Pi.
Is access to the http port denied? How do I check and how do I fix? I searched how to make sure the port is open but didn't get very far. Not quite sure what's going on. Any ideas?

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Raspberry Pi server access

Wed Apr 03, 2013 3:43 am

What OS are you running?

Is everything your Python program depends on available to it in the Raspberry Pi OS you are running?

Can you ping the machine in question from your RPi?

Can you ping anything at all on your LAN or the internet from your RPi?

What is the meaning of life?

rigers
Posts: 3
Joined: Wed Apr 03, 2013 2:42 am

Re: Raspberry Pi server access

Wed Apr 03, 2013 12:31 pm

tonyhughes wrote:What OS are you running?

Is everything your Python program depends on available to it in the Raspberry Pi OS you are running?

Can you ping the machine in question from your RPi?

Can you ping anything at all on your LAN or the internet from your RPi?

What is the meaning of life?
It's the running the standard Raspberry Pi OS (Raspbian).
Yes, I get no dependency errors in fact I get no errors, just the exceptions that I can't connect.
Yes.
Yes.
42

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Raspberry Pi server access

Wed Apr 03, 2013 6:52 pm

That's the basics covered I guess...

Same version of Python between machines?

Have you tried calling your program with python3 instead of python?

I'm not a Python person, so I'm desperately hoping for of the other guys will jump in here soon...

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Raspberry Pi server access

Thu Apr 04, 2013 2:36 pm

To check HTTP port access try at the command prompt:

Code: Select all

wget http://www.raspberrypi.org/
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

rigers
Posts: 3
Joined: Wed Apr 03, 2013 2:42 am

Re: Raspberry Pi server access

Fri Apr 05, 2013 1:56 pm

Did that and this is what I get:

Code: Select all

--2013-04-05 09:50:31--  http://www.raspberrypi.org/
Resolving http://www.raspberrypi.org (http://www.raspberrypi.org)... 93.93.128.230, 93.93.130.39, 93.93.130.214, ...
Connecting to http://www.raspberrypi.org (http://www.raspberrypi.org)|93.93.128.230|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

    [  <=>                                       ] 63,739       292K/s   in 0.2s    

2013-04-05 09:50:32 (292 KB/s) - `index.html' saved [63739]
And I have an index.html file saved in my local directory. So I'm guessing it's not a port issue.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Raspberry Pi server access

Fri Apr 05, 2013 2:52 pm

Yep, seems there is no issue connecting through HTTP. Something else...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

timhoffman
Posts: 85
Joined: Sat Nov 05, 2011 11:31 pm

Re: Raspberry Pi server access

Sun Apr 07, 2013 9:57 am

Given what has gone before, you have connectivity and you can contact the http server.
So now you need to look at your code. How are you connecting to the mac with your raspi,
are you using requests library or httplib for instance.

Maybe show us you code .

T

Return to “Python”