Using WebSocket on WP7605

I would like to run WebSocket (using python ).
So, I can not find pip or apt-get command.
I tried install pip ↓,

curl -kL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python
but I cannnot installed because of ImportError.
ImportError: No module named pkgutil

How I can use WebSocket?

you need to rebuild yocto to include the required library:

But I don’t see there is official recipe for python websocket.

You can try the following to import websocket

  1. Download the WP76 R16.0.1 yocto source code

  2. put the following python-websocket_0.2.1.bb files in ./meta-openembedded/meta-python/recipes-devtools/python
    python-websocket_0.2.1.bb (580 Bytes)

  3. in ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc, add the following:
    IMAGE_INSTALL_append = " python-websocket"

  4. type make to build the yocto image, but there is no need to download the yocto cwe image as there are extra libraries which are needed to load to WP76 module

  5. the required library will be built in following paths:

./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python-websocket/0.2.1-r0/image/usr/lib/python2.7/site-packages

./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python/2.7.15-r1/image/usr/lib/python2.7/

  1. upgrade the WP76 module to R16.0.1

  2. The required libraries are packed in the following python_websocket_binary.tar. You can transfer this file to /home/root of module by SCP tool

python_websocket_binary.tar (672.5 KB)

  1. type the following command to extract the python_websocket_binary.tar to /tmp folder of module

tar -xf /home/root/python_websocket_binary.tar -C /tmp

  1. type the following to copy the libraries to correct path:
mkdir /tmp/tmp_usr_lib/;mkdir /tmp/tmp_usr_lib_wr;
mount -t overlay overlay /usr/lib -o lowerdir=/usr/lib,upperdir=/tmp/tmp_usr_lib,workdir=/tmp/tmp_usr_lib_wr;
cp -rf /tmp/python_websocket_binary/usr/lib/python2.7/* /usr/lib/python2.7/
  1. Now websocket can be imported inside python:
root@swi-mdm9x28-wp:~# python
Python 2.7.15 (default, Aug  3 2021, 08:12:13)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import websocket
>>> exit()
root@swi-mdm9x28-wp:~#