linux中python demo (magician)


#1

1.将DobotDll/Precompiled/Linux/DobotDll目录下的下面的文件拷贝到DobotDemoForPython目录下
libDobotDll.so.1.0.0,
libQt5Core.so.5.4.0,
libQt5Network.so.5.4.0
ibQt5SerialPort.so.5.4.0

2.DobotDllType.py的load()部分修改:

def load():
if platform.system() == “Windows”:
return CDLL(“DobotDll.dll”, RTLD_GLOBAL)
elif platform.system() == “Darwin”:
return CDLL(“libDobotDll.dylib”, RTLD_GLOBAL)
elif platform.system() == “Linux”:
return CDLL(“libDobotDll.so.1.0.0”, RTLD_GLOBAL)

3.执行时出现下面的错误:
$ python DobotControl.py

Traceback (most recent call last):
api = dType.load()
File “/home/root/workspace_outan/dobotdemo/DobotDemoForPython/DobotDllType.py”, line 430, in load
return CDLL(“libDobotDll.so.1.0.0”, RTLD_GLOBAL)
File “/usr/lib/python2.7/ctypes/init.py”, line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: libDobotDll.so.1.0.0: cannot open shared object file: No such file or directory

有什么解决办法没有?


#2

You have to use a 32 bits system like Ubuntu 32bits


#3

想在raspberry pi 3中执行 python demo.

系统信息如下:
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

执行 python DobotControl.py时即出现最上面的erro。

我就是想在这个raspberry pi 3中执行 python demo.
有什么解决办法呢?

是不是可以不用用编译好的.so文件(/DobotDll/Precompiled/Linux/DobotDll),
而用/SourceCode/DobotDll/src的文件自己编译呢?

编译的命令可以告诉我么?

我不知道生成下面的四个文件,都各自需要哪些source文件。
libDobotDll.so.1.0.0,
libQt5Core.so.5.4.0,
libQt5Network.so.5.4.0
ibQt5SerialPort.so.5.4.0


#4

You have to install Qt or try to get the lib file by extracting the file in a Qt folder.
But the Dll doen’t work in Raspberry Pi because it use a ARM architecture


#5

Thank you for your response.

You have to install Qt or try to get the lib file by extracting the file in a Qt folder.

pi@raspi-outan1:~/workspace/dobotdemo/DobotDemoForQt/Output $ lsal
531203 -rw-r–r-- 1 pi pi 91648 2017-03-08 20:44:39 DobotDll.dll
531204 -rw-r–r-- 1 pi pi 4666368 2017-03-08 20:44:39 Qt5Core.dll
531263 -rw-r–r-- 1 pi pi 851968 2017-03-08 20:44:39 Qt5Network.dll
531265 -rw-r–r-- 1 pi pi 59392 2017-03-08 20:44:39 Qt5SerialPort.dll
531267 -rw-r–r-- 1 pi pi 455328 2017-03-08 20:44:39 msvcp120.dll
531482 -rw-r–r-- 1 pi pi 970912 2017-03-08 20:44:39 msvcr120.dll

But the Dll doen’t work in Raspberry Pi because it use a ARM architecture
⇒You mean I can use those lib files in Qt folder in Non RaspberryPI(non ARM architecture),
but those lib files do not work in Raspberry Pi?

Is any other way to run python demo in RaspberryPi?
for example compile from source code by myself?


#6

precompile文件夹里的动态链接库都是要编译过的,Demo里的动态链接库只在windows下可用