Control smartphone camera with Node red installed on Android

What do you expect to see in the terminal when you enter the command?

that a picture named test.jpg is generated

I asked what you expect to see in the terminal. I don't see anything in the description of that command that says it will confirm that it has done it. The command has not shown an error so I would expect that it thinks it has done it.

okay but if it do so where is the file?
I mean I would like to take some pictures controlled by NR..

Presumably it is in the current directory. In the terminal, run ls to see if it is there.

okay it is there, but how do i get the file then?

There is file-in node in Node-RED have you tried that?

no, cause i don t know at what file path the files are

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


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

1 Like

could you send your flow?

[{"id":"9620d9cf.4d9068","type":"http request","z":"f3dbc12c.1a5de","name":"","method":"GET","ret":"bin","paytoqs":false,"url":" ","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)