I'm using a pi0 with the webcamera.
It's meant to take a picture, send it to openALPR, and for that I'm using cURLPOST, I'm also using raspistill for the dashboard. I've tried removing one or the other just to test if there would be any improvement in speed but there was no change.
Right now it's taking me 6 to 8 seconds JUST to take a picture, which is way too long for what I need. Is there any way to shave off some of this time?
I'm trying to get the whole node to run a bit faster but this is my first choke point.
Here is my node:
[
{
"id": "2df99d57.1a24c2",
"type": "subflow",
"name": "photo",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 120,
"wires": [
{
"id": "1356f62e.baa3ea"
}
]
}
],
"out": [
{
"x": 700,
"y": 40,
"wires": [
{
"id": "610cff3d.a0cfb",
"port": 0
}
]
}
]
},
{
"id": "74a1fa33.029444",
"type": "exec",
"z": "2df99d57.1a24c2",
"command": "sudo curl -X POST \"https://api.openalpr.com/v2/recognize?secret_key=[sk removed]&recognize_vehicle=1&country=eu&return_image=0&topn=10\" -F image=@/home/pi/Pictures/car-photo.jpeg",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "cURL POST",
"x": 330,
"y": 80,
"wires": [
[
"610cff3d.a0cfb"
],
[],
[]
]
},
{
"id": "610cff3d.a0cfb",
"type": "json",
"z": "2df99d57.1a24c2",
"name": "JSON",
"pretty": false,
"x": 470,
"y": 40,
"wires": [
[
"46d7d4e2.2aaefc"
]
]
},
{
"id": "1356f62e.baa3ea",
"type": "camerapi-takephoto",
"z": "2df99d57.1a24c2",
"filemode": "1",
"filename": "car-photo.jpeg",
"filedefpath": "0",
"filepath": "/home/pi/Pictures/",
"fileformat": "jpeg",
"resolution": "1",
"rotation": "0",
"fliph": "0",
"flipv": "0",
"brightness": "50",
"contrast": "0",
"sharpness": "0",
"quality": "",
"imageeffect": "none",
"exposuremode": "auto",
"agcwait": "",
"awb": "auto",
"name": "Take Photo",
"x": 150,
"y": 120,
"wires": [
[
"74a1fa33.029444",
"2cfcabfa.cc0194"
]
]
},
{
"id": "46d7d4e2.2aaefc",
"type": "debug",
"z": "2df99d57.1a24c2",
"name": "curlpostD",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"x": 580,
"y": 40,
"wires": []
},
{
"id": "2cfcabfa.cc0194",
"type": "exec",
"z": "2df99d57.1a24c2",
"command": "raspistill",
"addpay": false,
"append": "-w 320 -h 240 -o -",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 320,
"y": 160,
"wires": [
[
"97900490.a979b8"
],
[],
[]
]
},
{
"id": "4b2b18a3.59a398",
"type": "template",
"z": "2df99d57.1a24c2",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "<img width=\"800px\" height=\"600px\" src=\"data:image/jpg;base64,{{{payload}}}\">",
"output": "str",
"x": 580,
"y": 140,
"wires": [
[
"19811dc8.aec422"
]
]
},
{
"id": "19811dc8.aec422",
"type": "ui_template",
"z": "2df99d57.1a24c2",
"group": "5d45298.aa40cd8",
"name": "",
"order": 5,
"width": "4",
"height": "4",
"format": "<div ng-bind-html=\"msg.payload\"></div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 700,
"y": 140,
"wires": [
[
"925201c4.a192a"
]
]
},
{
"id": "97900490.a979b8",
"type": "base64",
"z": "2df99d57.1a24c2",
"name": "",
"action": "str",
"property": "payload",
"x": 460,
"y": 140,
"wires": [
[
"4b2b18a3.59a398"
]
]
},
{
"id": "6e8932d0.9405ac",
"type": "ui_button",
"z": "2df99d57.1a24c2",
"name": "",
"group": "5d45298.aa40cd8",
"order": 1,
"width": "1",
"height": "1",
"passthru": false,
"label": "Foto",
"color": "",
"bgcolor": "",
"icon": "camera_alt",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 150,
"y": 160,
"wires": [
[
"2cfcabfa.cc0194",
"77cec238.14305c"
]
]
},
{
"id": "77cec238.14305c",
"type": "debug",
"z": "2df99d57.1a24c2",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "foto_manual_start",
"x": 360,
"y": 200,
"wires": []
},
{
"id": "925201c4.a192a",
"type": "debug",
"z": "2df99d57.1a24c2",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "foto_manual_end",
"x": 860,
"y": 140,
"wires": []
},
{
"id": "5d45298.aa40cd8",
"type": "ui_group",
"z": "",
"name": "Controls",
"tab": "402648fd.9eb5f8",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "402648fd.9eb5f8",
"type": "ui_tab",
"z": "",
"name": "Auto",
"icon": "directions_car",
"order": 1
}
]