No server found on port 1542

41 views
Skip to first unread message

Zhiyu Zhang

unread,
Nov 1, 2024, 6:09:22 AM11/1/24
to Boris Computational Spintronics

Hi Serban,

Today, when I ran the code "ns = NSClient(); ns.configure(True)" in VSCode, I encountered a connection error. The message reads, “No server found on port 1542. Make sure a Boris instance is started and configured for this port.” 

I've been using Boris for a long time and have never had this issue until today, and I'm not sure why it happened. I’ve tried several solutions, such as reinstalling the software, switching to a different code editor, and disabling the firewall, but none of them worked. Therefore, I’m reaching out here for assistance.

Thank you very much for your help!

Zhiyu

Zhiyu Zhang

unread,
Nov 1, 2024, 10:31:37 AM11/1/24
to Boris Computational Spintronics
I've just changed the serverport, but it still does not work. 

Serban Lepadatu

unread,
Nov 2, 2024, 6:02:42 AM11/2/24
to Boris Computational Spintronics
Hi Zhiyu,

To change to a different port you need to set it both in the script and in the BORIS console, i.e. e.g.:

In the console type serverport 1600

In the script use ns = NSClient(scriptserverport = 1600)

This should now work if this port is not blocked.

You can also use embedded Python scripting mode, where BORIS executes the Python scripts directly, so it doesn't rely on communication over sockets, but this mode is less user friendly (see Tutorial 9 for details).

Regards,
Serban

Zhiyu Zhang

unread,
Nov 3, 2024, 12:54:36 AM11/3/24
to Boris Computational Spintronics

Hi Serban,

Following your suggestion, I tried changing the port, which led to a new issue. 

Now, I’ve confirmed that Boris is in a listening state, but the Python script (client) remains in an attempt-to-connect state, meaning it keeps waiting. 

Even in embedded mode, the situation remains the same.  Is there any other solution you might recommend?

Thank you very much for your assistance!

Zhiyu

Zhiyu Zhang

unread,
Nov 4, 2024, 12:34:42 AM11/4/24
to Boris Computational Spintronics

Hi,

After shutting down my computer and taking a break for a day, I restarted it today, and now it’s connecting normally again. It’s so strange!

Serban Lepadatu

unread,
Nov 4, 2024, 4:22:59 AM11/4/24
to Boris Computational Spintronics
Excellent. Not sure why this happened, probably some configuration on your computer. 
Note that to launch scripts in embedded mode you can launch it directly from the console as Boris.exe -s yourscript.py (see manual pg. 68, 69), where your Python script needs ns = NSClient(embedded = True).

Zhiyu Zhang

unread,
Nov 7, 2024, 2:23:49 AM11/7/24
to Serban Lepadatu, Boris Computational Spintronics
Hi,   
When I execute Boris.exe in the terminal, the program opens and quickly closes. Is this because additional configuration is needed?  

'Serban Lepadatu' via Boris Computational Spintronics <boris-computati...@googlegroups.com> 于2024年11月4日周一 17:23写道:
--
You received this message because you are subscribed to a topic in the Google Groups "Boris Computational Spintronics" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/boris-computational-spintronics/FdbIKsKB3CI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to boris-computational-s...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/boris-computational-spintronics/2be8f1c2-0911-4cb8-be50-2d25b7abfb80n%40googlegroups.com.

Serban Lepadatu

unread,
Nov 7, 2024, 2:30:15 AM11/7/24
to Boris Computational Spintronics
Yes, you need to have numpy and matplotlib installed in your Python environment. This will normally be a different Python environment than that an IDE might use, so by default numpy and matplotlib will not be installed.
You can use pip to install them from the command prompt, e.g. pip install numpy etc.
The embedded mode is more powerful, but as I said less user friendly since if something is not configured properly, or if there's a mistake in the script, it won't tell you what's wrong and simply not execute.
Reply all
Reply to author
Forward
0 new messages