Shop OBEX P1 Docs P2 Docs Learn Events
Any Chance That Parallax Will Add the 'POST' fuction to the PINK? — Parallax Forums

Any Chance That Parallax Will Add the 'POST' fuction to the PINK?

Brian CarpenterBrian Carpenter Posts: 728
edited 2008-09-19 03:06 in General Discussion
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!!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-21 00:08
    Hello,

    The Form Method, “POST” is supported on the PINK. For example, see the following HTML code designed to run on the PINK.
    <html>
    
    <body>
    <form method="POST" action="index.html" enctype="text/plain">
    <pre>
    <font size="6"><b> Speech</font></b>
    Speak these words:<input name="Nb_var04" type="text" size="64" max length="64">
    </pre>
    <center>
    <input type="submit" value="Speak">
    </center>
    </form>
    </body>
    </html>
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-01-21 02:21
    Chris,

    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
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-21 03:23
    i was refering to 'post'ing to na external server.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-21 06:42
    To be honest I’m not sure…I would suggest trying it. I wouldn’t be able to get a more complete answer until Monday or Tuesday as I did not develop the firmware myself. Let me know if you do try it and what luck you have, if any. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-21 19:30
    Thanks Phil for helping me explain what it is that i need

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-01-21 23:45
    If the PINK module could somehow be coaxed to initiate a telnet session on port 80 with a remote server (rather than just responding to one), a POST would be possible by sending the raw HTTP headers and data. This isn't as bad as it sounds, since HTTP is just ASCII text. Once a telnet connection is established, a typical POST message would look something like this:

    POST /cgi-bin/mydataprogram.pl HTTP/1.1
    Host: myserver.com
    Content-type: text/plain
    Content-length: 15
    
    temperature=73
    
    
    


    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
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-22 00:07
    TimC,
    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!!
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-22 00:11
    Phil,
    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!!
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-24 03:30
    Chris, Were you able to find anything out about the firmware?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Ken GraceyKen Gracey Posts: 7,403
    edited 2007-01-24 04:04
    Hi Brian,

    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.
  • TimCTimC Posts: 77
    edited 2007-01-24 04:32
    This has come up before. My thinking is use the right tool for the job. A post is a response from a web server conversation so starting a conversation with a post seems wrong to me.

    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
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-01-24 05:42
    Tim,

    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-24 06:07
    Hello,

    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
  • TimCTimC Posts: 77
    edited 2007-01-24 17:51
    I agree the client does initiate the POST and before that the client does START the the conversation but what you are proposing is to stuff the POST message yourself with your own data and URL and have that message go out BEFORE any conversation has been started.

    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
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-01-24 19:48
    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
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-29 18:44
    Has parallax been able to make contact with NETBURN on this. Just looking to see if there is an update.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-29 22:03
    Brian,

    I got a reply, but nothing yet on the information you requested. I will send another request.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Farmer ScottFarmer Scott Posts: 30
    edited 2008-09-07 21:18
    Any updates on this topic?· I was just about to order the SB70 development kit and build my own firmware so I could have HTTP GET access, but POST would be equally sufficient, from a Propeller based application.

    Thanks,

    Scott
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-09 22:44
    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
  • Kyle L.Kyle L. Posts: 21
    edited 2008-09-09 22:51
    I don't know if parallax has made any progress with getting PINK to POST form data to a web server yet; but I asked pretty much the same question back in April and it didn't seem like it. (EDIT: Above post confirms this.)

    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? tongue.gif)

    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.
  • mhammermhammer Posts: 20
    edited 2008-09-19 03:06
    I am not sure if people are still looking for an answer to this. I have setup a demo using Ajax and the XMLHTTP Object to post data to a webserver. This has had limited success as the code was pieced together quickly. if anyone is still interested i can put a more stable version together and post it. send me a PM and if their is still interest i would be happy to dig up the demo i had.
Sign In or Register to comment.