How to install pyserial in wp8548g


#1

I am trying to install any python package in wp8548g.
i am trying with OPKG package manger.
but it shows always. i am root user. but i cannot change the permission.its keep showing same messgae always.
can not create /usr/lib/python2.7/site-package read only system.
for that i have python-pyserial_2.4-ml4.3_armv7a-vfp-neon.ipk file
Is there any mechanism to install package on other directory rather then /usr/lib/python2.7/site-package?
i need to install > python-pyserial to communicate with serial usb device.
so can you pleas guide how to do it either on by default linux in module or re-flash it after custom few configurations.

below is the error log during installation-
root@swi-mdm9x15:~# opkg install python-pyserial_2.4-ml4.3_armv7a-vfp-neon.ipk --force-depends
Installing python-pyserial (2.4-ml4.3) on /home/root/Envs.
Configuring python-pyserial.
Collected errors:

  • satisfy_dependencies_for: Cannot satisfy the following dependencies for python-pyserial:
  • python-io * python-fcntl * python-stringold *
  • extract_archive: Cannot make dir /usr/lib/python2.7/site-packages/: Read-only file system.
  • extract_archive: Cannot make dir /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/SOURCES.txt: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/top_level.txt: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/dependency_links.txt: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/PKG-INFO: No such file or directory.
  • extract_archive: Cannot make dir /usr/lib/python2.7/site-packages/serial/: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialcli.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialwin32.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/init.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialwin32.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialposix.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/init.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/sermsdos.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialjava.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialutil.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialposix.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialutil.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialcli.py: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/sermsdos.pyo: No such file or directory.
  • wfopen: /usr/lib/python2.7/site-packages/serial/serialjava.pyo: No such file or directory.

root@swi-mdm9x15:~# df -h
Filesystem Size Used Available Use% Mounted on
devtmpfs 256.0K 0 256.0K 0% /dev
/dev/ubiblock0_0 24.9M 24.9M 0 100% /
mdev 256.0K 0 256.0K 0% /dev
tmpfs 74.1M 0 74.1M 0% /dev/shm
tmpfs 74.1M 0 74.1M 0% /run
tmpfs 74.1M 64.0K 74.1M 0% /var
tmpfs 74.1M 44.0K 74.1M 0% /tmp
/dev/ubi2_0 16.8M 4.3M 11.6M 27% /mnt/flash
/dev/ubiblock1_0 2.3M 2.3M 0 100% /mnt/legato
/dev/mtdblock5 5.0M 1.3M 3.7M 27% /mnt/userrw
aufs 16.8M 4.3M 11.6M 27% /etc
aufs 16.8M 4.3M 11.6M 27% /data
/dev/ubi2_0 16.8M 4.3M 11.6M 27% /legato
/dev/ubi2_0 16.8M 4.3M 11.6M 27% /home
cgroupsRoot 74.1M 0 74.1M 0% /sys/fs/cgroup
/dev/ubi2_0 16.8M 4.3M 11.6M 27% /legato/systems/current

and from df -h it shows /dev/ubiblock0_0 is fully occupied all space. and from my understanding that’s why the write permissions are removed by admin panel.


#2

Hi Umesh-gp,

The pyserial recipe is available in the meta-python layer at the location yocto\meta-embedded\meta-python\recipes-devtools\python.

You can bitbake the recipe with bitbake python-piserial and add it to the “9615-cdp-sierra-image.inc” file located at “meta-swi-extras/common/recipes/images/9615-cdp-sierra-image.inc”.

To add piserial you will need to add the below line to the file:
IMAGE_INSTALL += “python-pyserial” ///python-pyserial is your recipe name.

Hope this helps.

Thanks


#3

This is now working.

Thanks a lot for this help.


#4

I have found some interesting way to do same without doing much effort work.

Just use opkg config file to install python package in sd card after mounting it.
in my case i mounted it to /media/

then you will have basic structure of folders inside sd card automatically.

then just copy paste all python package from sd card of raspberry pi.

and you can use all your python packages from /media/usr/bin/python
it is working similar to virtual environment for me.

I want to know that if it is good way to execute other python-package depended script.


#5

Hi @umesh-gp,

Can you tell exactly the steps you followed. I am stuck at the same problem. I did a bitbake python-pyserial and then added the line IMAGE_INSTALL += “python-pyserial” to my receipe. And then did a bitbake mdm9x15-image-minimal to generate a yocto_wp85.cwe. When I flashed the image, I still cannot import pyserial in python. Am I missing something?


#6

Hi @virpadte,

What is the exact error you see for import pyserial ? Is it related to importlib? I faced a similar error and you will have to add python-importlib before python-pyserial which should allow you to import pyserial


#7

Can anyone help me get to python working on MangOH as I still understanding yocto project.