<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.plugtests.net/oneM2M-Hackathon-Dallas-2018/index.php?action=history&amp;feed=atom&amp;title=Device_Kit_example</id>
	<title>Device Kit example - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.plugtests.net/oneM2M-Hackathon-Dallas-2018/index.php?action=history&amp;feed=atom&amp;title=Device_Kit_example"/>
	<link rel="alternate" type="text/html" href="https://wiki.plugtests.net/oneM2M-Hackathon-Dallas-2018/index.php?title=Device_Kit_example&amp;action=history"/>
	<updated>2026-04-11T04:29:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.plugtests.net/oneM2M-Hackathon-Dallas-2018/index.php?title=Device_Kit_example&amp;diff=110&amp;oldid=prev</id>
		<title>Velez: Created page with &quot;&lt;div class=&quot;noautonum&quot;&gt;__TOC__&lt;/div&gt;  == Demonstration high level architecture  ==  File:Diagram.png   ==  Prerequisites == The following tools are required to run this de...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.plugtests.net/oneM2M-Hackathon-Dallas-2018/index.php?title=Device_Kit_example&amp;diff=110&amp;oldid=prev"/>
		<updated>2018-03-02T12:03:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div class=&amp;quot;noautonum&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;  == Demonstration high level architecture  ==  &lt;a href=&quot;/oneM2M-Hackathon-Dallas-2018/index.php?title=File:Diagram.png&quot; title=&quot;File:Diagram.png&quot;&gt;File:Diagram.png&lt;/a&gt;   ==  Prerequisites == The following tools are required to run this de...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;noautonum&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demonstration high level architecture  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Prerequisites ==&lt;br /&gt;
The following tools are required to run this demonstration.&lt;br /&gt;
*JAVA 1.8&lt;br /&gt;
*Arduino IDE 1.8.5&lt;br /&gt;
*NodeJS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Download the project ==&lt;br /&gt;
&lt;br /&gt;
Download the oneM2M demo project from Github from the following link:&lt;br /&gt;
&lt;br /&gt;
https://github.com/mbenalaya&lt;br /&gt;
&lt;br /&gt;
The project contains the following folders:&lt;br /&gt;
*onem2m-platform&lt;br /&gt;
*onem2m-device&lt;br /&gt;
*onem2m-app&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Start oneM2M platform instance==&lt;br /&gt;
__TOC__&lt;br /&gt;
The oneM2M platform is available on folder “oneM2M Platform”&lt;br /&gt;
&lt;br /&gt;
===Configure the platform===&lt;br /&gt;
You can keep the default configuration for a local demonstration. The platform will listen on ports 8080 and 8443. The database is reset after each restart.&lt;br /&gt;
&lt;br /&gt;
If needed, you can change the configuration of the platform by editing the file “configuration/config.ini”.&lt;br /&gt;
&lt;br /&gt;
===Start the platform===&lt;br /&gt;
Start the platform by executing the &amp;quot;start.bat&amp;quot; script on Windows or &amp;quot;start.sh&amp;quot; on Linux and Mac OS.&lt;br /&gt;
&lt;br /&gt;
[[File:Console.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Login to oneM2M web interface===&lt;br /&gt;
Open the following URL in your browser to access the oneM2M platform web interface: &lt;br /&gt;
https://127.0.0.1:8080/webpage&lt;br /&gt;
&lt;br /&gt;
[[File:Login.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enter &amp;quot;Cae-admin&amp;quot; as originator then click on “connect”.&lt;br /&gt;
&lt;br /&gt;
[[File:Resource-tree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connect your IoT Device==&lt;br /&gt;
The arduino source code and required libraries are available on the folder onem2m-device.&lt;br /&gt;
&lt;br /&gt;
===Schematics===&lt;br /&gt;
*Breadboard&lt;br /&gt;
*Nodemcu board&lt;br /&gt;
*LED&lt;br /&gt;
*Luminosity Sensor&lt;br /&gt;
*1Kohm resistance&lt;br /&gt;
&lt;br /&gt;
Connect the LED and luminosity sensor to the Nodemcu board using:&lt;br /&gt;
&lt;br /&gt;
[[File:Board-plan.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Real wiring:&lt;br /&gt;
&lt;br /&gt;
[[File:Real-wiring.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Download and install arduino IDE===&lt;br /&gt;
Download and install the Arduino IDE v1.8.5 from the following link:&lt;br /&gt;
https://www.arduino.cc/en/Main/Software&lt;br /&gt;
&lt;br /&gt;
NB: We don’t recommend to use the Arduino Web Editor for this demonstration because the nodemcu board is not supported.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Add Nodemcu board to Arduino IDE===&lt;br /&gt;
&lt;br /&gt;
Firstly open the Arduino IDE&lt;br /&gt;
Go to files and click on the preference in the Arduino IDE&lt;br /&gt;
&lt;br /&gt;
[[File:Arduino-ide.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
copy the below code in the Additional boards Manager&lt;br /&gt;
&lt;br /&gt;
http://arduino.esp8266.com/stable/package_esp8266com_index.json&lt;br /&gt;
&lt;br /&gt;
click OK to close the preference Tab.&lt;br /&gt;
&lt;br /&gt;
After completing the above steps , go to Tools and board, and then select board Manager&lt;br /&gt;
&lt;br /&gt;
[[File:Arduino-ide2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Navigate to esp8266 by esp8266 community and install the software for Arduino.&lt;br /&gt;
&lt;br /&gt;
[[File:Arduino-ide3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all the above process been completed you are ready to program the nodemcu board with Arduino IDE.&lt;br /&gt;
&lt;br /&gt;
===Add Arduino “Timer.h” library===&lt;br /&gt;
&lt;br /&gt;
The “Timer.h” library is available on the zip folder “Timer-master.zip”.&lt;br /&gt;
&lt;br /&gt;
Go to Sketch, and then select “include library”.&lt;br /&gt;
Chose the “Add .ZIP library” option&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Arduino-ide4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select the zip folder “Timer-master.zip” then confirm.&lt;br /&gt;
NB: You don’t have to extract the zip content.&lt;br /&gt;
&lt;br /&gt;
===Configure the oneM2M sketch===&lt;br /&gt;
Open the sketch “onem2m-adn.ino” in your Arduino IDE.&lt;br /&gt;
&lt;br /&gt;
Set your WIFI parameters&lt;br /&gt;
*const char* ssid = &amp;quot;XXXXXXXX&amp;quot;;&lt;br /&gt;
*const char* password = &amp;quot;XXXXXXXX&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Set the IP address of the oneM2M platform&lt;br /&gt;
*const char* host = &amp;quot;XXXXXXXX&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Compile the oneM2M sketch===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on verify button [[File:Button1.png]] to compile the sketch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compilation output:&lt;br /&gt;
&lt;br /&gt;
[[File:Compiliation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Upload the oneM2M sketch to Nodemcu board.===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on upload button [[File:Button2.png]] to upload the sketch to the nodemcu board .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upload output:&lt;br /&gt;
&lt;br /&gt;
[[File:Compiliation2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Debug the code execution using serial monitor===&lt;br /&gt;
&lt;br /&gt;
Cick on [[File:Button3.png]] button to open the Arduino Serial Monitor to display the Nodemcu console.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then after opening the Serial Monitor select 115200 from the drop-down list.&lt;br /&gt;
&lt;br /&gt;
[[File:Monitor.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Check IoT device resources on oneM2M web interface===&lt;br /&gt;
You should see “mydevice1” Application Entity resource with “luminosity” an “led” containers created on the oneM2M resource tree.&lt;br /&gt;
&lt;br /&gt;
[[File:Resource-tree2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connect your IoT application==&lt;br /&gt;
The luminosity monitoring application source code is available on the folder onem2m-app&lt;br /&gt;
&lt;br /&gt;
===Configure application===&lt;br /&gt;
Open the file onem2m-monitor.js with a text editor.&lt;br /&gt;
&lt;br /&gt;
Set the IP address of the oneM2M platform. You can keep localhost if you are running the oneM2M platform and the application in the same machine. &lt;br /&gt;
&lt;br /&gt;
===Start the application===&lt;br /&gt;
&lt;br /&gt;
Start the nodejs oneM2M application using the following command:&lt;br /&gt;
&amp;gt; node onem2m-monitor.js &lt;br /&gt;
&lt;br /&gt;
[[File:Console2.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Check IoT application resource on oneM2M web interface===&lt;br /&gt;
&lt;br /&gt;
You should see “mymonitor1” Application Entity resource created on the oneM2M resource tree.&lt;br /&gt;
&lt;br /&gt;
[[File:Resource-tree3.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&lt;br /&gt;
If you hide the luminosity sensor with your hand for few seconds, you should see the led switched ON by the monitoring application and vice versa.&lt;br /&gt;
&lt;br /&gt;
[[File:Final-result.png]]&lt;/div&gt;</summary>
		<author><name>Velez</name></author>
	</entry>
</feed>