Webiopi add sensor response: ERROR while adding light to dashboard

Greetings -

I have created a tkinter app which turns lights on and off on a breadboard from my PI 3 model B.
The app works great and the lights turn off and on as they should.
However when I try to add a light to Cayenne dashboard in Devices & Widgets >> Actuators >> Light Switch.
I can add the device but I get the following error in myDevices.log -

myDevices - INFO - Webiopi add sensor request: {“args”: {“gpio”: “GPIO”, “channel”: 17, “invert”: true}, “description”: “Light Switch1”, “device”: “LightSwitch”, “name”: “wFnEuFxwCMzoHtuo”}
2017-05-24 06:41:19 - myDevices - INFO - Webiopi add sensor response: ERROR

Which prevents me from adding a light switch to the dashboard.
Can someone assist me here?

Installed software-
pigpio 1.60-1 armhf
python-gpiozero 1.3.2 all
python-rpi.gpio 0.6.3~jessie-1 armhf
python3-gpiozero 1.3.2 all
python3-rpi.gpio 0.6.3~jessie-1 armhf
raspi-gpio 0.20170105 armhf
i2c-tools 3.1.1+svn-2 armhf
WebIOPi/0.7.1/Python2.7

Prereq’s

  1. PI 3 model B w/ Raspbian GNU/Linux 8 - Linux 4.9.29-v7+ #1000 SMP Sun May 21 20:11:31 BST 2017 armv7l GNU/Linux
  2. breadboard
  3. led’s connected and working on GPIO 17 and 5

Steps to repro:

  1. Log into Cayenne

  2. Next Add light from Actuators section like so - Devices & Widgets >> Actuators >> Light Switch.
    2.1 Widget Name - Light Switch
    2.2 Select Device - YOUR PI DEVICE
    2.3 Channel - 17
    2.4 Choose Widget - Button
    2.5 Choose Icon
    2.6 Check the “Invert Logic” check box
    2.7 Click “Add Actuator” button

  3. While performing step 2.7 tail the myDevices.log - sudo tail -f /var/log/myDevices.log
    And notice the following error while trying to add the led light -

    myDevices - INFO - Webiopi add sensor response: ERROR

Expected Result:
Actuator / light gets added to dashboard

Actual Result:

2017-05-24 06:41:19 - myDevices - INFO - PacketTypes.PT_ADD_SENSOR
2017-05-24 06:41:19 - myDevices - INFO - AddSensor:Light Switch1wFnEuFxwCMzoHtuoLightSwitch {‘gpio’: ‘GPIO’, ‘channel’: 17, ‘invert’: True}
2017-05-24 06:41:19 - myDevices - INFO - Webiopi add sensor request: {“args”: {“gpio”: “GPIO”, “channel”: 17, “invert”: true}, “description”: “Light Switch1”, “device”: “LightSwitch”, “name”: “wFnEuFxwCMzoHtuo”}
2017-05-24 06:41:19 - myDevices - INFO - Webiopi add sensor response: ERROR

Hi @eworden, welcome to the Cayenne Community.

This is because you’re running the 4.9 Linux kernel and right now webiopi only supports the 4.4 that ships with stock Raspbian Jessie.

If you have no specific need for the 4.9 kernel on your Pi, you can downgrade to 4.4 by running this command (it will require a reboot after it runs)

sudo rpi-update 52241088c1da59a359110d39c1875cda56496764

After you’re running 4.4 again the problems you’ve described should automatically go away. If you do need the 4.9 kernel specifically, you can still use Cayenne by running an MQTT Client on your Pi using our Python MQTT Library instead of the Raspberry Pi agent that you’re currently using. Certainly feel free to ask me for help if you want to go down this road.

Regardless, we have a fix for the 4.9 compatibility issues that is already developed and currently being tested with our QA team. As soon as it is released, your current Pi agent will be automatically updated and then you can run whichever kernel version you prefer. We’ll make an announcement of its release in the Announcements section of our Cayenne Community forum at that time.

Please let me know if you have any questions.

Thanks so much for the quick response as this is part of a home automation
project and I am going to test the lights this weekend at my cabin.
As you could probably tell I am a test engineer and sorry if there was to
much detail but that is how I write basic defects :slight_smile:

I will run the kernel downgrade here and let you know if it was a success.

Again thanks for you quick response and you team is doing great stuff!

Eric

My background was in software QA so this was very much appreciated! I’m all about Steps to Reproduce and extra information. So thank you, if you didn’t post the kernel version, I’d have had to ask just to be sure it was that issue. :slight_smile:

By the way, if it irks your QA brain to know that I moved this to ‘Resolved’ ahead of time, please know you are free to post here if you still suspect trouble, we can always move it back. I’m just pretty confident that the kernel is the issue here.

Thank so much and it is fine to move it to resolved as your explanation +
my testing proved it worked -

myDevices - INFO - AddSensor:Light Switch1Fxz53JrywoDKxqHELightSwitch
{‘channel’: 17, ‘invert’: True, ‘gpio’: ‘GPIO’}
2017-05-24 08:38:05 - myDevices - INFO - Webiopi add sensor request:
{“device”: “LightSwitch”, “name”: “Fxz53JrywoDKxqHE”, “description”: “Light
Switch1”, “args”: {“channel”: 17, “invert”: true, “gpio”: “GPIO”}}
2017-05-24 08:38:05 - myDevices - INFO - Webiopi add sensor response: OK
2017-05-24 08:38:05 - myDevices - INFO - PacketTypes.PT_PROCESS_LIST
2017-05-24 08:38:06 - myDevices - INFO - History CalculateAverages
increment: 73
2017-05-24 08:38:06 - myDevices - INFO - Calculate sensor info averages:
{‘SensorsInfo’: {}}
2017-05-24 08:38:06 - myDevices - INFO - Save History Averages
2017-05-24 08:38:06 - myDevices - INFO - Memory usage : 7 size: 21904

Thanks again!

Eric

1 Like

@eworden

I just wanted to bump this thread to note that we’ve now updated our Pi agent to support the 4.9 kernel (it still supports 4.4 as well). The update was automatic in the background so there is nothing you need to do on your end. Feel free to use rpi-update to move forward to the 4.9 kernel at this point if you’d like!