Help using the Spinneret as a Client
Mike G
Posts: 2,702
I loaded Tim's "W5100 TCP Client Echo Demo indirect Ver. 00.1" and was able to hit the "TCP Test Tool 2.3" from Simple Com Tools as described in the Demo comments.
Next, I created a simple ASP.NET application on the localhost. The default.aspx page returns a datetime comma delimited string. I configured the Spinneret server to hit the localhost's IP (192.168.1.100) on port 80. When a connection is made, the Spinneret fires off the header.
GET /SpinneretUtilities/default.aspx HTTP/1.1
Host: 192.168.1.100
Keep-Alive: 115
Connection: keep-alive
I get a response from the web server and the world is great.
So I tried the same thing, this time connecting to the exact same code but on the Internet. No dice... the Spinneret waits for a connection, the header is never sent. So how do I go about troubleshooting this behavior? I'm not sure if the request is making it outside my network. The request could be making it outside but not back?
Next, I created a simple ASP.NET application on the localhost. The default.aspx page returns a datetime comma delimited string. I configured the Spinneret server to hit the localhost's IP (192.168.1.100) on port 80. When a connection is made, the Spinneret fires off the header.
GET /SpinneretUtilities/default.aspx HTTP/1.1
Host: 192.168.1.100
Keep-Alive: 115
Connection: keep-alive
I get a response from the web server and the world is great.
So I tried the same thing, this time connecting to the exact same code but on the Internet. No dice... the Spinneret waits for a connection, the header is never sent. So how do I go about troubleshooting this behavior? I'm not sure if the request is making it outside my network. The request could be making it outside but not back?
Comments
Can you post your SPIN for this example? Or maybe some reference on how to send a GET? I am trying to get the Spinneret to send strings to ThingSpeak (thingspeak.com or 184.106.153.149).
I am getting close with the TCP Client Demo, but I don't see how to write the HTTP GET or POST like you have referenced:
GET /SpinneretUtilities/default.aspx HTTP/1.1
Host: 192.168.1.100
Keep-Alive: 115
Connection: keep-alive
Some spin code would be beneficial for my project. I will post my full spin once I get it operational. Thanks for your help.
The connection will work but the handshake and encryption/decryption might be a little tough to code.
The website for ThingSpeak is using SSL and the API is SSL optional. For example, sending updates from the Spinnernet uses http://api.thingspeak.com/updates and getting feeds uses, http://api.thingspeak.com/channels/<c_id>/feed.json
I will post the SPIN when I finish the testing.
The PST always says "Waiting for a server...." - I am pointing the test tool on the same network, no firewalls. I can make the Spinnernet act as a server and that works great, but not as a client. Of the two, I thought client would be easier. Anyone have the smoking gun on why? I have noticed others having the issue? Thanks.
So simply enter a port like 5000 and click the "bind" button (on the right). Make sure that you configure the spinneret's destination and local port to 5000 too...
Thanks for the help.
The Spinneret can be assigned any port. I had you use 5000 because 1) that's how the demo code works. 2) if you want to connect to the Internet, you'll need to use a local port other than 80 because your ISP probably blocks port 80.
This has noting to do with TCP stack behavior. TCP defines how packets are transported not what port to use. Ports allow many applications on a computer to share network resources concurrently.