cannot get value in realtime server mode

stan
2013-01-16
2013-03-16
  • stan
    stan
    2013-01-16

    Hi all,
      I am following the guide in title=Realtime_server#Outputhttps://sourceforge.net/apps/mediawiki/gridlab-d/index.php?title=Realtime_server#Output but I cannot get the object property value.

    The glm I used is:

    module residential;
    module tape;

    clock {
    timezone PST+8PDT;
    timestamp '2013-01-16 14:53:00';
    }

    module residential;
    module tape;

    object house:1 {
    heating_setpoint 40degF;
    cooling_setpoint 90degF;
    }
    object player {
    parent house:1;
    property cooling_setpoint;
    file theat.csv;
    loop 100; //loop for 100 days but does not move the time stamp
    }
    object recorder{
    parent house:1;
    property air_temperature,cooling_setpoint;
    file theat_record.csv;
    interval 5;
    limit 480;
    }

    Then I run it like:

    stan@stan-PC:~$ sudo gridlabd -D run_realtime=1 player_recorder.glm -server
    WARNING  : house_e:0 has no parent triplex_meter defined; using static voltages
    initial model dump to 'gridlabd.xml' complete
    Processing..

    It seems like the simulation is running. But when I open another shell and try to get the value like:

    stan@stan-PC:~$ wget http://localhost:6267/house:1/heating_setpoint -q -o b.txt
    stan@stan-PC:~$

    The output file b.txt is always empty. I don't know where I was wrong. Can someone help me out here??

    Thanks so much!

     
  • Which version are you running and on what platform?  I'd like to try this myself.

     
  • stan
    stan
    2013-01-17

    I am running branch 2.3 code in svn. My computer is 11.10 Ubuntu, x64. Thanks!

     
  • Server and real-time mode are a bit dicey in 2.3.  I'll try this and get back to you.  You may have to use trunk eventually, but hopefully I can get you going on 2.3.

     
  • stan
    stan
    2013-01-17

    Also,
       When I set the  server port number = 10000, I can get the clock using:
       wget http://localhost:10000/clock

       But I cannot get the house property. using
       wget http://localhost:10000/house:1/air_temperature

       I post this question on another post. You can see that.

     
  • stan
    stan
    2013-01-17

    Thanks Dave!

     
  • Before I delve into this, have you tried naming the house and using its name when querying?

    object house {
      name MyHouse; 
      heating_setpoint 40degF; 
      cooling_setpoint 90degF;
      object player { 
        property cooling_setpoint; 
        file theat.csv; 
        loop 100; 
      };
      object recorder {
        property air_temperature,cooling_setpoint; 
        file theat_record.csv; 
        interval 5; 
        limit 480; 
      };
    }
    

    Then your query would be something like

    wget http://localhost:10000/MyHouse/air_temperature
    
     
  • stan
    stan
    2013-01-20

    Hi  Dave,
      Thanks for the tip! It works as you said!  ~_~