# Using WebSocket on WP7605

**URL:** <https://mangoh.discourse.group/t/using-websocket-on-wp7605/9663>\
**Category:** Uncategorized\
**Created:** [September 16, 2021, 8:41am UTC](https://mangoh.discourse.group/t/using-websocket-on-wp7605/9663 "2021-09-16T08:41:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoheifujimitsu](https://avatars.discourse-cdn.com/v4/letter/y/7feea3/32.png) [@yoheifujimitsu](https://mangoh.discourse.group/u/yoheifujimitsu)\
**Post date:** [September 16, 2021, 8:41am UTC](https://mangoh.discourse.group/t/using-websocket-on-wp7605/9663/1 "2021-09-16T08:41:12Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [September 16, 2021, 9:39am UTC](https://mangoh.discourse.group/t/using-websocket-on-wp7605/9663/2 "2021-09-16T09:39:50Z")

</div>

you need to rebuild yocto to include the required library:

> **[Installing Boto3 onn AirPrime WP7702](https://forum.sierrawireless.com/t/installing-boto3-onn-airprime-wp7702/18683/4)**
>
> You can download the yocto source code here https://source.sierrawireless.com/resources/airprime/software/wp77xx/wp77xx-firmware-release-12-components/#sthash.VQOzZQNn.mvJDJnaN.dpbs To make the yocto image, just type make.

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

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 28, 2023, 5:19pm UTC](https://mangoh.discourse.group/t/using-websocket-on-wp7605/9663/3 "2023-06-28T17:19:27Z")

</div>

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](https://mangoh.discourse.group/uploads/short-url/z9ZBaMRCbRUTrJy6ucFkmbmyG8j.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](https://mangoh.discourse.group/uploads/short-url/qC41UvdgdIXMKbHKs3FFDZSCHLG.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:

```auto
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:

```auto
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:~#

```
