If both Raspberry Pi and the PC are inside the same Network then you can send data to the PC using a web server,
Start by setting up a simple server based on web.py, which is installed via
apt-get
sudo apt-get install python-webpy
Now create a directory to put the code in and create a simple test program
mkdir webpy
cd webpy
nano server.py
Now let's write a test code.
write this inside server.py
(make sure you are in a root mode)
#!/usr/bin/python
import web
urls = (
'/', 'index'
)
class index:
def GET(self):
return "Hello, world!"
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
Save it and then set it as executable with
chmod +x server.py
and then run the code
./server.py
you will see something like this showing the server is waiting for a request (pressing Ctrl+C will stop the server)
http://0.0.0.0:8080/
Now from your PC, point your browser at http://ip-address-of-your-pi:8080
and it will show a web page with the content of Hello, world!
.
If everything works as intended, you are all good to Go.
Replace the content of server.py
with the data you need to communicate from Raspberry Pi to the PC.
From your pc, you can read the data using urllib
library of Python (the code below is for python 2.x)
import urllib
link = "http://192.168.1.65:8080" # Change this address to your settings
f = urllib.urlopen(link)
myfile = f.read()
date = myfile.split(" ")
You now have the data from your Raspberry Pi into your PC.