Send files to google storage


I´m doing a project that I need send photo to google storage or google drive. I choose google storage, because code is much easier than the other one. The problem is, I need a google library that I install in my computer, but my OpenCam can´t find.

I was proving a lot of things but I can´t find the wat. Thank you very much

The code is the next one:

import network, usocket

import ujson as json

import gc

import urequests

from machine import UART

import time

from pyb import UART

import sensor, image

import uos

from import storage

import os






sensor.skip_frames(time = 2000)

Connect to WiFi

print(“Connecting to WiFi…”)

wlan = network.WINC()

wlan.connect(SSID, key=KEY)

while not wlan.isconnected():


print(“WiFi Connected!”)


Capture an image

print(“Capturing image…”)

img = sensor.snapshot()

os.environ[“GOOGLE_APPLICATION_CREDENTIALS”] = ‘your_credentials’

client = storage.Client()

bucket = client.get_bucket(‘your_bucket_name’) #Here goes the bucket name

blob = bucket.blob(‘img’) #The name of the image

Hi, the python code running on the OpenMV Cam runs on the device itself. Not on your PC. So, you can’t just use desktop libraries with it.

We have a ureqests module that lets you do REST API calls. You should use this to interface with whatever the REST API for the cloud storage is.

Hi, that make sense, but I can´t find the way to do REST API calls. I can´t find it in documentation. Could you help me?