Hi,
I'm programming an application to setup radio 433Mhz devices through Raspberry/Arduino. As there is no TCP library to use with Inventor, I send commands using web1. I got it work from Android application to PI, a selfmade php script using socket and running on the PI being the master piece of the design (no web server involved).
Now I would like to send datas (in my case 10 digits) from php script to the application. For this I use the sample from tutorial Stock Market App but it doesn't work. My apps blocks are showed in the Selection_077 file. One thing: I just send the get, no URL being defined (but also tried with) as it is defined in the web component, not on port 80, lets say port 12345.
I effectively receive the GET from the app in the script:
___TCP/IP Connection___
NEW SEQUENCE
--- BEGIN RECEIVE ---
GET / HTTP/1.1
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; Nexus 5 Build/LMY48B)
Host: <myHostName>:12345
Connection: Keep-Alive
Accept-Encoding: gzip
--- END ---
and reply with (php code):
$data = "HTTP/1.1 200 OK\nPUT / HTTP/1.1\nContent-Length: 10\nContent-Type: text/plain\n\n1000000000\r\n";
$buf=socket_write($msgsock, $data, strlen($data)) or die("Cannot write to socket\n");
socket_close($msgsock);
Above cmd output being
--- BEGIN REPLY ---
HTTP/1.1 200 OK
PUT / HTTP/1.1
Content-Length: 10
Content-Type: text/plain
1000000000
--- END ---
I tried also to send without the PUT / HTTP/1.1 header, no more luck.
If someone could help me on this, would be great :-)
Thanks in advance,
Daniel