Building Custom Yocto Image for Mangoh Red WP76

You can follow the steps below to run python3:

  1. download the yocto source and go to ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc

  2. add the following line:
    IMAGE_INSTALL_append = " python3"

  3. go to ./meta-swi/meta-swi-mdm9x28/conf/machine/swi-mdm9x28.conf
    change UBI_ROOTFS_SIZE ?= “48MiB”

  4. Make the yocto image ( there will be error to make the image, but we can build the binary of python3)

  5. on PC, type :
    sudo ifconfig usb0 192.168.2.3

  6. on module, type :

mkdir /tmp/tmp_usr_bin/;mkdir /tmp/tmp_usr_bin_wr;
mount -t overlay overlay /usr/bin -o lowerdir=/usr/bin,upperdir=/tmp/tmp_usr_bin,workdir=/tmp/tmp_usr_bin_wr;

mkdir /tmp/tmp_usr_include/;mkdir /tmp/tmp_usr_include_wr;
mount -t overlay overlay /usr/include -o lowerdir=/usr/include,upperdir=/tmp/tmp_usr_include,workdir=/tmp/tmp_usr_include_wr;

mkdir /tmp/tmp_usr_lib/;mkdir /tmp/tmp_usr_lib_wr;
cp -rf /usr/lib/* /tmp/tmp_usr_lib/
mount -t overlay overlay /usr/lib -o lowerdir=/usr/lib,upperdir=/tmp/tmp_usr_lib,workdir=/tmp/tmp_usr_lib_wr;

mkdir /usr/lib/python3.5

  1. on PC, type :
    scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/include/* root@192.168.2.2:/usr/include
    scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/bin/* root@192.168.2.2:/usr/bin
    scp ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/libpython3.5m.so ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/libpython3.5m.so.1.0 ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/libpython3.so root@192.168.2.2:/usr/lib
    scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/pkgconfig root@192.168.2.2:/usr/lib
    scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/encodings/ root@192.168.2.2:/usr/lib/python3.5
    scp ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/*.py root@192.168.2.2:/usr/lib/python3.5

  2. now on module, you can use python3:

root@swi-mdm9x28-wp:~# python3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
Python 3.5.5 (default, Oct 24 2019, 07:42:55)
[GCC 7.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

^C
KeyboardInterrupt
exit()