torayeff / fanucpy

Python Interface for FANUC robots
Apache License 2.0
109 stars 29 forks source link

Connectivity issue #3

Closed nilic993 closed 1 year ago

nilic993 commented 2 years ago

Hi torayeff, I'm having trouble sending commands to my Fanuc robot through MAPPDK. I'm fairly certain it has little to do with your driver and more with network communication, but maybe you've ran into similar issues while coding or testing the driver.

I went through all of the instructions in the FANUC MAPPDK Driver readme, and MAPPDK is (apparently) running fine on my controller. The only part I've skipped is the logger on port 18736 (for now). The robot (CRX-10ia) and the laptop from which I want to issue commands through fanucpy (an Ubuntu machine) are in the same subnet, with IPs ending with .10 and .100 as in the readme. I've disabled DHCP via the teach pendant.

With all that set up, I try running a sample python file to send a command to the robot and get this error:

File "/home/wherever my script is/test.py", in connect self.comm_sock.connect((self.host, self.port)) ConnectionRefusedError: [Errno 111] Connection refused

The machines see each other and can ping between them.

torayeff commented 2 years ago

When you run MAPPDK on robot controller, it automatically starts both MAPPDK_SERVER and MAPPDK_LOGGER. Can you please share the following details:

  1. Does teach pendant display that both services have started?
  2. Which command is the reason for error?
  3. In which mode is robot controller (Auto, T1, T2)?

I usually put the robot on Auto mode and press cycle start on robot controller to start both services.

nilic993 commented 2 years ago
  1. As far as I can tell only the SERVER is running, because I've started the program from the file list on the teach pendant
  2. The robot.connect() command, the error is returned immediately so I don't think that there's even a proper attempt to establish communication
  3. I don't have a switchbox with my arm so I'm assuming it's locked into T1 mode

Here's how running MAPPDK looks on my pendant:

p

At any rate I'm probably not launching MAPPDK correctly, I transferred the files to the controller and I'm launching the mappdk_server.pc file.

torayeff commented 2 years ago

One problem might be with the server setup. Can you please double-check that the port on your robot controller is 18735 and server tag is 8?

nilic993 commented 2 years ago

1

This looks right to me. There definitely is some kind of connection (which is being refused), because I get a different error (113: No Route to Host) when I unplug the ethernet cable.

torayeff commented 2 years ago

Can you please drop me a message via torayeff@gmail.com? We can arrange a video call to resolve this issue.

matteotagliavini commented 1 year ago

Hi, I have the same connectivity problem. In particular, i can't load the ".ls" extension file (mappdk.ls). Any suggestion? Thank You.

torayeff commented 1 year ago

Can you please elaborate more on not being able to load ".ls" extension file? What errors do you get?

matteotagliavini commented 1 year ago

fanuc

This is the error when i try to load file "MPPDK.ls " from USB device (downloaded from your repository).

I also realized that I only have the R648(User Socket Messaging) modules on ​​the controller. Can I communicate with the robot via Python script only with User Socket Messaging or do I need the R632(Karel) modules?

Thank you.

torayeff commented 1 year ago

If you cannot load, then just create a TP program with the following 2 lines:

RUN MAPPDK_SERVER
RUN MAPPDK_LOGGER

I think some controllers do not show the availability of R632 but it is available by default. So you should be ok.

gavanderhoorn commented 1 year ago

@matteotagliavini: your controller doesn't have the Ascii Upload option. That's why you can't load the .ls.

matteotagliavini commented 1 year ago

server_logger

image

@torayeff These are my screens. Loggers and servers seem to be working. When i try to connect with python the connection fails (italian). (192.168.0.1 is the IP address I configured on the controller while following your guide)

torayeff commented 1 year ago

@matteotagliavini Can you please confirm that your computer and robot in the same network? What is your local IP?

Do they follow the same subnet, i.e.,

Robot Controller: 192.168.0.1
Your PC: 192.168.0.X
matteotagliavini commented 1 year ago

Yes, i connect PC and Robot with Ethernet cable. Should i connect them with a Switch or router ?

Thanks.

torayeff commented 1 year ago

The ethernet cable is the preferred option. It does not matter how you connect them. They just need to be in the same network.

torayeff commented 1 year ago

If you don’t mind can you paste the output of cmd command IPCONFIG?

matteotagliavini commented 1 year ago

image @torayeff

torayeff commented 1 year ago

Ok. I see it. Can you please change the robot controller IP address to 192.168.0.63 and if that does not work drop me an email and we can arrange a zoom call.

matteotagliavini commented 1 year ago

@torayeff Thank you so much for the advice. I configured the robot through the router and now I can connect PC and Robot. But when i try to make a move instruction via python (robot.move() ), the TP gives me error "call program failed". Any advice?

torayeff commented 1 year ago

@matteotagliavini You are welcome. This might be because of the following:

  1. You are running the script in T1/T2 mode. In that case, you need to either switch to Auto mode or keep pressing the deadman switch on the teach pendant.
  2. You might be missing the mappdk_movel.ls and mappdk_move.ls files.

Let me know how it goes.

matteotagliavini commented 1 year ago

@torayeff Yes now the movements work too. I had to convert the files you told me to .TP format because our controller doesn't load .LS format as i mentioned before. Thank you so much bro.

torayeff commented 1 year ago

@matteotagliavini, you are welcome. I am closing the issue.

madinwei commented 1 year ago

Hello @torayeff , thank you for this awesome code, I am trying to use Roboguide however I also got connection problem. when I run the demo.py I get this error:

Exception has occurred: TimeoutError
[WinError 10060] A connection attempt failed because the connecting party did not properly reply after a period of time or the connected host became unresponsive.
  File "E:\FANUC\fanucpy-main\src\fanucpy\Robot.py", line 74, in connect
    self.comm_sock.connect((self.host, self.port))
  File "E:\FANUC\fanucpy-main\src\demo.py", line 14, in <module>
    robot.connect()
TimeoutError: [WinError 10060] A connection attempt failed because the connecting party did not properly reply after a period of time or the connected host became unresponsive.

I am novice in using FUNCA robot still learning but I tried to follow your guide step by step. so i am not sure where i did wrong. here is my ipconfig in cmd:

(frp) C:\Users\admin>ipconfig
Windows IP configuration
Unknown Adapter Astrill VPN:

    Media Status . . . . . . . . . . . : Media Disconnected
    Connection-specific DNS suffix . . . . . . . :

Ethernet Adapter Ethernet:

    Connection-specific DNS suffix . . . . . . . :
    Link-local IPv6 address . . . . . . . : fe80::b095:5674:4d85:dcd8%14
    IPv4 address . . . . . . . . . . . : 192.168.124.13
    Subnet mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway. . . . . . . . . . . . : 192.168.124.1

and here is config from my simulated pendant: image image

torayeff commented 1 year ago

Hi! Try the localhost ip 127.0.0.1 for the roboguide connection.

madinwei commented 1 year ago

Hi! Try the localhost ip 127.0.0.1 for the roboguide connection.

@torayeff Thank you so much it worked with the default IP. but after I check the TCP/IP I understand that the init button doesn't save any change, so that is the reason, how I can fix it if you have any idea, here is a screenshot: image as you see in the pic, ethernet init fail so how I can fix it?

torayeff commented 1 year ago

“Ethernet init fail” also happens with me every time when I use roboguide. Despite that it works alright with me. Honestly, I have no idea why it behaves that way 🤦‍♂️

gavanderhoorn commented 1 year ago

Roboguide is a simulator, not a real controller.

There is no need to configure IPs, nor would any of the settings really work, as Roboguide binds ports on the localhost adapter of the Windows OS on which it is running.