Testing the communication reliability | MATLAB IoT Analytics | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Testing the communication reliability
No permission to create posts
July 24, 2018
10:20 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

Hi everyone,

is it possible to create artificially communication faults, data congestion or corrupted data etc.

in order to test how the communication network responds to that?

thanks in advance

Nikolas

September 18, 2018
7:52 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 861
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

One way you could do this is to change your local DNS server setting to something that cannot resolve api.thingspeak.com or thingspeak.com. You can also create a custom plugin that goes RED/GREEN if the device has not sent data to ThingSpeak within a certain time. Here’s an example:

Plugin HTML:

%%PLUGIN_CSS%%
%%PLUGIN_JAVASCRIPT%%

Device data collection status

Plugin CSS:

body { background-color: #fff; }

.led-box {
height: 90%;
width: 100%;
margin-top: 30px;
float: left;
}

.led-box p {
text-align: center;
font-size: 25px;
margin: 1em;
}

.red-led {
margin: 0 auto;
width: 100px;
height: 100px;
background-color: #F00;
border-radius: 50%;
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 12px;
}

.green-led {
margin: 0 auto;
width: 70px;
height: 70px;
background-color: #0F0;
border-radius: 50%;
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #304701 0 -1px 9px, #89FF00 0 2px 12px;
}

Plugin JavaScript:

https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
https://www.google.com/jsapi

google.setOnLoadCallback(initChart);

// load the data
function loadData() {

// get the data from thingspeak
$.getJSON('https://api.thingspeak.com/channels/_CHANNEL_ID_/feed/last.json?api_key=READ_API_KEY', function(data) {

// get the data point
p = (Date.now() - new Date(data.created_at)) / (60*1000);
q = document.getElementById('LED');

// if there is a data point display it
if (p && q) {
if (p>3){ q.className = 'red-led'; } else {q.className = 'green-led';}
}
});
}

// initialize the chart
function initChart() {
loadData();
// load new data every 15 seconds
setInterval('loadData()', 15*1000);
}

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
23 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

qkpham, SANGAMNATH B, swatiiot, kalyanigaware16@gmail.com, Romi, Drakan01

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457