Failed to add the sensor (Motion sensor)

  • Device & model you are using (Ex: Pi 2 Model B or Arduino Uno with W5100 ethernet shield)
    Raspberry Pi 4 8GB

  • What dashboard are you using? (Web, iOS, Android)

  • Please describe the bug / issue as detailed as possible.
    I tried to add my Motion Sensor which is HC-SR501 and connect it exactly like the official guide on Cayenne Docs, but everytime i do that i get this error Failed to add the sensor (Device command failed), i tried to use another GPIO pin and same problem occurs, also everytime i tried to enable I2C from myDevices Web then my Raspberry Pi will not show online on the website even though im writing this from my Raspberry Pi.

when executing the command: service myDevice status i get
myDevices.service - myDevices service
Loaded: loaded (/etc/systemd/system/myDevices.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-09-30 11:36:17 +03; 13min ago
Process: 1658 ExecStartPre=/bin/mkdir -p /var/run/myDevices (code=exited, status=0/SUCCESS)
Process: 1659 ExecStartPre=/bin/chown cayenne:cayenne /var/run/myDevices/ (code=exited, status=0/SUCCESS)
Process: 1660 ExecStartPre=/bin/mkdir -p /var/log/myDevices (code=exited, status=0/SUCCESS)
Process: 1661 ExecStartPre=/bin/chown -R cayenne:cayenne /var/log/myDevices/ (code=exited, status=0/SUCCESS)
Process: 1662 ExecStartPre=/bin/chown cayenne:cayenne /etc/myDevices (code=exited, status=0/SUCCESS)
Process: 1663 ExecStartPre=/bin/chown cayenne:cayenne /etc/myDevices/AppSettings.ini (code=exited, status=0/SUCCESS)
Process: 1664 ExecStartPre=/bin/chown cayenne:cayenne /etc/myDevices/agent.db* (code=exited, status=1/FAILURE)
Process: 1665 ExecStartPre=/bin/chown cayenne:cayenne /etc/myDevices/devices.json (code=exited, status=0/SUCCESS)
Process: 1666 ExecStartPre=/bin/mkdir -p /etc/myDevices/plugins (code=exited, status=0/SUCCESS)
Main PID: 1667 (python3)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/myDevices.service
‣ 1667 /usr/bin/python3 -m myDevices -P /var/run/myDevices/

Sep 30 11:36:17 raspberrypi systemd[1]: Starting myDevices service…
Sep 30 11:36:17 raspberrypi systemd[1]: Started myDevices service.
Sep 30 11:36:17 raspberrypi systemd[1667]: pam_unix(login:session): session opened for user cayenne by (uid=0)

I tried to format the SD card then made another image but same problem occurs when i add motion sensor

can you run this command tail -f /var/log/myDevices/cayenne.log and while it is logging, add the motion sensor.

Same problem occurs, here’s the log

cayenne.log (620.8 KB)

the log shows that there are already digital Motion sensors added. are you adding one more on same channel?

Actually, when i saw the dashboard there was a lot of widgets add on widgets and i deleted those because it wasn’t interacting with my Motion sensor

can you delete the devices and re-add a new one. Add a motion sensor and share the log if an error occurs.

The problem is when i delete those and want to add my Motion sensor from add devices i get the same error, and when i go back to the dashboard i see 8 add on devices which i never added them and they are greened out

cayenne.log (821.2 KB)

i said delete device not widget.

Sorry i am new to this type of environment, i’m gussing you mean delete the device on the left panel correct?
if so then i did delete from there

to delete the device, you need to open the device setting by pressing the clog wheel icon on top right of the device dashboard,

Oh, i get it now, i tried it now, and my sensor got working finally.