Jump to content

Search the Community

Showing results for tags 'cc3000'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I forked a project from M. Schwartz in Adafruit about wifi controlled robot, and he uses local web server to access it. Now I wanted to the host online the server files. My only problem is this part of his php file <?php // Load JSON state $string = file_get_contents("robot_state.json"); $json_a= json_decode($string,true); // Handle GET request $json_a['speed'] = $_GET["speed"]; $json_a['direction_left'] = $_GET["directionLeft"]; $json_a['direction_right'] = $_GET["directionRight"]; $json_a['reverse'] = $_GET["reverse"]; // Save JSON file $fp = fopen('robot_state.json', 'w'); fwrite($fp, json_encode($json_a)); fclose($fp); // Create a TCP/IP socket & connect to the server $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $result = socket_connect($socket, "192.168.1.6", "8888"); // Request $in = "HEAD / HTTP/1.1\r\n"; $in .= "Content-Type: text/html\r\n"; $in .= $json_a['speed'] . "," . $json_a['direction_left'] . "," . $json_a['direction_right'] . ",". $json_a['reverse'] . ",\r\n\r\n"; $out = ''; // Send request socket_write($socket, $in, strlen($in)); // Read answer while ($out = socket_read($socket, 4096)) { echo $out; } // Close socket socket_close($socket); ?> notice Line 19: socket_connect($socket, "192.168.1.6", "8888"); This is the part where it communicates to the wifi shield of the arduino. I know this simply wouldn't work now since this is only a private address and the files are now hosted in the internet. Can you guys teach me how to implement because I know this part of code will be quite different.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.