hi guys, i have some troubles with a PHP page, this page should send data to arduino.
i try to use a php socket but the connection have failed (i use a classic socket for this but if there's a specific socket for this i don't know), how can i do this action with php? i use get/post?
the date are sent from php to arduino and i don't know how to do this, and i don't find examples for my problem
sorry for my terrible english
i have some troubles with a PHP page
But, I'm not going to show you the script, or the Arduino code that the script is trying to communicate with, nor am I going to explain what "the troubles" are.
Doesn't seem likely that we can help you, then.
it's true, then i try to explain in a better way what is my problem
i have a php page and i have to send data to arduino, the php is the client and the arduino (with ethernet shiled) is the server
i realize the server like a classic arduino server
#include <Ethernet.h>
#include <SPI.h>
#include <String.h>
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0F, 0x2A, 0x8D };
byte ip[] = { 192, 168, 2, 77 };//ip arduino
byte server[] = { 192, 168, 2, 83 }; // ip in LAN
Ethernet.begin(mac, ip, gw, subnet); //inizializzazione ethernetshield
EthernetClient client;//(server, 80);
.......
if (client.connect(server, 80)) {
Serial.println("Connected");
client.read();
the code is somethings like this
how i can send data from php to arduino ?
with post method or ?
thanks
the php is the client
That's unusual, to say the least. You still need to post that script.
i realize the server like a classic arduino server
That code is NOT starting up a server.