Hello,
I'm using node-red-contrib-usbcamera both in Buffer mode for streaming and in File mode to save pictures.
The issue I have is that in File mode, the files are saved only some times, while the output from the node is fine (payload, filename, filepath all OK), the files just don't exist.
Did you already face this issue and how did you solve it ?
Thanks !
Here is my flow:
[{"id":"b8a0d690.062448","type":"tab","label":"Camera","disabled":false,"info":"This flow include the driver for :\nOne USB webcam"},{"id":"6b7b72ce.8664fc","type":"usbcamera","z":"b8a0d690.062448","filemode":"0","filename":"image01.jpg","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"5","name":"","x":550,"y":100,"wires":[["7265faa3.75b2a4"]]},{"id":"f37f9486.30bc68","type":"inject","z":"b8a0d690.062448","name":"","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":100,"wires":[["8e58a7fb.145c28"]]},{"id":"5e5eab8d.55a544","type":"base64","z":"b8a0d690.062448","name":"","action":"str","property":"payload","x":880,"y":100,"wires":[["99b24069.8ca18"]]},{"id":"99b24069.8ca18","type":"template","z":"b8a0d690.062448","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img height=\"600px\" src=\"data:image/jpg;base64,{{{payload}}}\">","output":"str","x":1020,"y":100,"wires":[["6247e54b.f4930c"]]},{"id":"6247e54b.f4930c","type":"ui_template","z":"b8a0d690.062448","group":"6013b77f.8f01d8","name":"","order":4,"width":"0","height":"0","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1160,"y":100,"wires":[[]]},{"id":"8a2c52df.ea0cc","type":"comment","z":"b8a0d690.062448","name":"Only one camera can be attached","info":"","x":200,"y":60,"wires":[]},{"id":"23c29700.5d3d9a","type":"ui_button","z":"b8a0d690.062448","name":"","group":"6013b77f.8f01d8","order":1,"width":0,"height":0,"passthru":false,"label":"Take picture","tooltip":"","color":"","bgcolor":"","icon":"fa-camera","payload":"","payloadType":"str","topic":"","x":130,"y":200,"wires":[["c42a6fb3.ae6b5"]]},{"id":"c42a6fb3.ae6b5","type":"function","z":"b8a0d690.062448","name":"set filename and mode","func":"msg.filename = \"image_\" + Date.now();\nmsg.filemode = 1;\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":200,"wires":[["6b7b72ce.8664fc"]]},{"id":"8e58a7fb.145c28","type":"function","z":"b8a0d690.062448","name":"set filemode","func":"msg.filemode = 0;\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":100,"wires":[["6b7b72ce.8664fc"]]},{"id":"7265faa3.75b2a4","type":"switch","z":"b8a0d690.062448","name":"","property":"filemode","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":100,"wires":[["5e5eab8d.55a544","cf8887a8.d676e8"],["522c5aa1.26d854"]]},{"id":"cf8887a8.d676e8","type":"debug","z":"b8a0d690.062448","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":60,"wires":[]},{"id":"522c5aa1.26d854","type":"debug","z":"b8a0d690.062448","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":180,"wires":[]},{"id":"6013b77f.8f01d8","type":"ui_group","z":"","name":"Camera","tab":"f50ca35c.d425b","order":1,"disp":true,"width":"20","collapse":false},{"id":"f50ca35c.d425b","type":"ui_tab","z":"","name":"Camera","icon":"fa-camera","order":2,"disabled":false,"hidden":false}]