PDA

View Full Version : RPC question with Connect


Don Tyszko
08-18-2009, 03:55 PM
When running an application with Connect and remote firmware compiled with Portal 2.218 we are able to execute the sending of an RPC without errors with the example command below, supplied by Synapse:
With an application running Python:

self.srv.rpc(ourAddr, remoteNetAddr, 'vmStat', (10,0))

Even though we did not yet verify if the command made it to the remote, there are no error messages:

If from the same application we run:

self.srv.rpc(ourAddr, remoteNetAddr, 'rpcSendToController', (5))

The error message below shows up on the I/O debug window:
xmlrpclib Fault1 <type exceptions> TypeError object is not ITERABLE
The code at the remote node looks like:
def rpcSendToController(BytesToR):
global temp55
temp55 = BytesToR
where the global and temp55 are indented above
We have been sending RPC's from the remote to the application without problems. Going in the other direction causes the error message and we can't figure out why. Your help will be greatly appreciated.

kbanks
08-18-2009, 07:07 PM
This is really a Mark question, but he is currently on the road (traveling back from a customer site).

As a shot in the dark, try changing


self.srv.rpc(ourAddr, remoteNetAddr, 'rpcSendToController', (5))


to


self.srv.rpc(ourAddr, remoteNetAddr, 'rpcSendToController', (5,))


In other words, put a trailing , (comma) at the end of the list of parameters.

If this is in fact what the problem is, then you have been bit by a Python nuance.

Many people assume it is the () that makes a variable be a tuple but really it is the required ',' that does it.