Menu

#22 'Cannot connect TCP/IP data reporter' when using MacOS

v1.0_(example)
open
nobody
None
1
2019-03-11
2018-06-21
Jaime Souza
No

Hello,

It is not possible to use the GUI in MacOS.

There is a error with the TCP/IP data reporter. For instance, if I try to run (python tutorial14.py console), I get:

Cannot connect TCPIPDataReporter: Invalid argument
Traceback (most recent call last):
  File "tutorial14.py", line 325, in <module>
    run(guiRun=guiRun)
  File "tutorial14.py", line 314, in run
    **kwargs)
  File "/Users/jaimenms/PycharmProjects/study-daetools/.venv/lib/python3.6/site-packages/daetools-1.8.0-py3.6-macosx-10.6-intel.egg/daetools/dae_simulator/activity.py", line 102, in simulate
    raise RuntimeError('Cannot connect TCP/IP data reporter')
RuntimeError: Cannot connect TCP/IP data reporter

Or with the gui (python tutorial14.py), after I press Start / Run, I get "Cannot connect data reporter! Did you forget to start DAE Tools Reporter?".

Obs.: My firewall is off, the port 50000 is free and the 127.0.0.1 is my localhost.

Obs.: It is not a big deal because I am actually working with Pandas.

Obs.: I found in the source codes that file DataReporting/tcpip_data_reporter.cpp has a commentary thaty can explain it "// There is problem with the boost::process::spawn function in macOS."

Thanks,

Jaime

Discussion

  • ciroki

    ciroki - 2018-06-21

    Hi Jaime,

    It is possible to use the DAE Plotter GUI, just there are problems with starting it automatically in macOS when one attempts to connect the tcp/ip data reporter. Previously, one had to manually start the DAE Plotter GUI. Now, it will try to start it before connecting. This part does not work in macOS at the moment. There you have to start it using i.e.:

    python -m daetools.dae_plotter.plotter
    

    Please try and let me know if it works.

    Cheers
    Dragan

     
  • Jaime Souza

    Jaime Souza - 2018-06-22

    Hi Dragan,

    You are correct. It works if I run python -m daetools.dae_plotter.plotter previously.

    Thanks

    Jaime

     
  • ciroki

    ciroki - 2018-06-22

    Hi Jaime,

    Good, thanks a lot for checking it.
    I should add it to the documentation to make clear what needs to be done when running on macOS.

    Cheers
    Dragan

     
  • Anonymous

    Anonymous - 2019-03-11

    Hi, I seem to be getting the same error. I am running DAE Tools on macOS through a windows server. I tried again on a windows machine through the same server and still seem to be getting the error. I ran the command you mentioned and the dae plotter did open. However, when I run any script, even the tutorials, I still get the same error with the message 'Cannot connect to data reporter! Did you forget to start DAE Tools Plotter?'. I got this message even when DAE Tools Plotter seemed to be open once I had run the command you mentioned above.

     
    • ciroki

      ciroki - 2019-03-11

      Hi Jaime,

      It runs on the local machine (localhost). If it can't connect then it is a problem with i.e. windows firewall. Can you check that? Otherwise, just use the following class:

      class daePickleDataReporter(daeDataReporterFile):
          # Saves data as the Python pickle which can be opened in DAE Plotter.
          def __init__(self):
              daeDataReporterFile.__init__(self)
      
          def WriteDataToFile(self):
              try:
                  from daetools.dae_plotter.data_receiver_io import pickleProcess
                  pickleProcess(self.Process, self.ConnectString)
              except Exception as e:
                  print(('Cannot write results in the Python pickle format:\n' + str(e)))
      

      You can instantiate it in an usual way:

      datareporter = daePickleDataReporter()
      datareporter.Connect("filename.simulation", simName)
      

      Then you can open the created file in DAE Plotter and use it as usual.

      Dragan

       

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB