Re: Pyro 4 help - please? :)

"Aaron Wylie" <[email protected]> Tue, 21 Oct 2014 20:31:30 -0700
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>

-----Original Message-----
From: Irmen de Jong [mailto:[email protected]] 
Sent: Tuesday, October 21, 2014 3:38 PM
To: [email protected]
Subject: Re: [Pyro] Pyro 4 help - please? :)

On 21-10-2014 22:02, Aaron Wylie wrote:

>>From Aaron 2: I've entered "192.168.1.147  GOATS" into the /etc/hosts 
>>file
> of the pi and I can how ping the windows box from the pi using the 
> windows box name. Cool! Regarding setting up a DNS, is that something 
> out-of-the-box with Windows 7, or do I need a 3rd party app?

Windows Server edition can run a dns server (I believe as part of active
directory) but setting it up is a windows admin task. Alternatively you can
fire up another linux box and run a dns server on that instead (should be a
standard package such as bind).

>From Aaron 3: Good enough on the DNS server. I can figure that all out. It's
working fine now with 'Pyro4.socketutil.getIpAddress("pi-001",
workaround127=True)', so I don't think I need to worry about it too much.



>>From Aaron 2: I was able to use 'daemon = Pyro4.Daemon(host="pi-001")' 
>>and
> it registered with the nameserver (pi-001 is the name of the pi. 
> Original, I
> know.)
> "frequency --> PYRO:obj_45212471e7c741a7b9d0b38f8b875094@pi-001:44441"
> Though, when I called the client.py script it gave me the same error 
> that it was "actively refused". Weird, because pinging pi-001 from 
> Windows 7 returns the pi ip address just fine.

Don't know what's going on there then, sorry.
Does pi-001 resolve to 192.168.1.139?

>From Aaron 3: Yes, I can ping pi-001 from the windows machine and it reads
back nicely. Again, the fix you mentioned about the getIpAddress() function
fixes things nicely. I don't really need to chase this one any further.

> BUT! When I use 'daemon = Pyro4.Daemon(host="192.168.1.139")' in the 
> server function, everything registers and works! Yay!!
> I tried using Pyro4.socketutil.getIpAddress("hostnameofthePi") and it 
> just returned 127.0.1.1 which doesn't help me from the windows 7 side.
> I would prefer to stay away from hardcoded ip addresses if possible.

Try this: Pyro4.socketutil.getIpAddress("pi-001", workaround127=True)

>From Aaron 3: Winner! 

If you don't mind, one question about function call turnaround time. I've
created a simple function on the pi server:
test_func(self): 
   pass 
Basically just to have something to test with from the client side because
my app needs a high level of time precision. 
In the client code I have: 
freq = Pyro4.Proxy("PYRONAME:frequency")
start = time.clock()
freq.test_time()
end = time.clock()
print end-start

My result print at the end varies (1.047, 1.038, 1.024, 1.042....etc.). I
believe those separate results are in seconds from what I understand. Am I
to deduce that the time it takes to perform "freq.test_time()" over my wired
network, which is really just a pass statement, ranges from around 1020
milliseconds to 1050 milliseconds? Should the round trip be taking that
long?



----------------------------------------------------------------------------
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho