Giter VIP home page Giter VIP logo

ocf_mylight's Introduction

Build Status FOSSA Status

OCF Light sample

  • Smart Home Light sample.
  • TizenRT version
    • Iotivity 1.2.1
    • You can control 2 LEDs on the ARTIK 053 STARTER BOARD
      • /a/light/0
      • /a/light/1
    • Iotivity secured mode not supported. (TODO)
  • Linux version
    • IoTivity 1.3 (oic_1.1 branch uses IoTivity 1.2.1)
    • Support 2 resources (virtual)
      • /a/light/0
      • /a/light/1
  • This source code was referenced to TizenRT/apps/examples/iotivity_simpleserver.

Build

TizenRT

Reference document

Build

  • Download
git clone https://github.com/Samsung/TizenRT.git
cd TizenRT
git clone https://github.com/webispy/ocf_mylight -b oic_1.1 apps/examples/ocf_mylight
  • Configure / Build
cd TizenRT/os/tools
./configure.sh artik053/iotivity
cd ..
make menuconfig
  Application Configuration
    -> Examples
      -> [ ] Enable building IoTivity Samples
         [*] OCF My Light sample application
make

Linux (Tested Ubuntu 16.04 environment)

Reference document

Build

  • Download
git clone https://github.com/iotivity/iotivity.git -b 1.3-rel
cd iotivity
git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor
git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls -b mbedtls-2.4.2
git clone https://github.com/webispy/ocf_mylight resource/csdk/stack/samples/linux/ocf_mylight
  • Modify resource/csdk/stack/samples/SConscript
diff --git a/resource/csdk/stack/samples/SConscript b/resource/csdk/stack/samples/SConscript
index f5e9a6030..ae1fedbad 100644
--- a/resource/csdk/stack/samples/SConscript
+++ b/resource/csdk/stack/samples/SConscript
@@ -25,6 +25,7 @@ target_os = stacksamples_env.get('TARGET_OS')
 if target_os in ['linux', 'windows']:
     # Build C Samples
     SConscript('linux/OCSample/SConscript', 'stacksamples_env')
+    SConscript('linux/ocf_mylight/SConscript', 'stacksamples_env')
     SConscript('linux/SimpleClientServer/SConscript', 'stacksamples_env')

     if stacksamples_env.get('SECURED') == '1':
  • Build with debug message
scons -j8 RELEASE=False SECURED=1 RD_MODE=SERVER
  • Build without debug message
scons -j8 RELEASE=True LOGGING=False SECURED=1 RD_MODE=SERVER

Run

TizenRT

minicom -D /dev/ttyUSB{your-device-serial-number}
TASH> wifi startsta
TASH> wifi scan
TASH> wifi join {SSID} {PASSWORD}
TASH> ifconfig wl1 dhcp
TASH> ocf_mylight

Linux

Iotivity Debug mode

Create a dat file (Convert json to dat using json2cbor tool)

cd {iotivity-repo}/out/linux/x86_64/debug/resource/csdk/stack/samples/linux/ocf_mylight
../../../../security/tool/json2cbor json/oic_svr_db_server_justworks_rpin.json oic_svr_db_server.dat

Run

cd {iotivity-repo}/out/linux/x86_64/debug/resource/csdk/stack/samples/linux/ocf_mylight
./ocf_mylight

Iotivity Release mode

Create a dat file (Convert json to dat using json2cbor tool)

cd {iotivity-repo}/out/linux/x86_64/release/resource/csdk/stack/samples/linux/ocf_mylight
../../../../security/tool/json2cbor json/oic_svr_db_server_justworks_rpin.json oic_svr_db_server.dat

Run

cd {iotivity-repo}/out/linux/x86_64/release/resource/csdk/stack/samples/linux/ocf_mylight
./ocf_mylight

License

FOSSA Status

ocf_mylight's People

Contributors

fossabot avatar webispy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fossabot sdsxpln

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.