# Telnet Comm Troubleshooting Camera Trigger

**URL:** <https://forum.universal-robots.com/t/telnet-comm-troubleshooting-camera-trigger/29266>\
**Category:** Robot Communication\
**Created:** [June 28, 2023, 11:56am UTC](https://forum.universal-robots.com/t/telnet-comm-troubleshooting-camera-trigger/29266 "2023-06-28T11:56:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezebot\_1](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@ezebot\_1](https://forum.universal-robots.com/u/ezebot_1)\
**Post date:** [June 28, 2023, 11:56am UTC](https://forum.universal-robots.com/t/telnet-comm-troubleshooting-camera-trigger/29266/1 "2023-06-28T11:56:50Z")

</div>

I am having trouble triggering a Cognex camera via Telnet from a UR script. I can send the command through a telnet connection to the camera from my laptop to trigger the camera. However I don’t get a response when doing this through the UR Script.

I referenced this thread along with others that gave me a hint that this can be done and I shouldn’t give it yet.

> [@\[SOLVED\] Telnet Comm through socket connection](https://forum.universal-robots.com/t/solved-telnet-comm-through-socket-connection/1372):
>
> Hi all, I am trying to login to an external device via Telnet socket communication that has a user/pass field, but without success. Currently, I can login onto the device (on a Unix machine) with the telnet command. Upon successful connection, I get this response, where \<input\> is my input for each field: telnet xxx.xxx.xxx.xxx 23 User:\<input\> Pass:\<input\> And I am successfully logged on. I am trying to mimic this with URScript (abridged version): 1 socket\_open(“xxx.xxx.xxx.xxx”,23) …

I have a script file in the before start as shown below.  
**Before Start**  
global Conn= False  
def ConnCameraTelnet():  
while (Conn == False ):  
global Conn=socket\_open(“x.x.x.xxx”,23)  
popup(“socket open”, “Message”, False, False, blocking=True)  
end  
end  
def telnet\_send(str):  
socket\_send\_string(str)  
socket\_send\_byte(13) #send carriage return (CR)  
socket\_send\_byte(10) #send line feed (LF)  
end  
The main robot program looks like this and I have turned off loop forever.  
**Robot Program**  
4 ConnCameraTelnet()  
5 telnet\_send(“sw8”)  
6 Wait: 5.0

Please let me know if you see anything that I need to change. Note: I have the camera set to Industrial Ethernet.
