Checking to see if connectivity works between multiple instances.  I started by making the RemoteAdapter capable of scanning.  Here 2 instances are connected together - the default way now to avoid name clashes - is the remote instance names are appeneded to the gateway (RemoteAdapter) used for connectivity. I think I made this so in the future you could choose the name - for example myo prefix ...

myo.gui, myo.runtime, myo.etc...

I'd be interested in quickly getting this coded up in the webgui....

The RemoteAdapter allows connectivity over tcp & udp.. the webgui potentially offers connectivity over http..

So for Alessandruino, it looks like most is worky on the develop branch...

A RemoteAdapter in each instance is required.. and to start listening you must use the method remote.startListening()..

Noticed a bug in that if a service created after the connection is not registered in the remote system .. hmm maybe this was by design ...

Anyway you can see data from one streaming to the other with the clock sending out pulses and changing the display in the remote instance...

Potentially we could get an instance running on the internet and try some experiments with a larger distributed system - where the senario might be running ProgramAB in the shoutbox and having other ProgramABs connected and utilizing utterances of both other chatbots & humans...

 

Alessandruino

8 years 7 months ago

Tested with clock and it's worky yay !

On another side tried with arduino and it connected/disconnected very quickly... Maybe it's gui fault ?

How i can do it without using the gui if that it's the problem?

Ale

Yep, it was what I expected...  The Arduino Sketch was not serializable .. so it went BOOM instead of flowing over the wire ... fix checked in - worky now ;)

Worky now !!!! :)

one bug i noticed : the drop menu with serial ports in arduino.serial is worky on the local instance (arduino.serial) but is no worky from the remote instance (remote.arduino.serial) 

Another thing how do i access the remote services in the local python ???

thanks again

Ale

There's lots of ways to fix this.  Once change which happened recently is we dropped RXTXLib for JSSC Yay ! - but there needs to be some work done in order for it to behave like we want it ...

Also there is "Fixed in getting it to work in Python", "Fixed in getting it to work in GUIService" and "Fixed in getting it to work in WebGUI"

.. programmatically (Python) is the most important - but it would be nice to get one of the GUIs to work so anyone could use it that way...

So :
Please tell me how exactly you intend to use it ... e.g.

RasPi without desktop to conserve resources, will be running a headless MRL - it will be connected to an Arduino and that will be connected to my DIY Myo ..  need that to transmit data to Laptop ..

Is that right ?

Alessandruino

8 years 7 months ago

In reply to by GroG

Ya.. Headless on pi... Real myo is on my Mac and send instructions to the remote arduino on raspi... I would like to know how to access the remote service from the local python... Remote.arduino.connect(port) is no worky.. Says that remote has no arduino but I see it on the gui

GroG

8 years 7 months ago

Ok my friend ... this worky for me ..
Take the latest - there were some serializaiton issues which I fixed ..

The difference is you will be sending commands to a "real" raspi while I sent commands to a windows platform.

It "should" work the same - but I'll be getting a raspi + arduino set up soon..

Here you can see my pretend mac & pretend raspi

One problem you had previously in Python is "." is an operator ... e.g.    object.method  ..
but the name had a dot in it "remote01.arduino"

So you would have to :
myArduino = Runtime.getService("remote01.arduino")  ... 
or if I remember correctly the Python service changes invalid names to variables like this ...
remote01_arduino.connect("COM18")  <- but even though this is correct notation it would not work - because .connect works locally...   what you really want to do is send a message to connect...

This is easily done this way :

python.send("remote01.arduino","connect","/dev/ttyACM0")

[[home/GroG/remote.py]]

 

laia

7 years 11 months ago

I was trying to start the clock remotely by code and i tried this:

PC listenner:

clock = Runtime.start("clock","Clock")
remote2 = Runtime.start("remote2","RemoteAdapter")
remote2.startListening(6767)

 

PC remote:

remote = Runtime.start("remote","RemoteAdapter")

remote.setDefaultPrefix("myremote")

remote.connect("tcp://myIp:6767") 

sleep(4)

myremoteclock.startClock()

 

It shows no errors and the connection is ok but it makes no effect to the clock. Why doesn't it work?

Thanks!

Ahoy laia and Welcome !

The reason its not working is because you are calling the service directly.  If you used messages it would work.

Fortunately, ALL MRL methods are reachable through the messaging interface.

The GUI uses the messaging interface exclusively - that's why it works over remote connections

Try this:
python.send("myremoteclock", "startClock")

should work :)