siovene / smart-home-control

A simple demo app for the Cordova OCF plugin, that interfaces with a smart home prototype
2 stars 3 forks source link

The RGB LED sensor can't work well #13

Closed qiuzhong closed 7 years ago

qiuzhong commented 8 years ago

For smart-home-control v0.7.0, the RGB LED can be found and work sometimes. However, there are some cases it doesn't work quite well.

Steps:

  1. Launch the RGB LED OCF server and create a RGB LED resource
  2. Launch the smart-home-control app, open "Continuous discovery" in settings, it will discover the RGB LED sensor.
  3. Click the color picker, change the color RGB value

    • In the terminal of OCF server side, sometimes we got invalid RGB value like this:

      RGB_LED 1952: Update received. value:  255,255,NaN
      RGB_LED 1952: Send the response. value:  255,255,NaN
      RGB_LED 1952: Send the response. value:  255,255,NaN
      RGB_LED 1952: Successfully notified observers.

      It can be raised by changing the R to 255, G to 255 and keeping the B unchanged.

    • In the terminal of OCF server side, sometimes the response value can be updated, but the LED didn't change color. However, not sure this case is related to the smart-home-control.

Test Environements

Nexus 5 Android 5.0.1 Intel Edison board flashed with Ostro image#510 (iotivity-1.1.1) SmartHome-Demo#c32b699

qiuzhong commented 7 years ago

Currently, the RGB LED can't work as expected. The color can change sometime, but it's not the RGB value the app sends to the OCF server. At the OCF server side rgb_led.js, the range and rgbValue properties of Colour RGB resource are arrays. It complies the OCF spec.

However, if I change the range and rgbValue back to strings in rgb_led.js (not comply the OCF spec), the RGB LED can work well.

qiuzhong commented 7 years ago

I think this issue is related to issue #18

qiuzhong commented 7 years ago

Verified. The RGB LED can work quite well with release v0.8.4.