# Replace MyDaemon demo server with python socket

**URL:** <https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456>\
**Category:** URCap Development\
**Created:** [August 7, 2018, 7:36pm UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456 "2018-08-07T19:36:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [August 7, 2018, 7:36pm UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/1 "2018-08-07T19:36:36Z")

</div>

I’d like to replace the XML-RPC server in the MyDaemon demo with a simple python server socket (this echo server example: [17.2. socket — Low-level networking interface — Python 2.7.18 documentation](https://docs.python.org/2/library/socket.html#example) ). I removed all the XML Client references in the demo and changed the executable URL to point to a new python script. It builds but I can’t get it to run, either in the ursim or on the real robot. It says “Daemon Failed” and I can’t open a client socket to connect to the server.  
I’m looking for advice to launch a simple server like this and/or debug pointers to see what is actually going wrong. thanks!

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [August 10, 2018, 7:18am UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/2 "2018-08-10T07:18:22Z")

</div>

Hi @anon39143414,

Are you sure your python script runs without errors? Does it work if instead of starting it through Polyscope, you just run it from the command line?

---

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [August 10, 2018, 2:00pm UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/3 "2018-08-10T14:00:24Z")

</div>

yes, it runs on its own

---

<div class="post-metadata">

**Author:** ![anon90783502](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon90783502](https://forum.universal-robots.com/u/anon90783502)\
**Post date:** [August 13, 2018, 6:41am UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/4 "2018-08-13T06:41:26Z")

</div>

Make sure you run Polyscope with admin right on the ursim to be able to run the Daemon. On the actual robot the Daemon should run if it has no errors. If you run the Polyscope from the terminal on the ursim you can see if there any errors in the urcap.

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [August 15, 2018, 8:56am UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/5 "2018-08-15T08:56:32Z")

</div>

Did it run ok before you made any changes? Are you using the latest starter package virtual machine? I’ve just tried to compile and run it on my starter package vm and the daemon doesn’t seem to run even with superuser permissions, so perhaps the issue is not related to the changes you’ve made.

---

<div class="post-metadata">

**Author:** ![anon94885752](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anon94885752](https://forum.universal-robots.com/u/anon94885752)\
**Post date:** [May 21, 2019, 12:43pm UTC](https://forum.universal-robots.com/t/replace-mydaemon-demo-server-with-python-socket/2456/6 "2019-05-21T12:43:50Z")

</div>

Might be a bit late reaction, but i’m trying to bypass the deamon part too and just start a .py server socket so i can control a festo motor. Is there a way to execute a python file form an URCap? My product owner wants everything in one URCap instead of have a seperate python file on the linux system…
