Run remotely does not connect to remote computer

I’m trying to run a desktop ap remotely on a raspberry. The remote computer is running the 64bits version of the raspberry OS.

1/ Configured a shared folder on the Raspberry, using SMB, mount the folder on my Mac (M1, running latest version of OSX) and copy the ‘Remote Debugger Desktop’ for Linux Arm-64 there.

2/ Connect with VNC to the raspberry and unpack the archive transferred in (1), launch the remote debugger and got the message ‘Listening on port 44553’, IP address is 192.168.1.191, name is raspberrypi04.

3/ Back to Xojo, open a desktop app and configure via ‘Run remotely / setting’, define an entry with same computer name (raspberrypi04) , ip address as above (192.168.1.191) then set the app the app type for Linux to ARM-64 Bits. Unchecks the ‘build for this computer’ checkbox, since some libraries are missing in the generated Linux app when building with both ‘Linux’ and ‘This computer’ checked (at least file ‘XojoGUIFrameworkARM64.so’ was missing from the Linux Libs folder)

4/ Run remotely on raspberrypi04, got the message ''Failed to connect properly. The remote debugger stub could not be reached on the target computer"

5/ Create a small app opening a TCPSocket to 192.168.1.191, with port set to 44553 and connection goes thru (LittleSnitch asks for authorisation) , did the same with a UDPSocket.

6/ Started WireShark to track host 192.168.1.191 (the raspberry)

7/ When I run the test app, I can see outgoing traffic from my Mac to the Raspberry IP address

8/ When I try ‘Remote debugging’, I do not see any outgoing traffic.

9/ Created a small desktop app to listen on a TCP socket or a UDP socket, moved the app to the raspberry via shared SMB folder, ran again the tests shown in (5), and can connect and exchange data in both cases (TCP and UDP) on port 44553.

My diagnostic (please tell me what assumption is wrong)

1/ I can connect from the Mac to the raspberry with VNC and SMB, so LittleSnitch is not blocking that IP

2/ I can connect from the Mac to the raspberry with UPD and TCP socket, so again nothing prevents that connection to happen.

3/ something prevents the remote debugger to start.

Is there a log where I can find more info about what is happening when I try remote debugging.

When your built app says “cannot connect to remote debugger”, that means that it cannot contact Xojo running on your development machine. I don’t see that you tested the network from the Raspberry to the Mac, so that’s your next step.

Are you using the Desktop or the Console debugger stub?
Ah, I see you answered that.

Oh wait. The folder that the debugger stub saves into must be writable. Open the preferences and set that to something you know has the right permissions.

FWIW, you don’t need to set the build target flags when remote debugging as long as the stub itself is for the correct OS and processor.

The remote debugger is instable, disconnects alot and is 99% of the times unable to connect or keep a connection. For example sending may work sometimes but the app will never auto-launch if the setting is set. I’ve tried and tried, even read the manual but still no working remote debugger.
Even given up on the issue cases cause nothing seems to make result here.
Connection works then suddenly some side report “Connection closed” after “Hello” “olleh”
So connecting works, but xojo somehow closes the connection for some ever unknown reason.

Even sudo won’t help with this. So that’s definately not the issue here.

@Serge_Louvet1 you can try to run the remote debugger on the Pi then close (completely) the IDE and then reopen the ide and re-connect (run on the pi target again).
1% of the times i tried, this worked.

That message “Failed to connect…” appears on the dev machine (the Mac) when I select ‘Run remotely’ from the IDE targeting the raspberry. My understanding (but please correct as needed) is that the ‘remote debugger app’ is a server waiting for a connection from Xojo.
Now, I switched off the raspberry and ran the test program again (on the Mac) opening a TCP or a UDP connection to 192.168.1.191 (the raspberry) The Wireshark trace shows an outgoing request from the Mac, request that does not get any answer (obviously, as the raspberry is off) When I run ‘remote debuggin’ from the Mac, I do not see any outgoing request in the Wireshark trace, hence my (maybe incorrect) assumption that something else is at play.

Ok. Thanks for that one. I wrote a small app waiting for a connection and moved it to the raspberry. The first attempt, the build settings for ‘this computer’ and ‘Linux’ were checked. I moved the compiled app to the raspberry. It failed because at least one library file (XojoGUIFrameworkARM64.so) was missing. Compile again after deselecting the ‘this computer’ option, and all required .so files were present.

Thanks. The folders where the remote debugger stub is located are chmod 777, recursively. Also, shouldn’t I see a request from the Mac (where the IDE is running) to the Raspberry in the Wireshark trace when I start ‘remote debugging’ ? The filter is set to ‘host 192.168.1.7’ which the ip address of the Mac. Also, any attempt to send something via TCP or UDP triggers a prompt from Little Snitch, but I only the error message shown in the original post when I try ‘remote debugging’, nothing from LittleSnitch. Thanks again for helping.

Thanks for the suggestion. Tried but same results. I also tried after rebooting the Mac and the raspberry, start the remote debugging stub then the IDE. Same results.

I take it that you have checked using this menu item:

Project → Run Remotely → Setup …

that the actual IP address of the RPi is what the IDE is using?

Ok. SO, I moved the app sending something on TCP or UDP to the raspberry (updating the destination ip to the Mac ip) and started the app waiting for a tcp connection or polling the UDP port on the Mac. From the raspberry, I sent a message over a tcp connection and a datagram over UDP, both of them reached the app running on the Mac.

Is there a firewall active on the Pi?

Xojo and the remote debugger have to communicate over the network. If that is blocked by the firewall it will fail.

Yes. I setup an entry there for the raspberry with IP address set to the address shown by the debugging stub on the raspberry. According to Wireshark, nothing leaves the Mac when I start ‘remote debugging’, also I do not get a warning from LittleSnitch.

Humph. Nothing more to suggest, then, sorry. I do that debugging from a Mini to an RPi on the same LAN (both using ethernet) with no trouble.

Disable the firewall on the Pi and see if everything works. If so then you have something to aim at. I’ve certainly used remote debugging on the same network and over a virtual network to a virtual machine on the same host.

Thanks for helping.
Seems there is something called iptables.
My reasoning (maybe wrong) is

  • if I can send a datagram over UDP to an app running on the raspberry polling the port 44553, if I can send something over TCP to an app running on the raspberry waiting for a connection on port 44553, then the IDE should be able to reach the debugging stubs running on the raspberry waiting on 44553. I do not run the test program and the debugger stub at the same time.
  • if the Mac sends something to the raspberry, maybe blocked by a firewall, I should be able to see the outgoing request in the Wireshark trace.
    To be on the safe side, I ran ‘sudo iptables --policy INPUT ACCEPT’ and the same for OUTPUT. Restarted the raspberry and quit Xojo. Launched the remote debugging stub on the raspberry, the started the IDE and tried ‘run remotely’ but got the same problem.

Ohh. Is it possible that Xojo has a problem opening the connection over Wifi ?