Can I upload from Spinneret to a remote server?
Moskog
Posts: 554
I bought the PINK some time ago because I thought it could do that because it could be able to send emails.
But it didn't and I had to use the PINK itself to store the web-pages. That means all access to my pages have to go through my own ADSL-modem into the PINK. And thats not a good solution when the internet provider always change IP-address every time resetting or power out. I am currently using no-ip.com but the best for me would be if PINK or perhaps a Spinneret could be able to upload the pages to the remote server I already pay for to my Internet provider.
So., before I buy a Spinneret, can it do that If I put into information on Profile name, Host-name, passwords and all that necessary stuff?
But it didn't and I had to use the PINK itself to store the web-pages. That means all access to my pages have to go through my own ADSL-modem into the PINK. And thats not a good solution when the internet provider always change IP-address every time resetting or power out. I am currently using no-ip.com but the best for me would be if PINK or perhaps a Spinneret could be able to upload the pages to the remote server I already pay for to my Internet provider.
So., before I buy a Spinneret, can it do that If I put into information on Profile name, Host-name, passwords and all that necessary stuff?
Comments
You want the device to upload a page to your web site? What protocol, HTTP? If so, It would be easier to write a script on the web server to accept a page upload. Then just POST to that script.
Sure, if the login is not https:. I don't think anyone has developed SSL code to-date.
1) Initialize the W5100 with the remote host IP and port.
2) Open a socket connection to the server
3) Create a properly formatted header
4) Add your POST data to the body of the message
5) Send the message to the server.
7) [Server] Process request
8) Grab the response
Please see the W5100 manual and the HTTP protocol.
If what you are saying is correct, then you can not use the Spinneret to connect to your web server.
This is the code I used. Your web server's IP is 216.177.135,.4 and the Port is 80
I don't know why I have to keep saying this... but if you want help post your source code.
<html><body>
<?php
$one = $_GET;
$two = $_GET;
echo "Var one: ", $one, " ";
echo "Var two: ", $two;
$myFile = "test.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$StringData = "one: ";
fwrite($fh, $StringData);
$StringData = $one;
fwrite($fh, $StringData);
$StringData = "\n";
fwrite($fh, $StringData);
$StringData = "two: ";
fwrite($fh, $StringData);
$StringData = $two;
fwrite($fh, $StringData);
$StringData = "\n";
fwrite($fh, $StringData);
fclose($fh);
?>
</body></html>
This script is located at: http://wbuffalo.workforceinnovators.org/test.php
POST version: http://wbuffalo.workforceinnovators.org/testpst.php
The file they both write to is located at: http://wbuffalo.workforceinnovators.org/test.txt
In the final solution, I need to be able to take data given to the Spinneret from a Basic Stamp up to the website.
AlI I did was add a QueryString to the end of the requested resource.
Post your code... geez I'm trying to help you man!
http://wbuffalo.workforceinnovators.org/test.php functions as expected and responds to client requests. [Edit:] both GET and POST methods function as expected.
Mult-Socket code base.
http://www.agaverobotics.com/spinneret/source/
You know the drill, post your problem code, call when you say you will, be considerate to others...
we were using the StringMethods object, but it wasn't working out very well.
@number is a pointer to the input number
@tempNum is the destination pointer. Where the ASCII string is written
See the StringMethods object for more information.
Am I missing something? I'm not seeing your attempt to use the StringMethods in your posted code. If that's your question, how to use StringMethods, then post the problematic code.
It's much easier to answer your question when you post the problem code.
It's sending "51323" to our server for both variables.
change this in the DAT section
And change this in PUB Initialize | id, size, st
to
And fire up socket 3 as your client.
The code is designed to return the wayward socket back to a listener depending on the tcpMask.
You can also remove this stuff for your client method
How you handle socket 3 is up to you.
Also, is it possible to have separate cogs utilizing different sockets at the same time?
I assume you mean a web site other than content rendered from the Spinneret? Sure, just send a GET or POST request to the Spinneret from your web server.
Confused, request/response is a core web server function
I'll have a detailed write up in about a week. Otherwise read the code and comments. Basically, there is a member tcpMask that turns the listeners off and on.
You lost me... receiving a socket request is a core function of the multi-socket driver. Are you asking, "How do I parse a string?" or "How do I Parse Receive Buffer?"
Yes, I'm not sure that's the most efficient use of resources. I suppose there could be a need though.
Please don't PM a link to your latest post. I have several folks PMing me... Folks just ask your questions on the forum.
Click the "Post New Thread" button in the main forum.
Post your code
Spinneret:
PHP:
Response header with message body
The response is exactly how the PHP script is coded. You could remove the html and body tags and only return the "1" if you like. Again I'm not really sure what you're trying to do.