Pi4J / pi4j-maven-archetype

A Maven archetype to remotely build, run and debug a PI4J-V2 program on a target Raspberry Pi
Apache License 2.0
9 stars 4 forks source link

Remote debug hanging #7

Open FDelporte opened 2 years ago

FDelporte commented 2 years ago

Trying to follow the README to do remote debugging.

mvn install= OK mvn antrun:run@exec= OK

mvn antrun:run@debug = stops on `Listening'

[INFO] 
[INFO] ------------------------< com.geekhelp:pitest2 >------------------------
[INFO] Building Raspi Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-antrun-plugin:3.0.0:run (debug) @ pitest2 ---
[INFO] Executing tasks
[INFO] [sshsession] Connecting to 192.168.0.106:22
[INFO]   [sshexec] Connecting to 192.168.0.106:22
[INFO]   [sshexec] cmd : cd '/home/pi/IdeaProjects/pitest2'; sudo '/usr/lib/jvm/default-java/bin/java'  -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=192.168.0.106:1955 -Dfile.encoding=UTF-8  -p /home/pi/IdeaProjects/pitest2/dist/lib -m com.geekhelp.pitest2/com.geekhelp.Main 
Listening for transport dt_socket at address: 1955

Any idea what could be wrong or what can be checked?

Acasmol commented 1 year ago

Have the same issue, but run the mvn goal directly on console, and got this:

image

The default por for debug is 1955, which should be enabled on Raspberry Pi, but not shure how to do that.

Acasmol commented 1 year ago

I got a solution On raspberry pi I used "sudo ufw allow 1955"

Then, on a separate console (I use Git bash) on my local machine I run "mvm antrun:run@debug" and you should get what you are getting, then, on eclipse, set up a debug configuration as "debug java remote app", and put the ip addres of my raspberry pi and the port 1955, and go on