Results 1 to 3 of 3

Thread: network.get

  1. #1

    Default network.get

    Hi,

    I am trying to use network.get from a file (located /opt/girder/lua/examples) and I get an error message but it runs fine from within a script in Girders “gui”. Am I missing to load a module? If so what is the name of the module?

    Error:
    Scripting / /opt/girder/lua/examples/fhem.lua:25: attempt to index global 'network' (a nil value)
    stack traceback:

    Script that I am trying to run:
    network.get( "http://192.168.137.51:8083/fhem?cmd=set%20EnO_FEFE9698%20BI&XHR=1", function ( success, status, body )
    if not success then
    print("Sorry could not connect with server")
    return
    end
    if status ~= 200 then
    print("Sorry server returned", status)
    return
    end
    print(body)
    end, 3000)

    Regards,

    Joachim

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

    Default

    at top of script add

    local network = require('network')
    Ron
    No support through PM

  3. #3

    Default

    Hi Ron,

    Thanks it worked!

    I actually tried adding network to my script but I must have made some spelling error, I guess I must have been blind (spent a lot of time on this on). Thanks again!

    Joachim

Posting Permissions

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