I am trying to develop a script that runs on my server that receives and processes data uploaded from a GPRS device. The GPRS device allows me to set the IP address and port number.
First of all, I just want the script to acknowledge that the GPRS device has connected to it.
At the moment, on my local machine, I have a python script running, and everytime I ping my machine at the specific port, the script logs the connection attempt:
I run this script through Python IDLE and then ping 10.150.22.113 (my IP) at port 5000 from a different machine on the network, and it works.Code:#!/usr/bin/env python import socket mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysocket.bind(("10.150.22.113",5000)) mysocket.listen(5) while 1: newsocket, address = mysocket.accept() f = open('data.txt', 'a') s1 = str(newsocket) f.write(s1) s2 = str(' ') f.write(s2) s3 = str(address) f.write(s3) s4 = str('\n') f.write(s4) f.close() newsocket.close()
Now, I need to have the script running on a static/public IP address so my GPRS device can address it.
Does anybody have any suggestions as to how I could get this running on my x10 site?
I don't necessarily have to use Python, if anybody has suggestions using a different language.
PS.: I checked the acceptable usage policy to see if this is ok, and I think it is...


2Likes
LinkBack URL
About LinkBacks
Reply With Quote

