+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
Like Tree2Likes

Thread: Receiving uploaded GPRS data through a socket (Python)

  1. #11
    raven47's Avatar
    raven47 is offline x10Hosting Member raven47 is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    3

    Re: Receiving uploaded GPRS data through a socket (Python)

    Hi gpstrack,

    I want to do something similar. I used a php script I found on the web to listen on a predifined port to anything coming in. But I can't get my php script running at my localhost.

    The php script is:
    <?php
    // Server IP address
    $address = "127.0.0.1";
    // Port to listen
    $port = 1000;
    set_include_path("C:\Program Files\EasyPHP-5.3.2\php\ext");
    $mysock = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not bind to address\n") ;
    socket_bind($mysock, $address, $port) or die('Could not bind to address');
    socket_listen($mysock, 5);
    $client = socket_accept($mysock);

    read 1024 bytes from client
    $input = socket_read($client, 1024);

    write received data to the file
    writeToFile('abc.txt', $input);

    socket_close($client);

    socket_close($mysock);
    ?>

    <?
    /**
    * write string to file
    */
    function writeToFile($strFilename, $strText)
    {
    if($fp = @fopen($strFilename,"w "))
    {
    $contents = fwrite($fp, $strText);
    fclose($fp);
    return true;
    }else{
    return false;
    }

    }
    ?>

    what is wrong with this script?

    Thanks in advance, raven47

  2. #12
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Receiving uploaded GPRS data through a socket (Python)

    Don't threadjack and don't revive old threads without very good reason. Start your own thread.

    Use [php], [html] or [code] tags (as appropriate) to separate & format code.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #13
    raven47's Avatar
    raven47 is offline x10Hosting Member raven47 is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    3

    Re: Receiving uploaded GPRS data through a socket (Python)

    Hi Gpstrack,
    I am really paralised without knowing what to do and how to do the following:

    The project consists on a R/C airplane model with a celular Telit module (i.e GM862/3) that has to send every 3 to 4 sec some data (position, altitude, speed, course, bearing etc etc). The Telit module will have a Python script that will do that job.

    Here is the part where I am just paralised!
    - Build a Website to receive online gprs data from a celular Telit module GM862/3 mounted on a R/C airplane.
    - The Telit module has a python script that sends gprs data to a Website.
    - The Website has to display the airplane's position on a google map.
    - The Website has to save all gprs data to a database.
    I read your post and I think you may give me a fresh start to do this project.
    Thanks in advance

  4. #14
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Receiving uploaded GPRS data through a socket (Python)

    Raven47, try reading what Misson said...good, now do it again. This thread was long dead the first time you posted, now your digging it out of its grave again. If you have a genuine problem, start your own thread.

    For the record: Gpstrack hasn't logged in since 2009, so there is an overwhelming probability that you are not going to get any answer. Continuing to post to a dead thread won't change that.

  5. #15
    linhchi9220 is offline x10Hosting Member linhchi9220 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    2

    Re: Receiving uploaded GPRS data through a socket (Python)

    help dns ip x10
    http://skinmobi.net

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Sort Data
    By secretply in forum Programming Help
    Replies: 2
    Last Post: 06-15-2009, 12:25 PM
  2. Replies: 6
    Last Post: 08-25-2008, 09:43 AM
  3. HTML help...
    By anuj_web in forum Programming Help
    Replies: 5
    Last Post: 05-08-2008, 11:22 AM
  4. uploaded file contains binary data
    By chongkolai in forum Free Hosting
    Replies: 2
    Last Post: 09-24-2007, 11:42 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers