Hello,
I'd like to get your advice to solve below issue.
Now I am working on a project to take photos with a Raspberry Pi 3(Model B) by its camera, and upload photo to firebase storage. My 1st step is to upload a JPG file from local folder as a test. I did it on my desktop PC and it looks working fine. I could check it on the firebase storage console. Then I deploy the file to Raspberry Pi and run the same node.js file again, see my My code below. It is interesting to find error message as below.
I understand it is necessary to find clues from Google Cloud Platform. According to advice from forum, I add the permission under "Storage Administration". See screen cut below. But it is not working. I got same error message when running again on RPi3.
I am exhausting to trial run it without clues. I appreciate a lot if some one can help solve it.
A. Node.js file
B. Error Message
pi@raspberrypi:~/CloudMonitor $ sudo node N04_uploadPhotoToFB.js
at Object.parseHttpRespBody (/home/pi/CloudMonitor/node_modules/@google-clou d/common/src/util.js:199:30)
at Object.handleResp (/home/pi/CloudMonitor/node_modules/@google-cloud/commo n/src/util.js:137:18)
at /home/pi/CloudMonitor/node_modules/@google-cloud/common/src/util.js:496:1 2
at Request.onResponse [as _callback] (/home/pi/CloudMonitor/node_modules/ret ry-request/index.js:195:7)
at Request.self.callback (/home/pi/CloudMonitor/node_modules/request/request .js:186:22)
at Request.emit (events.js:159:13)
at Request.<anonymous> (/home/pi/CloudMonitor/node_modules/request/request.j s:1163:10)
at Request.emit (events.js:159:13)
at IncomingMessage.<anonymous> (/home/pi/CloudMonitor/node_modules/request/r equest.js:1085:12)
at Object.onceWrapper (events.js:254:19)
code: 401,
errors:
[ { domain: 'global',
reason: 'required',
message: 'Anonymous users does not have storage.objects.create access to bucket test-9caab.appspot.com.',
locationType: 'header',
location: 'Authorization' } ],
response: undefined,
message: 'Anonymous users does not have storage.objects.create access to bucket
pi@raspberrypi:~/CloudMonitor $ firebase login
C. Firebase Storage Rule
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
D. Google Cloud Platform Environment
