RoboDK Forum
Problem run RoboDK ubuntu- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:无袖长衫DK bugs (//www.sinclairbody.com/forum/Forum-RoboDK-bugs)
+--- Thread: Problem run RoboDK ubuntu (/Thread-Problem-run-RoboDK-ubuntu)



Problem run RoboDK ubuntu-Tonio163-01-25-2019

Hello,

I think there is a bug, on Linux with the latest RoboDK version, in the RoboDK / bin folder, unable to run RoboDK
Only RoboDK-Start.sh is working.

My problem, with my python application, I have to run RoboDK. programmatically (I use RoboLink.py with the "Connect" function). With Windows OK, Linux not OK

Do you have solution please?


RE: Problem run RoboDK ubuntu-Tonio163-01-31-2019

I propose a modification in the code. This allows you to use RoboDK-Start.sh

def start_robodk(command):
print('Starting %s\n' % self.APPLICATION_DIR)
import subprocess
#import time
#tstart = time.time()

from sys import platform as _platform
if (_platform == "linux" or _platform == "linux2") and os.path.splitext(command[0])[1] == ".sh":
p = subprocess.Popen(command, shell=True, executable='/bin/bash', stdout=subprocess.PIPE)
else:
p = subprocess.Popen(command, stdout=subprocess.PIPE)
while True:
line = str(p.stdout.readline().decode("utf-8")).strip()
print(line)
if 'running' in line.lower():
#telapsed = time.time() - tstart
#print("RoboDK startup time: %.3f" % telapsed)
break

#with subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True) as p:
# self._ProcessID = p.pid
# for line in p.stdout:
# line_ok = line.strip()
# print(line_ok)
# if 'running' in line_ok.lower():
# print("RoboDK is running")
# return #does not return!!

import socket
connected = 0
for i in range(2):
for port in range(self.PORT_START,self.PORT_END+1):
self.COM = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.COM.settimeout(1)
try:
self.COM.connect(自我。IP、端口)
connected = self._is_connected()
if connected > 0:
self.COM.settimeout(self.TIMEOUT)
break
except:
connected = connected

if connected > 0:# if status is closed, try to open application
self.PORT = port
break;
elif i == 0:
if self.IP != 'localhost':
break;

try:
command = [self.APPLICATION_DIR] + self.ARGUMENTS
start_robodk(command)
#import time
#time.sleep(5) # wait for RoboDK to start and check network license.
except:
raise Exception('Application path is not correct or could not start: ' + self.APPLICATION_DIR)

if connected > 0 and not self._verify_connection():
connected = 0
return connected


RE: Problem run RoboDK ubuntu-Jeremy-02-08-2019

Hi Tonio163,


Thanks for your feed back, we really appreciate it.
Happy to see that you manage to fix the problem yourself.

Note that we will release a new version for Ubuntu next week with this among other corrections.

Jeremy