camerapi take photo node not working

740 views
Skip to first unread message

Maurice Freeman

unread,
Jan 15, 2017, 8:08:57 AM1/15/17
to Node-RED
Hi,
my Pi camera is installed and works fine takes pictures with Raspicam. 
However in node-red with a simple setup using just a timestamp to trigger camera node I always get msg.payload: string(0) and it does not save the image. I have tried using default  save location and also others.
What am I doing wrong here? Any advice is appreciated as I don't know where to go next.
Thanks
Mauri

Mark Setrem

unread,
Jan 15, 2017, 8:17:54 AM1/15/17
to Node-RED
Could you post your flow?

Maurice Freeman

unread,
Jan 15, 2017, 6:24:23 PM1/15/17
to Node-RED
Just a simple 3 node flow. Thanks




On Monday, 16 January 2017 00:17:54 UTC+11, Mark Setrem wrote:
Could you post your flow?

Mark Setrem

unread,
Jan 15, 2017, 6:37:51 PM1/15/17
to Node-RED

Unfortunately the image you posted doesn't appear (see below) you can also export your flow in node-red 

  1. highlight the nodes you wish to export
  2. go to the menu > export > clipboard
  3. select the options and then "Export to clipboard"  



Maurice Freeman

unread,
Jan 15, 2017, 10:00:26 PM1/15/17
to Node-RED
Hi Mark,
This is the flow. Thanks for taking the time to assist me.

Maurice Freeman

unread,
Jan 15, 2017, 10:02:22 PM1/15/17
to node...@googlegroups.com

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/26c15c1f-f1fc-49f4-b3fa-6a32ba274e0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zenofmud

unread,
Jan 16, 2017, 6:48:13 AM1/16/17
to node...@googlegroups.com
I think by ‘could you post your flow’ Mark meant
1) in NR select all the parts of the flow
2) in the upper right of the window, click the hamburger icon
3) move the cursor to ‘Export’ and then to ‘Clipboard’
4) copy the results and paste into a reply


On Jan 15, 2017, at 10:02 PM, Maurice Freeman <maur...@gmail.com> wrote:

<PastedGraphic-1.tiff>
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Maurice Freeman

unread,
Jan 16, 2017, 8:58:44 AM1/16/17
to Node-RED
Hi Mark,
Here is my flow. Thanks for the help, it is much appreciated.

[{"id":"fde7e552.4f8ee8","type":"inject","z":"d352a269.42ad2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":202,"y":164,"wires":[["eae22fc8.dd34f"]]},{"id":"eae22fc8.dd34f","type":"camerapi-takephoto","z":"d352a269.42ad2","filemode":"1","filename":"","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"1","fliph":"0","flipv":"0","name":"","x":487,"y":164,"wires":[["9cb470db.029fc"]]},{"id":"9cb470db.029fc","type":"debug","z":"d352a269.42ad2","name":"","active":true,"console":"false","complete":"false","x":754,"y":165,"wires":[]}]

Mark Setrem

unread,
Jan 16, 2017, 9:16:40 AM1/16/17
to node...@googlegroups.com
i’m not infront of a computer, but from the flow you posted you appear to have left the filename config box blank.  But you aren’t sending the node a filename in the inject (see info panel of node).

What happens if you :

  1. Type a filename into the node config window
  2. Set the directory to one you know exists such as /home/pi/  






--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Maurice Freeman

unread,
Jan 16, 2017, 5:12:12 PM1/16/17
to Node-RED
Hi Mark,
Thanks so much. This has sorted it out. I had the incorrect directory or permissions for it.
Your help is much appreciated.
Kind regards
Mauri

shykitten55

unread,
Sep 22, 2017, 8:08:47 AM9/22/17
to Node-RED
Hi folks.

I was passing by and needed a camera control node and thought I would give it a go.

My "need" is to take pictures and they are saved on the same Pi.  So maybe this is not what I need.  I don't know.

The instructions are a bit vague and/or confusing.  There are three modes:  File Mode; Generate; Buffer mode.  Yet the "instructions" call them 1, 2 and 0.

Granted it defaults to the ~/Pictures directory to save, but when you change it to another one (under Pictures) every time you go to the edit mode, it defaults back to the default.

I also can't for the life of me work out how the file names are made/generated.
For this project/flow  YearMonthDateHourMinSec.jpg would do.

I'm getting a file name longer than the Mississippi river, which makes it painful for the next stage.

Is this the right node for what I am wanting to do?

Colin Law

unread,
Sep 22, 2017, 8:34:07 AM9/22/17
to node...@googlegroups.com
For us to answer that we need to know the correct name of the node.
Possibly something like node-red-contrib-something. There may (or may
not) be multiple nodes that might match your description.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/b747b2a4-f08c-4db8-b6ad-802c5a730264%40googlegroups.com.

Cat

unread,
Sep 22, 2017, 6:11:20 PM9/22/17
to node...@googlegroups.com
The node's name is in the subject.

Cameapitakephoto.

I didn't say it because I thought that was what this thread was about.



> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/b747b2a4-f08c-4db8-b6ad-802c5a730264%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.

Cat

unread,
Sep 22, 2017, 6:25:44 PM9/22/17
to node...@googlegroups.com
These are the two flows I made:

First one is the "Take photo" flow, the second on is the remote control

[{"id":"fd50d546.ec3f2","type":"inject","z":"d57de863.41484","name":"Take picture","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":111,"y":125,"wires":[["903f31a1.8bbdf8"]]},{"id":"e253f2b5.ca2c58","type":"camerapi-takephoto","z":"d57de863.41484","filemode":"0","filename":"","filedefpath":"0","filepath":"/home/pi/Pictures/Local_Camera/","fileformat":"jpeg","resolution":"4","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","name":"Smile!","x":458,"y":126,"wires":[["87bbd11b.e59a08","347ea4a4.afe39c"]]},{"id":"87bbd11b.e59a08","type":"debug","z":"d57de863.41484","name":"Picture name","active":true,"console":"false","complete":"payload","x":708,"y":126,"wires":[]},{"id":"ba850b0c.1f1408","type":"mqtt in","z":"d57de863.41484","name":"","topic":"Camera/Picture","qos":"2","broker":"eda60d55.cc89b8","x":90.5,"y":67,"wires":[["8eb6bc88.a38f6"]]},{"id":"76de7ecd.99f2e","type":"function","z":"d57de863.41484","name":"Time Stamp","func":"msg.payload = new Date().toString();\nreturn msg;\n","outputs":1,"noerr":0,"x":501.5,"y":67,"wires":[["903f31a1.8bbdf8"]]},{"id":"8eb6bc88.a38f6","type":"switch","z":"d57de863.41484","name":"Check if this is the one","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":297.5,"y":67,"wires":[["76de7ecd.99f2e"]]},{"id":"b3fe87fc.c9f188","type":"comment","z":"d57de863.41484","name":"Camera control","info":"Send a message of \"1\" to the input and\nit takes a picture.\nMQTT topic is Camera","x":468.5,"y":18,"wires":[]},{"id":"347ea4a4.afe39c","type":"rbe","z":"d57de863.41484","name":"","func":"rbe","gap":"","start":"","inout":"out","x":372.5,"y":172,"wires":[["e90f6be1.bc247"]]},{"id":"146ddd74.5285fb","type":"mqtt out","z":"d57de863.41484","name":"","topic":"Camera/Ack","qos":"","retain":"","broker":"eda60d55.cc89b8","x":698.5,"y":172,"wires":[]},{"id":"e90f6be1.bc247","type":"change","z":"d57de863.41484","name":"Acknowledge","rules":[{"t":"set","p":"payload","pt":"msg","to":"Taken","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":522.5,"y":172,"wires":[["146ddd74.5285fb","e7f3ce03.506de8"]]},{"id":"e7f3ce03.506de8","type":"debug","z":"d57de863.41484","name":"Picture taken","active":true,"console":"false","complete":"payload","x":713.5,"y":224,"wires":[]},{"id":"903f31a1.8bbdf8","type":"moment","z":"d57de863.41484","name":"","topic":"Time format","input":"","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYYMMDDHHmmss","locale":"en_AU","output":"","outputType":"msg","outTz":"Australia/Sydney","x":309.5,"y":126,"wires":[["e253f2b5.ca2c58"]]},{"id":"eda60d55.cc89b8","type":"mqtt-broker","z":"","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"20","cleansession":true,"willTopic":"EOM","willQos":"2","willPayload":"MQTT_Failure","birthTopic":"SOM","birthQos":"2","birthPayload":""}]




[{"id":"3176ca7e.34b6ee","type":"inject","z":"9a4e86e2.0daae","name":"Take Picture","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":126.5,"y":47,"wires":[["c806de5c.1e2b18"]]},{"id":"c806de5c.1e2b18","type":"mqtt out","z":"9a4e86e2.0daae","name":"","topic":"Camera/Picture","qos":"2","retain":"","broker":"281932a8.0517e6","x":315.5,"y":47,"wires":[]},{"id":"67a7e466.0f996c","type":"mqtt in","z":"9a4e86e2.0daae","name":"","topic":"Camera/Ack","qos":"2","broker":"281932a8.0517e6","x":510.5,"y":47,"wires":[["a9067d5f.9ff498","6ed51aa8.127ba4"]]},{"id":"a9067d5f.9ff498","type":"debug","z":"9a4e86e2.0daae","name":"Picture taken","active":true,"console":"false","complete":"payload","x":718.5,"y":86,"wires":[]},{"id":"6ed51aa8.127ba4","type":"play_audio_file","z":"9a4e86e2.0daae","filename":"/usr/share/sounds/freedesktop/stereo/camera-shutter.oga","x":719.5,"y":47,"wires":[[]]},{"id":"281932a8.0517e6","type":"mqtt-broker","z":"","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"20","cleansession":true,"willTopic":"EOM","willQos":"2","willPayload":"MQTT_Failure","birthTopic":"SOM","birthQos":"2","birthPayload":""}]

Colin Law

unread,
Sep 24, 2017, 3:47:23 AM9/24/17
to node...@googlegroups.com
Do you mean this one [1]? node-red-contrib-camerapi?

[1] https://www.npmjs.com/package/node-red-contrib-camerapi

Colin
>> > email to node-red+u...@googlegroups.com.
>> > To post to this group, send email to node...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/node-red.
>> > To view this discussion on the web, visit
>> >
>> > https://groups.google.com/d/msgid/node-red/b747b2a4-f08c-4db8-b6ad-802c5a730264%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> http://nodered.org
>>
>> Join us on Slack to continue the conversation: http://nodered.org/slack
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Node-RED" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> node-red+u...@googlegroups.com.
>> To post to this group, send an email to node...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/node-red.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/node-red/CAL%3D0gLsONn0fqXz8Lz1QaV6M95WP1Wd2y2xiLq57NGGDgLXcfA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/CACM_FR5qBduYaZx0_EBLvojO563aaQwBCeAsMoVyHBTSHuY%2B5Q%40mail.gmail.com.

Cat

unread,
Sep 24, 2017, 7:01:08 AM9/24/17
to node...@googlegroups.com
Yup.

Seems I have to do some learning on the msg.payload part of it to manipulate tit and rename that to get a more "readable" filename.

I'm just not used to the idea that msg.payload is the photo.



>> > To post to this group, send email to node...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/node-red.
>> > To view this discussion on the web, visit
>> >
>> > https://groups.google.com/d/msgid/node-red/b747b2a4-f08c-4db8-b6ad-802c5a730264%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> http://nodered.org
>>
>> Join us on Slack to continue the conversation: http://nodered.org/slack
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Node-RED" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to

>> To post to this group, send an email to node...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/node-red.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/node-red/CAL%3D0gLsONn0fqXz8Lz1QaV6M95WP1Wd2y2xiLq57NGGDgLXcfA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
>
> For more options, visit https://groups.google.com/d/optout.

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/bAz8Vok9TMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send an email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Sep 24, 2017, 8:38:26 AM9/24/17
to node...@googlegroups.com
On 24 September 2017 at 12:01, Cat <fuzzywu...@gmail.com> wrote:
> Yup.

So the full name of the node is not in the subject, it is
node-red-contrib-camerapi. The reason I had to ask is that there may
be more than one node that appears to be called camerapi.

>
> Seems I have to do some learning on the msg.payload part of it to manipulate
> tit and rename that to get a more "readable" filename.
>

Not sure what you mean by that. According to the info tab you can
pass in a filename if you want it to write it to a file.

Colin
Reply all
Reply to author
Forward
0 new messages