Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Viewing the EnergyPlus Simulation Log within OpenStudio CLI Terminals

asked 2017-09-27 16:06:43 -0600

chriswmackey's avatar

updated 2017-10-06 16:03:51 -0600

Hello unmethours community!

I have a question that should hopefully have a quick answer. I am used to running my EnergyPlus simulations using the Epl-run.bat file or within the OpenStudio application. As many of us know when we do this, we get a nice updating log on the status of the EnergyPlus simulation like so: image description image description

Now that I have been getting into the wonderful OpenStudio Command Line Interface (CLI), it's been great to have all of this power to apply Measures and automate long workflows. However, I have found that I do not get as much feedback in the terminal when I run an OSW through the CLI. The terminal simply looks like this (pardon the specific file path to the OSW): image description

I was wondering if it is possible to get this updating EnergyPlus simulation log in my terminal while running OpenStudio CLI. I understand if this functionality does not yet exist in OpenStudio CLI and I ask the question out of curiosity.

Thank you, as always.

UPDATE: Kyle's solution below seems like it should work but I think I might have the wrong port. This is the message I get from OpenStudio CLI: image description And this is the message I get from the netcat function: image description If I figure out the right port to use, I'll post back here.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-28 09:50:35 -0600

It is possible to get the E+ output from the OpenStudio CLI, the OpenStudio App is using the CLI behind the scenes after all, but it is not currently as simple as you would expect.

First, note that the CLI has a --verbose option that will give you much more output, however this output pertains to what the CLI is doing and the steps that it is proceeding through in the workflow. Even the --verbose output does not include the E+ standard out.

There is another option, -s, to pipe the standard output of E+ to a socket. This is actually what the OpenStudio App is doing. I realize this is not convenient for many use cases, including probably yours, but for the sake of completeness, I'll try to explain one way of using this option. It is in fact a bit obscure and perhaps we can revise the options to make it easier to see the E+ standard out in the future.

Here's one way to use the -s option:

  1. Use the "netcat" utility to setup a socket listener. The command is named nc and it probably does not come standard on MS Windows, but you can download it. In order to setup a listener on port 1235 enter the command, nc -l 1235.

  2. In another command prompt use the OpenStudio CLI in the normal way but add the -s option passing the port 1235 (or any other available port, nc will fail to execute if 1235 is taken) as an option. openstudio run -s 1235 -w workflow.osw.

Like I said, not exactly convenient, but if you successfully started the nc utility, you should see E+ output in the command window where you started nc.

edit flag offensive delete link more


Thanks for the quick response, Kyle! I'll try out socket workflow as soon as I get the chance and report on the outcome here. At the least, I will use the --verbose output. Thanks again!

chriswmackey's avatar chriswmackey  ( 2017-09-28 10:14:18 -0600 )edit

Anybody managed to make it work with wsl (windows subsystem for linux)? Error: No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 12345 in eval:433:in `initialize'

Adrien's avatar Adrien  ( 2020-11-26 15:06:08 -0600 )edit

@Adrien yes, this worked for me with WSL2 and Ubuntu 20.04 without any other installation/setup except for OpenStudio SDK 3.2.x.

MatthewSteen's avatar MatthewSteen  ( 2021-12-31 18:22:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer


Question Tools



Asked: 2017-09-27 16:06:43 -0600

Seen: 640 times

Last updated: Oct 06 '17