Project

General

Profile

Test Network Connection Between Remote and Instrument Computers » History » Version 28

Anchi Cheng, 02/04/2015 09:56 PM

1 20 Anchi Cheng
h1. Test Network Connection Between Remote and Instrument Computers
2 1 Amber Herold
3
4
5 20 Anchi Cheng
By far the biggest installation problem comes from network connection is block at the microscope/camera computer from the remote computer where the main Leginon program is run. Here is a test to do before trying to start leginon operation at the remote computer. Leginon bulletin board has a thread that has  "various problems and solutions":http://emg.nysbc.org/boards/6/topics/3  from users.
6 1 Amber Herold
7
8
9
h2. Start a Test Launcher on the Microscope Computer
10
11
12
13 11 Amber Herold
#  scope> go to the location where Leginon is installed, generally
14 27 Anchi Cheng
 <pre>C:\Python27\Lib\site-packages\Leginon\</pre>
15 11 Amber Herold
#  scope> double click on test1.py. You should see something like this:
16
<pre>INFO localtransport server created at location {'instance': <localtransport.Server object at 0x40e614cc>}
17 1 Amber Herold
INFO tcptransport server created at location {'hostname': 'myscope', 'port': 49152}
18
INFO <class 'event.SetManagerEvent'> binding added for destination myscope, method <function printData at 0x40e63c34>
19
ACCEPTING CONNECTIONS AT:  myscope:49152
20 11 Amber Herold
hit enter to kill
21
</pre>
22 1 Amber Herold
**If the line before last says ACCEPTING CONNECTIONS ...., you have an opened port on this host.
23 11 Amber Herold
&nbsp;
24
# Write down the name of the hose, in this case "myscope", and the opened port, in this case "49152", and proceed to try to connect to that computer from the remote compute in the next step.
25 1 Amber Herold
26
27 6 Anchi Cheng
h2. Attempt Connection from the Remote Computer
28 1 Amber Herold
29
30 11 Amber Herold
#  remote linux computer> go to the location where Leginon is installed, type the following to find the location:
31 1 Amber Herold
 <pre>start-leginon.py -v</pre>
32 11 Amber Herold
#  remote linux computer> start the 2nd test script with the host name of the microscope computer and its open port
33
<pre>
34
remote linux computer/Leginon>test2.py myscope 49152
35
</pre>
36 1 Amber Herold
You should see something like this:
37 11 Amber Herold
<pre>
38
INFO localtransport server created at location {'instance': <localtransport.Server object at 0x2b08e0d43810>}
39 1 Amber Herold
INFO tcptransport server created at location {'hostname': 'myremote', 'port': 49152}
40
ACCEPTING CONNECTIONS AT:  myremote:49152
41
INFO <class 'event.NodeAvailableEvent'> binding added for destination myremote, method <function printData at 0x2b08e0d51c80>
42
CONNECTING TO:  myscope:49154
43
WARNING localtransport client add failed
44
INFO tcptransport client added
45 3 Anchi Cheng
INFO server location set to to {'TCP transport': {'hostname': 'myscope', 'port': 49154}}
46
hit enter to kill
47
48 1 Amber Herold
INFO handling threaded
49
INFO inserted in queue (class NodeAvailableEvent)
50
INFO <class 'event.NodeAvailableEvent'> handling destination defcon1, method <function printData at 0x2b08e0d51c80>
51
REMOTE CLIENT RESPONDED:  myscope:49154
52
</pre>
53
54
55
If you get the last line "REMOTE CLIENT RESPONDED" with correct hostname and port, the
56
connection is fine. You can go to next section to test Leginon run on the remote
57
computer.
58
59 17 Anchi Cheng
You can ignore the following error message print out in test1.py on the microscope PC when you exit it.
60
<pre>
61
tcptransport.TransportError: No route to host
62
</pre>
63 1 Amber Herold
64
h2. Problem solving tips
65
66
67 15 Amber Herold
*  See Leginon bulletin board thread on "network problem, Leginon not seeing tecnai host":http://emg.nysbc.org/boards/6/topics/3
68 1 Amber Herold
69
70
71
72
h2. Most likely reason for the failure of the test: FIREWALL
73
74
75
76 7 Amber Herold
*  The easiest solution is have the involving computers inside the same firewall.
77 1 Amber Herold
78 23 Anchi Cheng
*  Alternatively, you can
79 25 Anchi Cheng
# add python to firewall application exception OR
80 26 Anchi Cheng
# open [[Ports_used_by_Leginon|specific ports for Leginon system]]
81 23 Anchi Cheng
82
The latter is described in the Leginon bulletin board thread on "network problem, Leginon not seeing tecnai host":http://emg.nysbc.org/boards/6/topics/3
83 1 Amber Herold
84
85
86 27 Anchi Cheng
h2. Another possible reason for the failure of the test: hostname-ip address mismatch
87 1 Amber Herold
88 27 Anchi Cheng
For leginon to communicate through socket, it needs to know the hostname of itself and the other computer it is connected to in both ways.  The hostname also need to map properly to the IP address the partner understand as.
89 1 Amber Herold
90 27 Anchi Cheng
If you are on a dynamically assigned domain name system (DNS), this should all be taken care of.  However, since the local hosts file overwrites the DNS assignment, you should check if you have a mismatch if you do have problem.
91
92
You should therefore check if you have [[add host|added hosts]] to the right files on both sides of the connection.
93
94
To confirm what python thinks the hosname is on its own computer, run the following in python command line:
95 1 Amber Herold
<pre>
96
import socket
97
socket.gethostname()
98 27 Anchi Cheng
</pre>
99
100
You can also get the IP address with this python command after importing socket like above
101
<pre>
102
socket.gethostbyname(socket.gethostname())
103
</pre>
104
105
You should also check what one computer think the another's ip address is through socket connection once you know the hostname for the other computer
106
<pre>
107
socket.gethostbyname('hostname_of_the_other_computer')
108 18 Anchi Cheng
</pre>
109 28 Anchi Cheng
110
h3. What if the host IP address obtained from socket.gethostbyname on a computer with multiple network card is not the network that connects to other hosts involved in Leginon
111
112
You may need to [[reorder the network connections]] so that the appropriate network is the first to access.
113 2 Amber Herold
______
114
115 21 Anchi Cheng
[[Test Leginon on the Computer Controlling the Microscope|< Test Leginon on the Computer Controlling the Microscope]] | [[Run Leginon Client on the Instrument Computers|Run Leginon Client on the Instrument Computers >]]
116 2 Amber Herold
117
______