Control smartphone camera with Node red installed on Android

Try googling “termux file location”?

Probably best to specify the full path to wherever you want the image written. Then you will know where it is.

I do that and now i get a return:

But if i convert into a buffer, I can not load the jpg.

If your input is an image it is a binary file you need the output format to be "a single buffer object"

okay and how do i get this? is there a node for?

Try looking at the options in the file node you are using...

To view the current directory you're in on (most) *NIX systems, try the pwd command, which outputs the Working Directory.

Alternative approach
Install RedMobile on phone (costs £4)

Use it to take pictures and forward them onto another machine to process them via MQTT

2 Likes

okay now I fixed it! thank you all for your help :slight_smile:

Just another solution if anyone comes along in future

I ran IP WEbcam on my 'droid phone

And then used the HTTP Request node on a flow on my Win10 machine to grab a picture

2 Likes

could you send your flow?

[{"id":"9620d9cf.4d9068","type":"http request","z":"f3dbc12c.1a5de","name":"","method":"GET","ret":"bin","paytoqs":false,"url":"http://192.168.0.201:8080/shot.jpg ","tls":"","persist":false,"proxy":"","authType":"","x":246,"y":176,"wires":[["95aec0b1.34251"]]},{"id":"5c893194.71501","type":"debug","z":"f3dbc12c.1a5de","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":732,"y":176,"wires":[]},{"id":"1ac17d10.e803d3","type":"inject","z":"f3dbc12c.1a5de","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":104,"y":176,"wires":[["9620d9cf.4d9068"]]},{"id":"720f87a9.8b1788","type":"image viewer","z":"f3dbc12c.1a5de","name":"","width":160,"data":"payload","dataType":"msg","x":732,"y":220,"wires":[[]]},{"id":"85116094.595bd","type":"file","z":"f3dbc12c.1a5de","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":732,"y":66,"wires":[[]]},{"id":"95aec0b1.34251","type":"simpletime","z":"f3dbc12c.1a5de","name":"","x":400,"y":176,"wires":[["5c893194.71501","720f87a9.8b1788","40faaa59.2ea964"]]},{"id":"40faaa59.2ea964","type":"template","z":"f3dbc12c.1a5de","name":"","field":"filename","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"c:\\users\\simon\\pictures\\ipcam\\{{myepoch}}.jpg","output":"str","x":566,"y":132,"wires":[["34327726.415df8","85116094.595bd"]]},{"id":"34327726.415df8","type":"debug","z":"f3dbc12c.1a5de","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":732,"y":132,"wires":[]}]

additional nodes are
node-red-contrib-simpletime (to add timestamp to filename) and node-red-contrib-image-tools (for image viewer)