Error building Pymodbus

Facing error building pymodbus:

Initialising tasks: 100% |#######################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: pymodbus-2.5+gitAUTOINC+731b080df0-r0 do_compile: python setup.py build execution failed.
ERROR: pymodbus-2.5+gitAUTOINC+731b080df0-r0 do_compile: Function failed: do_compile (log file is located at /home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/temp/log.do_compile.15160)
ERROR: Logfile of failure stored in: /home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/temp/log.do_compile.15160
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File “setup.py”, line 28, in
| from pymodbus.utilities import IS_PYTHON3
| File “/home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/git/pymodbus/utilities.py”, line 8, in
| from pymodbus.compat import int2byte, byte2int, IS_PYTHON3
| File “/home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/git/pymodbus/compat.py”, line 15, in
| import six
| ImportError: No module named six
| ERROR: python setup.py build execution failed.
| WARNING: /home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/temp/run.do_compile.15160:1 exit 1 from ‘exit 1’
| ERROR: Function failed: do_compile (log file is located at /home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/pymodbus/2.5+gitAUTOINC+731b080df0-r0/temp/log.do_compile.15160)
ERROR: Task (/home/pankaj/Documents/wp76xx-linuxsrc-rel13.1/yocto/meta-openembedded/meta-python/recipes-devtools/python/pymodbus_2.5.2.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 655 tasks of which 654 didn’t need to be rerun and 1 failed.

Python six is already installed in the image though local.conf
IMAGE_INSTALL_append_pn-mdm9x28-image-minimal = " python-six python-paho-mqtt"

pymodbus recipe is created using the recipetool in Bitbake command:

recipetool -d create -o yocto/meta-openembedded/meta-python/recipes-devtools/python/pymodbus_2.5.2.bb GitHub - riptideio/pymodbus: A full modbus protocol written in python

Attached is the recipe which is giving error .

looking for any modifications required to build the recipe
pymodbus_2.5.2.bb (4.1 KB)

how about adding the following recipe in
./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc

IMAGE_INSTALL_append =" pymodbus"

@jyijyi

Will try the suggestion but I think it should not make a difference as "IMAGE_INSTALL_append_pn-mdm9x28-image-minimal mentions the correct target to add the recipe.

In case if python six is not installed I believe Rdepends should take care of providing a error but it doesn’t. Below is the RDEPENDS from the recipe:

RDEPENDS_${PN} += “python-2to3 python-contextlib python-core python-crypt python-distutils python-io python-json python-lang python-logging python-math python-netserver python-setuptools python-shell python-six python-threading python-unittest”

So ideally I should have got a build error with no provider for Python-six , but rather I see error reported on import statement in compat.py

I believe may have to add some tasks intially before compiling pymodbus

I found that I cannot add
IMAGE_INSTALL_append =" python-pymodbus"

it seems it is not officially supported.

Hi Pankaj,

If you are trying to make a Modbus master, maybe have a quick read of this wiki link,
https://bitbucket.org/m2mconnectivity/pyrtedoc/wiki/Modbus%20master
If it helps, here is the home of wiki which tries to include Python3 and popular modules(such as pyserial, requests) without rebuilding Linux image for Legato modules/FX30s,
m2mconnectivity / PyRTEdoc / wiki / Home — Bitbucket

@billzhou

Yes looking for Modbus master this one looks to be helpful the implementation seems to be based on Minimal Modbus which supports only RTU any suggestions for modbus TCP.

Hi Pankaj,

Here pls find the guide on how to install Python modules without rebuilding image and it uses PyModbus as example,
m2mconnectivity / PyRTEdoc / wiki / Install a Python module — Bitbucket

Hope it helps.

@billzhou

Can you let me know where do we get the pyrte application?

Thanks

Pankaj Sant

Hi Pankaj,

The download page of PyRTE looks not ready. If you’d need it now, please message me your email, with your FX30/WP model and firmware version, I’d be happy to arrange you the installers.

@billzhou ,

you can email me the installers for wp76 rel13.1 firmware on pankajrsant@gmail.com