energyplus fails to open socket.cfg configuration file

844 views
Skip to first unread message

Diogo Gonçalves

unread,
Jun 7, 2016, 3:34:01 PM6/7/16
to bcvtb
Hello all,

It might not be the best place to post my issue, but here it goes:

I'm using Windows 10 64bit, EnergyPLus 8.5 and python 3.4.

1) I'm trying to connect python to EnergyPLus through BCVTB protocol.

2) Though the TCP/IP network is working flawlessly and the socket.cfg is in the exactly same format as those created by BCVTB, EnergyPlus fails to open socket.

Error log sample:

"   ************* Beginning Simulation
   ** Severe  ** ExternalInterface: Could not open socket. File descriptor = -1.
   **  Fatal  ** Error in ExternalInterface: Check EnergyPlus *.err file.
   ...Summary of Errors that led to program termination:
   ..... Reference severe error count=1
   ..... Last severe error=ExternalInterface: Could not open socket. File descriptor = -1.
   *************

Does anyone have a solution, opinion, suggestion, or a better place to address this issue?

Thank you very much in advance.

Greetings,
Diogo


Thierry Nouidui

unread,
Jun 7, 2016, 4:00:23 PM6/7/16
to bc...@googlegroups.com
Could you please send the EnergyPlus error file as well as your system model (.xml)?

Thanks!

Thierry

--
You received this message because you are subscribed to the Google Groups "bcvtb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcvtb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--------------------------------------
Thierry Stephane Nouidui, PhD

Simulation Research Group
Lawrence Berkeley National Laboratory
1 Cyclotron Road, MS 90R3147
Berkeley, CA 94720
(510) 495-2337 voice
email: TSNo...@lbl.gov
http://simulationresearch.lbl.gov
----------------------------------------

Diogo Gonçalves

unread,
Jun 8, 2016, 6:33:49 AM6/8/16
to bcvtb
Thank you, Thierry!
I'm using your .idf file from example "ePlus85-schedule". However, as I'm not programming on bcvtb directly, because PythonActor does not support numpy libraries (Jpython), I don't have a system.xml file.

Maybe I should get more deep into what's the energyplus routine for establishing a socket connection, so I can program it accordingly. Anyway, I'd be extremely thankful for any suggestion you might have.

Diogo
utilSocket.log
eplusout.err
socket.cfg
SmOffPSZ.idf

Thierry Nouidui

unread,
Jun 8, 2016, 10:37:25 AM6/8/16
to bc...@googlegroups.com
Have you tried to use the SystemCommand (http://simulationresearch.lbl.gov/bcvtb/releases/latest/doc/manual/tit-CustomExeCon.xhtml) actor for that. 
It allows you to call any script (e.g. python).
If you are not using the BCVTB, then I can hardly help debugging here...

Thanks!

Thierry

Diogo Gonçalves

unread,
Jun 8, 2016, 12:53:42 PM6/8/16
to bc...@googlegroups.com
Where would you suggest to look for a help debugging?
 
I've seen it, but I didn't implement it yet because I'd prefer the server to be my python program for reproducibility. I'll keep on trying this way til the end of the week, and if I don't manage to do it, I'll implement it by SystemCommand Actor (I really got to keep on with my PhD work).

Anyway, I was doing a little digging and it seems the problem resides when utilSocket.c tries to connect by  "retVal = connect(sockfd, (const struct sockaddr*)&serAdd, sizeof(serAdd));" function.

As you can see in the utilSocket.log I sent you, the sockfd is printed, but I don't know which sockaddr and serAdd is this function using. Do you have any suggestion for debugging energyplus so I could figure it out where the problem is?

Sorry to bother you, and Thanks a lot!!
Diogo 

--
You received this message because you are subscribed to a topic in the Google Groups "bcvtb" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bcvtb/IkmaNjcqVSY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bcvtb+un...@googlegroups.com.

Diogo Gonçalves

unread,
Jun 23, 2016, 6:39:36 AM6/23/16
to bcvtb
Dear all,

FYI, I found the solution and I leave it here for future needs.
As it turns out, energyplus preferred to read my IP address from the socket.cfg, rather than my admin user name.

All the best,
Diogo

Alexandre Zimmer

unread,
Jul 26, 2016, 4:35:33 AM7/26/16
to bcvtb
Hi everyone,
I have the same problem Diogo and i don't understand how you did to solve this, could you give me more details pls?
Thank you,
Alex

Diogo Gonçalves

unread,
Jul 26, 2016, 5:16:27 AM7/26/16
to bc...@googlegroups.com
Hey Alex,
when creating your sockt.cfg file, make sure to put you local IP in the user id, instead of your windows username.

best,
Diogo

Alexandre Zimmer

unread,
Jul 26, 2016, 6:05:58 AM7/26/16
to bcvtb
Thank you Diogo, I tried it but as the socket file is updated each time I run BCVTB, the local IP is always turned to windows username

best,
Alex

prateek munankarmi

unread,
Dec 30, 2016, 1:48:42 PM12/30/16
to bcvtb

prateek munankarmi

unread,
Jan 2, 2017, 8:38:08 PM1/2/17
to bcvtb
Hi Diogo,
I am also trying to create the python server to communicate with EnergyPlus. I am also getting the exact same problem as you described. I also tried to change the hostname in socket.cfg but it still showed the error. My python code is creating the server but is unable to communicate with EnergyPlus. Could you elaborately describe the solution. 

Regards,
Prateek

diogo.antun...@gmail.com

unread,
Jan 3, 2017, 4:13:14 PM1/3/17
to bc...@googlegroups.com
Have you changed the host name to your local IP address?

Cheers, 
Diogo


prateek munankarmi

unread,
Jan 4, 2017, 9:09:04 AM1/4/17
to bcvtb
Hi Diogo,
 Thanks, finally I got the python server connection to energyPlus working. Have you exchanged the data with energyPlus. I am having trouble to exchange data between energyPlus and Python. 

Your help is highly appreciated. Thanks.

Regards,
Prateek

diogo.antun...@gmail.com

unread,
Jan 4, 2017, 2:54:57 PM1/4/17
to bc...@googlegroups.com
I did and I'll share a repository capable of doing it in one week time;) it'll be free, so if you can wait we'll talk better afterwards .

Cheers, D


prateek munankarmi

unread,
Jan 4, 2017, 3:11:02 PM1/4/17
to bcvtb
Hi Diogo,

Sure. Thanks for your help.
Actually, I am stuck on error "Error:cannot get the environment variable:BCVTB_HOME". Did that problem occurred to you.

Regards.

Theo Lagarde

unread,
Jul 3, 2022, 7:19:15 AM7/3/22
to bcvtb
Hi Diogo,

I reactivate the conversation because I have the same issue. I use EnergyPlusToFMU to couple Matlab/Simulink (version 2021a) and EnergyPlus (version 9.0.1). When I run the FMU on matlab I have the same fail of socket opening in the .err file. Even if I replace the hostname by my IP adress in the socket.cfg file, there is still the same error. Any help ?

Thank you

nouidui.c...@gmail.com

unread,
Jul 4, 2022, 7:53:33 AM7/4/22
to bcvtb
I don't have Simulink to test but I am curious whether you manage to run an EnergyPlusToFMU using another Master algorithm such as pyFMI? This will at least give some indications as to whether the problem is in the E+FMU, Simulink, or the co-simulation.

Theo Lagarde

unread,
Jul 6, 2022, 10:46:40 AM7/6/22
to bcvtb

I tried with pyFMI and same error of socket so the problem doesn't come from the Master algorithm..

nouidui.c...@gmail.com

unread,
Jul 8, 2022, 4:07:07 AM7/8/22
to bcvtb
You should be able to run an EnergyPlusFMU with PyFMI.
Could you share the script that you have used to run the FMU?
Could you try to run that FMU on a different machine just to see if the problem can be reproduced?

Theo Lagarde

unread,
Jul 12, 2022, 4:31:51 AM7/12/22
to bcvtb
Hi,

Maybe I can send you the folder that contains the idf, the fmu and the python code to test from your side. I can't test on another machine because my personal computer is a MAC OS. However, I think that the issue is related to security because I found on another forum the same issue that has been resolved by runing on another machine. If you are interested to test it, I joined you my email : theo.la...@gmail.com

Thank you
Regards

nouidui.c...@gmail.com

unread,
Aug 22, 2022, 9:56:51 AM8/22/22
to bcvtb
I don't have a Mac to test. I suggest you try to do the testing on another computer (or on a Virtual machine) just to see if you can reproduce the problem.
Reply all
Reply to author
Forward
0 new messages