Any Chance That Parallax Will Add the 'POST' fuction to the PINK?
Any Chance That Parallax Will Add the 'POST' fuction to the PINK?
This would make things very easy for my project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
This would make things very easy for my project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Comments
The Form Method, “POST” is supported on the PINK. For example, see the following HTML code designed to run on the PINK.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I've been following altitudeap's various threads regarding the PINK module with some interest. I think he's more interested in using POST with the Stamp on the client side to send data to a remote server. To this end, will the "action" field in the <form> tag in your example support an absolute reference to a remote server, e.g. "http://myserver.com/cgi-bin/getdata.pl"? And if so, could a Stamp connected to the PINK cause such a form to be filled in and submitted?
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
All lines are terminated with newlines (i.e. linefeeds, ASCII $0A). Even though a connection has been established, the "Host:" line is necessary in case myserver.com is a virtual server sharing the same IP address with other virtual servers. The blank line is what separates the headers from the data.
But this is all very hypothetical, since it's unclear whether the PINK module can act as a telnet client, controlled by the BASIC Stamp. I'm guessing that it cannot, unless via undocumented commands. And it's not the optimum way, either, since it bypasses completely the PINK's handy variable structure.
There is also an outside possibility that HTTP messages could be transferred via UDP, but the remote server would have to be listening for something like that, and most servers likely won't be. But, one way or another, POSTing would be a handy capability for the PINK module.
-Phil
Any comments on this since you have been playing wuth the development kit?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
I am looking to send 18 variables in each 'transmittion' this will update a database on the server.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
I admit that I don't know much about the PINK firmware, but I can find out if we can add this feature. I'm already in contact with the person responsible in Parallax and we'll get back to you with a reply. We need to contact NetBurner, most likely.
Ken Gracey
Parallax, Inc.
What seems simple, generalized and direct to to start a TCP/IP session with another computer on any port one selects, then send and receive the data you need, not unlike a serial port and not unlike what is done in PINK firmware with UDP. What is nice about this method is that the Netburner firmware supports this cleanly and could be written like the way UDP is written now.
Well a TCP receive flag might be necessary.
Regards
Tim
Post Edited (TimC) : 1/24/2007 4:38:48 AM GMT
I'm sorry to disagree, but a POST is an HTTP method that is initiated by a client, and is used to send data to a server (rf: David Gourley & Brian Totty, HTTP The Definitive Guide, O'Reilly). This data is normally fielded by a CGI program on the server, which responds either with an OK and some data (perhaps an HTML page) or with an error message. POSTing is a common way to send data from HTML forms to a server, but it can be used to send other data, too. I believe, short of FTPing an entire file, that it is the right tool for the job. There are other alternatives, such as PUT (which writes complete documents to the server, somewhat like FTP) and GET (which encodes the data in the URL, e.g. myserver.com/cgi-bin/test.pl?temp=32). But I believe POST would be the most useful and flexible for sending data to a server for immediate processing.
-Phil
I spoke with the guys at Net Burner this moring and I am just waiting for a reply on some of these questions. Sorry it has taken so long to get the information you wanted but I should have some information soon. In the meantime I would still recommend trying a test post to a different server to see if it will work. Does anyone have the facilities to try this? It’s not exactly what the firmware was designed to do, but if it helps you accomplish your goals that would be worth it. I will be following up. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
For example normally we go to google first get the form then type in my search term then I press enter/POST then our data comes back. What you are asking for is to bypass recieving the form and just send the "form" already loaded back to google. It works, and you can do it but the conversation as to what fields and how the data is to be presented is gone.
The PINK product has to be simple to be usefull and easy to understand. It's a hobbyists tool. Most people are not using it to auto update database servers. If you need this really badly and can order several hunderd of them talk to Netburner. If you only want to use the PINK in a few places and need the device to be changed for your specific purpose (with several more commands added) then it just makes it more complicated for the rest of us.
I would suggest you push for other methods that are usefull to a wide Parallax user base like:
- Being able to issue a GET request and adding ? followed by the data you want to send as u have suggested example go to this topic: forums.parallax.com/forums/post.aspx?f=15&r=r&m=166526
- Being able to start a TCP/IP conversation similar to a UDP conversation then send/receive anything u want. There is already an example in this thread on what to do next.
Regards
Tim
The problem with using GET is that the amount of data that can be transferred is very limited. Plus, it confers no advantages on the server side, since there still has to be a CGI script there to deal with it. (BTW, I'm interested in exploring the link you provided, but clicking on it brought up a reply screen for this thread.)
While your comments about how POST operates in a web environment (GET the form, fill it in, then POST the data) are certainly true, retrieving a form from the server is really a separate transaction (which may not even occur during the same TCP/IP connection as the subsequent POST, depending on one's browser and how long it takes to fill in and submit the form) and an unnecessary complication in a PINK environment. If the client already knows what variables the server is expecting, why retrieve a form every time?
I agree with adding the capability to start a TCP/IP conversation (via telnet). That way POSTing could be done as I outlined above. But automating the POST even further would make it more accessible to novices.
Regards,
Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
I got a reply, but nothing yet on the information you requested. I will send another request.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thanks,
Scott
This thread was about more than just a POST function…The PINK has always had that capability. The original poster wanted to be able to post to a different web server. That is not possible, nor will it be. Variables updated on HTML pages hosted on the PINK can be POSTed just fine though. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Basically, I needed to have PINK send variable data from the BS2 to my web-server where it would be parsed and stored in a database.
I managed to put together a work-around so that not only can I now send data to my web-server and store it, but my web-server can communicate with my PINK module (and by extension, my BS2) autonomously - so, my web-server and PINK module can communicate with each other without human intervention.
What I would use this for would be to have the PINK module send a request (which is logged in a database) to the web-server, then the web-server sends the requested data (taken from a different database) back to the PINK module for the BS2 to process.
But, there are any number of other kinds of things you could do with this (large networks of BS2 with a web-server acting as a communications hub, automatic autonomous web-based control of robots, BS2 cloud computing?
With all the web-accessible variables the PINK has, I can shuffle a lot of data around and overcome the BS2's small variable memory. And, because I can use the web-server to process data, I can also do complex calculations that can't be done by the BS2 and/or a math co-processor. Likewise, with the more powerful programming capabilities of a web-server, there are a lot of other things that you can have the server do which the BS2, alone, can't.
So, in the end, adding POST capability to the PINK module isn't really necessary. If it were added, it would just make it, initially, a bit easier to send data to a remote server. But, after you have it set up to do this without POST, it works perfectly well and would probably be just as fast.