Installing Boto3 onn AirPrime WP7702

Hi,

I like to install Boto3 for AWS on AirPrime WP7702. But it was not successful.

Usually, in normal linux box, just type pip install boto3 to install.

Then I try to download the source file of pip and install
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py

Then python get-pip.py

File get-pip.py, line 24 in

import pkgutil

ImportError: No module name pkgutil

Actually pkgutil should be installed since python 2.3

The current python version is 2.7.

Do you have any idea? Actually how to install AWS SDK for Python on this device.

Thanks,
Wilson

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 = " python-pip"

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

For the python recipes, you can see
https://layers.openembedded.org/layerindex/branch/morty/layer/meta-python/

Sorry! Can you explain in details what to do. I am a newbie to this system.

  1. Download Yocto source (from where? and what to download?)
  2. After adding “python-pip” and changing 48MiB, what should I do?

Thanks,
Wilson

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.

Sorry, to have pkgutil, you should add the following line:
IMAGE_INSTALL_append = " python python-netaddr python-pyroute2"

root@swi-mdm9x28-wp:~# python
Python 2.7.15 (default, Oct 24 2019, 07:44:18)
[GCC 7.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import pkgutil

exit()

Thanks for your info. To run the bash instead of ash on WP7702, how to enable it?
Thanks!

What did you see for “cat /etc/shells”?
In my WP76xx, I can only see “/bin/sh”.

cat /etc/shells
/bin/sh

I am trying to run the following bash script where it was working fine on Raspbian.
https://busted.systems/shell-script-for-S3-upload-via-curl-using-AWS-version-4-signatures

What will happen if you run on wp77?

root@swi-mdm9x28-wp:~/AWS# ./run_s3_upload_1.sh
./s3-upload.sh: line 69: file: not found
date: invalid date ‘tomorrow’
sh: usage: printf FORMAT [ARGUMENT…]
head: invalid option – ‘1’
BusyBox v1.27.2 (2019-08-30 09:18:57 UTC) multi-call binary.

Usage: head [OPTIONS] [FILE]…
Uploading: /home/root/Downloads/20191018001.jpg () to b827eb9b1710:10/_20191018001.jpg

so the script can be run ?

No, it cannot be run. Just wondering if there is a way to install Boto3 on a SD card and run on it as the OS itself cannot be modified.

I don’t see BOTO3 package in yocto, can you use boto?
If yes, please follow the steps below which is tested on my WP76 R13.3:

  1. download the python2.7_packed.tar from here:
    python2.7_packed.tar - Google Drive

  2. scp the tar file to module /home/root

mkdir /tmp/temp_folder
tar -xf /home/root/python2.7_packed.tar -C /tmp/temp_folder
cp -rf /tmp/temp_folder/python2.7_packed/* /usr/lib/python2.7/
rm -rf /tmp/temp_folder/

root@swi-mdm9x28-wp:~# python
Python 2.7.15 (default, Jul 8 2019, 12:11:46)
[GCC 7.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import boto

Thanks for your head up. Unfortunately the /usr/lib/python2.7 directory is the read-only file system; system is not allowed to copy your python there. Any clue to run from the SD card with your python?

Errors



cp: can’t create ‘/user/lib/python2.7/zipfile.pyc’: Read-only file system

Please see the document here(step8) on how to copy file to /user/lib/python2.7/ :