# How to send code for a robot by tcp-ip

**URL:** https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804
**Category:** Developing Nodes
**Created:** [27 April 2021 12:52 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804 "2021-04-27T12:52:38Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![teixeira\_5213](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teixeira\_5213](https://discourse.nodered.org/u/teixeira_5213)
#### Post date: [27 April 2021 12:52 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/1 "2021-04-27T12:52:38Z")

</div>

Hello,  
I am new in node red and i want do the code implementation for a robot of universal robots, making its sending by the tcp-ip server installed in the red node of my raspberry. Does anyone have any idea how to do it?

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 April 2021 13:06 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/2 "2021-04-27T13:06:21Z")

</div>

Default node-red installation provides tcp nodes.  
Have you tried that ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8519a7b02ffc8a5d2ab261ef7aee3d018f472d8.png)

TCP is pretty low level. Is there not a more high level API available that you can use to interface with your robots ?

---

<div class="post-metadata">

### Author: ![teixeira\_5213](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teixeira\_5213](https://discourse.nodered.org/u/teixeira_5213)
#### Post date: [27 April 2021 13:10 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/3 "2021-04-27T13:10:01Z")

</div>

Hello Janvda,  
I created this, to send a hello via tcp-ip.

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce5dc58b481a08d1616f28c36b4daffc111728f6.jpeg)  
Now I want to programming my robot use this protocol, but i don't know if i have to do a fuction or other thing.

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 April 2021 13:20 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/4 "2021-04-27T13:20:11Z")

</div>

You need to share some more details about your use cases.  
What exactly you want to achieve ?  
Be specific.

---

<div class="post-metadata">

### Author: ![teixeira\_5213](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teixeira\_5213](https://discourse.nodered.org/u/teixeira_5213)
#### Post date: [27 April 2021 13:23 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/5 "2021-04-27T13:23:21Z")

</div>

Basically, I want to send commands to my robot remotely by this protocol.

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 April 2021 13:26 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/6 "2021-04-27T13:26:02Z")

</div>

Didn't you just demonstrate that in your hello world flow that you can send and receive data ?

---

<div class="post-metadata">

### Author: ![teixeira\_5213](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teixeira\_5213](https://discourse.nodered.org/u/teixeira_5213)
#### Post date: [27 April 2021 13:28 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/7 "2021-04-27T13:28:39Z")

</div>

yes. But I don't know how to implement this in the robot and send the code there

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 April 2021 13:30 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/8 "2021-04-27T13:30:16Z")

</div>

Is your robot not running node-red ?

---

<div class="post-metadata">

### Author: ![teixeira\_5213](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teixeira\_5213](https://discourse.nodered.org/u/teixeira_5213)
#### Post date: [27 April 2021 13:39 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/9 "2021-04-27T13:39:09Z")

</div>

In this moment no.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 April 2021 13:50 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/10 "2021-04-27T13:50:48Z")

</div>

So are you asking for help with how to write code to run in the robot? In which case what has that got to do with node-red?

---

<div class="post-metadata">

### Author: ![molesworth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molesworth/32/11748_2.png) [@molesworth](https://discourse.nodered.org/u/molesworth)
#### Post date: [27 April 2021 14:23 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/11 "2021-04-27T14:23:23Z")

</div>

I'm guessing you're asking how to create a set of flows in Node-RED to send commands to make the robot move, e.g. forwards, backwards, turn left, right etc.

Is the robot one you've bought or built from a kit? If it is, then if you can tell us the make and model there may be information online about what commands it expects, and how to connect to it.

---

<div class="post-metadata">

### Author: ![molesworth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molesworth/32/11748_2.png) [@molesworth](https://discourse.nodered.org/u/molesworth)
#### Post date: [30 April 2021 08:55 UTC](https://discourse.nodered.org/t/how-to-send-code-for-a-robot-by-tcp-ip/44804/12 "2021-04-30T08:55:41Z")

</div>

@teixeira_5213 - are you still looking for an answer to this question?

A recent post about controlling a different robot (ABB YuMi) reminded me about your post, and I've noticed that they mentioned "Universal Robots" which I now realise is the type you're working with.

Apparently there is a node and example flow for them which may be what you need, or may help in getting your configuration working.

Node - [node-red-contrib-ur-robot (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-ur-robot)

Flow - [Using Universal Robot Interfaces (flow) - Node-RED](https://flows.nodered.org/flow/0e988d13d3422e1c2ae06d1d78792a56)

As I don't have the required target hardware I can't do any testing, but they may be useful to you.
