Results 1 to 4 of 4

Thread: IP Communication Error - 501 Not Implemented: Only GET and POST supported

  1. #1
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    166

    Default IP Communication Error - 501 Not Implemented: Only GET and POST supported

    Hoping anyone can point me in a direction here..

    I'm trying to communicate via IP with my preprocessor. I've setup a transport device and it appears to connect and communicate ok, as I receive the "heartbeat" events back from the processor in the log. I've attached my transport file here:
    171726_BrystonSP3_IP.lua

    However - when I try to send a command using the following:
    Code:
    local txManager = ComponentManager:GetComponentUsingName('Transport Manager')
    local tp = txManager:GetTransportUsingName('BrystonSP3_IP')
    tp:Send("#10MPWRQS\r\n")
    I receive the following feedback from the preprocessor in the LUA Interactive Log:
    Code:
    HTTP/1.1 501 Not Implemented
    501 Not Implemented: Only GET and POST supported
    Is there a change i need to my transport setup, or is the issue with my preprocessor?
    Scott

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Well use are using plain TCP on a device that requires HTTP. Try using the curl libraries in Girder.
    Ron
    No support through PM

  3. #3
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    166

    Default

    Quote Originally Posted by Ron View Post
    Well use are using plain TCP on a device that requires HTTP. Try using the curl libraries in Girder.
    OH! Right. Well using my browser, I am able to send an HTTP command such as:
    Code:
    http://192.168.0.77/cmd.cgi?cmd=%2310MVOLQS.
    I then must issue the following command to retrieve the response to the command:
    Code:
    http://192.168.0.77/status.xml
    This returns an xml result with a specific xml field holding the result:
    Code:
    <tw0>#10MVOL0800</tw0>
    currently I"m trying the following code to issue the 2 commands and print the results, but I'm not having much luck.. yet...
    Code:
    require('luacurl')
    function UrlDownloadToMemory (url)
        --print("UrlDownloadToMemory using curl...", url)
        local opt = {}
        opt.headerlen = 0
        opt.len = 0
        opt.data = ''
        opt.header = ''
        opt.callback = callback
        local c = cURL.new() 
        c:setopt(cURL.OPT_URL,url)
        c:setopt(cURL.OPT_SSL_VERIFYPEER, false)
    --	c:setopt(cURL.OPT_HEADERFUNCTION, ExtractContentLength2(opt))
    --	c:setopt(cURL.OPT_WRITEFUNCTION, SaveDataToString2(opt) )        
        c:setopt(cURL.OPT_TIMEOUT, 60)    
    
        local v, e = c:perform()
        if ( not v ) then
            c:close()
            return nil, e, v
        end
        c:close()
        return opt.data, opt.len
    	
    end
    local url = "http://198.162.0.77/cmd.cgi?cmd=%2310MPWRQS."
    local a,b,c = UrlDownloadToMemory(url)
    url = "http://192.168.0.77/status.xml"
    a,b = UrlDownloadToMemory(url,cb)
    print(string.format("Results: a=%s",a))
    print(string.format("Results: b=%s",b))
    Scott

  4. #4
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    166

    Default

    OK nevermind - I think I found a much simpler answer. I'll post my LUA for others when its functioning. Thanks for pointing me in the right direction Ron.
    Scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •