# Parking system dashboard...help

**URL:** <https://discourse.nodered.org/t/parking-system-dashboard-help/58804>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [22 February 2022 09:52 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804 "2022-02-22T09:52:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 09:52 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/1 "2022-02-22T09:52:40Z")

</div>

i m having a final year project and i m struggling with NOde-red  
the project is parking demo using a RASPBERRY +servo as a gate+apprxomity sensor to check the  
availability of the LOT  
i 'll be glad if you can check my node code and fix it  
.................................................................

```auto
[
    {
        "id": "63234a2ef7813cd0",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "bb048f30dbb5dc77",
        "type": "ui_toast",
        "z": "63234a2ef7813cd0",
        "position": "bottom right",
        "displayTime": "3",
        "highlight": "",
        "sendall": true,
        "outputs": 0,
        "ok": "OK",
        "cancel": "",
        "raw": false,
        "topic": "PLEASE GO TO LOT1",
        "name": "",
        "x": 590,
        "y": 340,
        "wires": []
    },
    {
        "id": "850098cb873dbffb",
        "type": "rpi-gpio in",
        "z": "63234a2ef7813cd0",
        "name": "IR sensor",
        "pin": "18",
        "intype": "tri",
        "debounce": "25",
        "read": false,
        "bcm": true,
        "x": 140,
        "y": 200,
        "wires": [
            [
                "584b43e28b88ef70",
                "e53764faeb06c366"
            ]
        ]
    },
    {
        "id": "493b52f2e37fbc2e",
        "type": "ui_text",
        "z": "63234a2ef7813cd0",
        "group": "ef8cbddd17ad1916",
        "order": 2,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "LOT1",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 590,
        "y": 120,
        "wires": []
    },
    {
        "id": "584b43e28b88ef70",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "p = msg.payload;\nif (p = 1)\n{msg.payload=true;\nreturn 1;}\nelse\n{msg.payload=false;\n}\nreturn 0;}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 120,
        "wires": [
            [
                "493b52f2e37fbc2e"
            ]
        ]
    },
    {
        "id": "c79468a372a7d095",
        "type": "rpi-gpio out",
        "z": "63234a2ef7813cd0",
        "name": "",
        "pin": "23",
        "set": "",
        "level": "0",
        "freq": "50",
        "out": "pwm",
        "bcm": true,
        "x": 1180,
        "y": 160,
        "wires": []
    },
    {
        "id": "0f26376ad0cbe553",
        "type": "delay",
        "z": "63234a2ef7813cd0",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 690,
        "y": 440,
        "wires": [
            [
                "d7d731543223c2a6"
            ]
        ]
    },
    {
        "id": "eda57e17da3e255a",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "\nfor (var i=0; i<400; i++){\n node.send({payload:i*0.01 + '$'}); \n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 440,
        "wires": [
            [
                "0f26376ad0cbe553"
            ]
        ]
    },
    {
        "id": "c8f5e4b0671473e8",
        "type": "ui_text",
        "z": "63234a2ef7813cd0",
        "group": "ef8cbddd17ad1916",
        "order": 0,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Date",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 970,
        "y": 40,
        "wires": []
    },
    {
        "id": "d7d731543223c2a6",
        "type": "ui_text",
        "z": "63234a2ef7813cd0",
        "group": "ef8cbddd17ad1916",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "fees",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 870,
        "y": 440,
        "wires": []
    },
    {
        "id": "e53764faeb06c366",
        "type": "ui_switch",
        "z": "63234a2ef7813cd0",
        "name": "",
        "label": "switch",
        "tooltip": "",
        "group": "ef8cbddd17ad1916",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "topic",
        "topicType": "msg",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "GREEN",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "RED",
        "animate": false,
        "x": 330,
        "y": 300,
        "wires": [
            [
                "eda57e17da3e255a",
                "bb048f30dbb5dc77",
                "7e158778513572bb",
                "8a7a1f4a4864a54f"
            ]
        ]
    },
    {
        "id": "591f04c638b45cc1",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "Format date",
        "func": "const dateNow = {'payload': formatDate()}\n\nfunction formatDate(){\n//29 Aug 2021 06:15:36\n let date = new Date();\n let year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);\n let month = new Intl.DateTimeFormat('en', { month: 'short' }).format(date);\n let day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);\n let time = date.toLocaleTimeString('en-US', { hour12: false });\n return `${day} ${month} ${year} ${time}`;\n}\n\nreturn dateNow",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 750,
        "y": 40,
        "wires": [
            [
                "c8f5e4b0671473e8"
            ]
        ]
    },
    {
        "id": "8de22bebacecb6d8",
        "type": "inject",
        "z": "63234a2ef7813cd0",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 608,
        "y": 40,
        "wires": [
            [
                "591f04c638b45cc1"
            ]
        ]
    },
    {
        "id": "628973c3045204ba",
        "type": "ui_led",
        "z": "63234a2ef7813cd0",
        "order": 5,
        "group": "230a64bc7f223e21",
        "width": 0,
        "height": 0,
        "label": "LED blinker",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#008000",
                "value": "true",
                "valueType": "bool"
            },
            {
                "color": "#808080",
                "value": "false",
                "valueType": "bool"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "",
        "x": 1170,
        "y": 260,
        "wires": []
    },
    {
        "id": "ea2e0dfce4627de8",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "\nmsg.payload = true;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 660,
        "y": 260,
        "wires": [
            [
                "135d56fa505275f0",
                "628973c3045204ba"
            ]
        ]
    },
    {
        "id": "135d56fa505275f0",
        "type": "delay",
        "z": "63234a2ef7813cd0",
        "name": "",
        "pauseType": "delay",
        "timeout": "150",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 830,
        "y": 260,
        "wires": [
            [
                "60abb433d34c7f95"
            ]
        ]
    },
    {
        "id": "60abb433d34c7f95",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "\nmsg.payload = false;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1000,
        "y": 260,
        "wires": [
            [
                "628973c3045204ba"
            ]
        ]
    },
    {
        "id": "7e158778513572bb",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "msgpayload=true;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 200,
        "wires": [
            [
                "ea2e0dfce4627de8",
                "f8002fdf7dc7cb56"
            ]
        ]
    },
    {
        "id": "f8002fdf7dc7cb56",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 640,
        "y": 160,
        "wires": [
            [
                "c31c90f6611d6634"
            ]
        ]
    },
    {
        "id": "c31c90f6611d6634",
        "type": "delay",
        "z": "63234a2ef7813cd0",
        "name": "",
        "pauseType": "delay",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 800,
        "y": 160,
        "wires": [
            [
                "aa788a0206d0e192"
            ]
        ]
    },
    {
        "id": "aa788a0206d0e192",
        "type": "function",
        "z": "63234a2ef7813cd0",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 960,
        "y": 160,
        "wires": [
            [
                "c79468a372a7d095"
            ]
        ]
    },
    {
        "id": "8a7a1f4a4864a54f",
        "type": "delay",
        "z": "63234a2ef7813cd0",
        "name": "",
        "pauseType": "delay",
        "timeout": "8",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 320,
        "y": 380,
        "wires": [
            [
                "e53764faeb06c366"
            ]
        ]
    },
    {
        "id": "ef8cbddd17ad1916",
        "type": "ui_group",
        "name": "Time",
        "tab": "9825e1db72548c21",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "230a64bc7f223e21",
        "type": "ui_group",
        "name": "Rx LED",
        "tab": "7da2a54b379a6e07",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "9825e1db72548c21",
        "type": "ui_tab",
        "name": "Settings",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    },
    {
        "id": "7da2a54b379a6e07",
        "type": "ui_tab",
        "name": "blinky",
        "icon": "fa-bolt",
        "order": 2,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [22 February 2022 10:49 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/2 "2022-02-22T10:49:56Z")

</div>

You haven’t said what the problem is. I.e. what problem is happening?

---

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 10:51 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/3 "2022-02-22T10:51:49Z")

</div>

unable to control the servo + the dashboard needs some fix

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 February 2022 10:51 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/4 "2022-02-22T10:51:54Z")

</div>

Welcome to the forum @noobmaster

I think it unlikely that anyone here is going to complete your final year project for you. However, if you add debug nodes to the flow at appropriate places and work out exactly which node is not doing what you think it should, and post just that node and maybe a few around it, tell us what is going into the node and out of it and what is not as it should be then I am sure someone will help.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [22 February 2022 10:52 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/5 "2022-02-22T10:52:08Z")

</div>

> [@noobmaster](#):
>
> and fix it

Ehh, was it your examination??

---

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 10:52 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/6 "2022-02-22T10:52:56Z")

</div>

yes....bit in a rush

---

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 10:54 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/7 "2022-02-22T10:54:21Z")

</div>

ok ...a function that can control a servo to open wait few seconds the close...will be helpfull

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [22 February 2022 10:55 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/8 "2022-02-22T10:55:17Z")

</div>

Have you looked at the delay node?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 February 2022 11:06 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/9 "2022-02-22T11:06:24Z")

</div>

> [@noobmaster](#):
>
> a function that can control a servo to open wait few seconds the close...will be helpfull

Use a trigger node for that. Set it to send the open command, then Wait the appropriate time, then send the close command.

---

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 11:30 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/10 "2022-02-22T11:30:26Z")

</div>

thx for your help...i need it to be a closed loop...when i push the button i want i to open and close for once only not an open loop....how to achieve it?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 February 2022 11:47 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/11 "2022-02-22T11:47:37Z")

</div>

Feed the button into the trigger node, when you press the button it will open and then close.

---

<div class="post-metadata">

**Author:** ![noobmaster](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@noobmaster](https://discourse.nodered.org/u/noobmaster)\
**Post date:** [22 February 2022 11:54 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/12 "2022-02-22T11:54:03Z")

</div>

thx i ll try my best

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 March 2022 11:54 UTC](https://discourse.nodered.org/t/parking-system-dashboard-help/58804/13 "2022-03-24T11:54:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
