ScreenRemote - help please?

Asked by Southy

Hi,

I downloaded the Maven repository (I hope) and had a go at getting ScreenRemote to work on a Virtual Machine (running Xubuntu).
The host is Windows.

I got the server to run on the VM but when I try and click on an image (taken on the VM), it clicks an image on the host machine.
Obviously, I haven't got something right!

Here is the Java on the host:-
        public static void main(String[] args) throws InterruptedException {
                ScreenRemote s = new ScreenRemote(ipaddr, port);
                try{
                 Thread.sleep(10000);
                 s.click("C:/Users/xxxxx/workspace/Sikuli/TryRemote/imgs/Firefox_BackButtonLinux.png", 0);
                }
                catch(FindFailed e){
                    e.printStackTrace();
                }
        }

and the console output from Eclipse:-

Mar 15, 2014 10:31:09 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[error] ImagePath: setBundlePath: Settings not changed: invalid BundlePath: null
[error] ResourceLoader: check: The jar in use was not built with setup!
We might be running from local Maven repository?
C:/Users/xxxxxx/workspace/Sikuli/SikuliX-Basics/target/classes/
[log] CLICK on L(19,117)@S(0)[0,0 1366x768]

and the output from the VM server:-

[info] ScreenRemoteServer: now waiting on port: 50000 at 127.0.1.1
[info] ScreenRemoteServer: now handling client: Socket[addr=/192.168.1.2,port=51534,localport=50000]
[info] ScreenRemoteServer: processing: SYSTEM
[info] ScreenRemoteServer: returned: LINUX 1
[info] ScreenRemoteServer: processing: BOUNDS 0
[info] ScreenRemoteServer: returned: java.awt.Rectangle[x=0,y=0,width=1024,height=768]
[info] ScreenRemoteServer: processing: CAPTURE 0 0 1024 768
[info] ScreenRemoteServer: Capture: java.awt.Rectangle[x=0,y=0,width=1024,height=768]
[info] ScreenRemoteServer: returned: Image(1024x768)
[error] ScreenRemoteServer: Exception while processing
No line found
[info] ScreenRemoteServer: stop client handling requested

I realise that getting ScreenRemote isn't a top priority for you at the moment but I'd appreciate any input you might have.

Thanks,
Mark

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

I am on vacation for another week. So no debugging now.
Try:
s.click(s.find(...))

Revision history for this message
Southy (mark-southward) said :
#2

Hi again,

I got the click working (thanks for the hint), converted all my test application code but when I ran it, I ran out of heap memory in the remote server.

So, I changed the jvm to have more memory and then the client code (in eclipse) ran out of heap memory.

I cut down the code to just a bare minimum and still the server (back at the default memory size) ran out of memory very quickly (maybe 10-15 iterations) :-

@Test(enabled = true)
public void trySikuli() throws Exception {
    screen = new ScreenRemote(hubIPaddress, "50000");
    for(int i=0; i<=40; i++) {
        screen.capture();
        Thread.sleep(5000);
    }
}

Do you have some thoughts (and maybe solution)?

Thanks,

Mark

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Uuups, seems to be a design bug.
Some kept objects not getting eligible for GC.

I am very short on time currently for Sikuli, so you have to wait some days without any promise, sorry.
Feel free to have a short look into the server code (rather small ;-).
If you find anything obvious, I will fix it immediately.

Revision history for this message
Southy (mark-southward) said :
#4

Hi,
Thanks for the answer.
I did have a quick look at the code before I posted but my coding skills are not the best and I didn't manage to solve the issue.
I have, however, a work round which seems to work (though not pretty) which alleviates my short term issue.

Does this need to be a bug report?
(I will have another look when I get some more time).

Revision history for this message
RaiMan (raimund-hocke) said :
#5

No bug report needed, I will test it the next days anyway.
thanks.

Can you help with this problem?

Provide an answer of your own, or ask Southy for more information if necessary.

To post a message you must log in.