<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by rouzbeh karimi on Medium]]></title>
        <description><![CDATA[Stories by rouzbeh karimi on Medium]]></description>
        <link>https://medium.com/@rouzikrm?source=rss-a1fa81ecc0bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nuWJVXzETPE-hsOU.jpg</url>
            <title>Stories by rouzbeh karimi on Medium</title>
            <link>https://medium.com/@rouzikrm?source=rss-a1fa81ecc0bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:47:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rouzikrm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to setup iofogctl on Raspberry Pi OS]]></title>
            <link>https://rouzikrm.medium.com/how-to-setup-iofogctl-on-raspberry-pi-os-27ac43c91ea6?source=rss-a1fa81ecc0bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ac43c91ea6</guid>
            <category><![CDATA[iofogctl]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[edge]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[rouzbeh karimi]]></dc:creator>
            <pubDate>Thu, 03 Dec 2020 16:41:03 GMT</pubDate>
            <atom:updated>2020-12-03T16:44:43.129Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0a8bEB6XnGpjtSYpDlK9LQ.jpeg" /></figure><p>In a <a href="https://medium.com/natix-io/implementing-an-intelligent-edge-ecosystem-using-iofog-b2bd914c3780">previous article</a> I described how you can implement an intelligent edge ecosystem using iofog to demonstrate an AI oriented example on edge.</p><p>In this section we are going to prepare ourselves to deploy the previous example on a real edge device by setting up iofogctl on raspberry pi os.</p><p>to setup iofogctl on raspberry pi os we need to build it for ARM architecture and since it is developed using golang we should first setup the go sdk on raspberry.</p><p><strong>Install Go SDK</strong></p><p>first navigate to <a href="https://golang.org/dl/">https://golang.org/dl/</a> and choose the go sdk ending in armv6l.tar.gz like <a href="https://golang.org/dl/go1.15.5.linux-armv6l.tar.gz">https://golang.org/dl/go1.15.5.linux-armv6l.tar.gz</a> ,</p><p>wget https://golang.org/dl/go1.15.5.linux-armv6l.tar.gz</p><p>then extract it using sudo tar -C /usr/local -xzf go.1.15.5.linuxc-armv6l.tar.gz</p><p>to persist it as your os known commands edit ~/.profile and add the following lines</p><pre>PATH=$PATH:/usr/local/go/bin<br>GOPATH=$HOME/go</pre><p>now to apply your changes use the command bellow:</p><p>source ~/.profile</p><p>to make sure whether its setup is done execute go version and it must print the go version details.</p><p><strong>Install iofogctl</strong></p><p>to install iofogctl you should download its tagged version source from <a href="https://github.com/eclipse-iofog/iofogctl/releases">https://github.com/eclipse-iofog/iofogctl/releases</a>. <a href="https://github.com/eclipse-iofog/iofogctl/archive/v2.0.3.tar.gz">https://github.com/eclipse-iofog/iofogctl/archive/v2.0.3.tar.gz</a> .</p><p>now extract it using tar -xzf v2.0.3.tar.gz .</p><p>now if you do not have rice go module first go on and run sudo apt-get install golang-rice .</p><p>then go to extracted iofogctl tar folder, edit the Makefile, find export GOARCH ?=amd64 , change it to export GOARCH ?=arm and save your changes.</p><p>go on and run make build in same folder.</p><p>the script will create a bin folder putting a file named iofogctl in it. to make sure it has the right architecture run file bin/iofogctl | grep --color -i arm and it should highlight the arm word in terminal.</p><p>if so go on and run cp bin/iofogctl /usr/local/bin/. and when you execute iofogctl you should see its help prompt showing up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ac43c91ea6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing an Intelligent Edge Ecosystem using ioFog]]></title>
            <link>https://medium.com/natix-io/implementing-an-intelligent-edge-ecosystem-using-iofog-b2bd914c3780?source=rss-a1fa81ecc0bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2bd914c3780</guid>
            <category><![CDATA[natix-tech]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[iofog]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[rouzbeh karimi]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 13:56:01 GMT</pubDate>
            <atom:updated>2020-04-15T17:14:57.971Z</atom:updated>
            <content:encoded><![CDATA[<h3>Implementing an Intelligent Edge Network using ioFog</h3><p>In this post, we want to implement a practical edge solution using <a href="https://iofog.org/">ioFog</a> platform. To do so, we are going to simulate an intelligent edge network that is in charge of collecting the power usage history of its neighbor urban devices (e.g. cameras) and detect frequent electrical surges that may damage the device in long term.</p><p>In this Network we have 3 roles:</p><ul><li>Edge Device — Reporting its power usage.</li><li>Frequent Electrical Surge Detector — Collecting and analyzing power usage reports.</li><li>Dashboard — visualizing the detector Analysis.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ro6EcxATxEsVnI3Gl3agGA.jpeg" /><figcaption>Network Diagram</figcaption></figure><h3>How ioFog Works</h3><p>ioFog is a microservice friendly platform, which runs your code in an isolated manner on the edge devices. It enables internal communication between edge nodes using predefined routes. A quick note here that might help the reader to better understand ioFog:</p><blockquote>ioFog is a tool similar to kubernetes, in many ways. Soon you’ll see why.</blockquote><p>With this background information, we are now ready to start our project!</p><p>To set up our environment, make sure you have Docker installed (<a href="https://docs.docker.com/engine/install/">installation guide</a>). Then, take a look at <a href="https://iofog.org/docs/1.3.0/getting-started/quick-start.html#deploy-iofog-locally">Quick Start Guide of ioFog</a> and only execute the `Deploy ioFog Locally` section commands. When it’s done, execute docker ps in your CLI and you should see ioFog platform running containers.</p><h4>Implementing Edge Device</h4><p>Now that we have our environment ready, let’s create our edge-device<br>app which is shown in the diagram above, by a blue box. We are going to build this application with Node.js. Make sure you have <a href="https://nodejs.org/en/download/">Node.js and npm installed</a>.</p><p>Now, execute npm init command in a directory of your choice. When you are asked for project properties, you can name this project edge-device. This will create the Node.js standard project structure. As we want to create an app in ioFog platform based Network, we need to install ioFog Node.js SDK using the following command.</p><p>npm i @iofog/nodejs-sdk</p><p>After having all the dependencies in place, we need to create an index.js file for this project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6badae95de4fa22532fe57be3ec780c7/href">https://medium.com/media/6badae95de4fa22532fe57be3ec780c7/href</a></iframe><p>The ioFog Platform supports docker, so to finish implementing our logic and deploy it in ioFog platform, we should define the container structure descriptor which encapsulates our code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c81f9ab77c2c4443d78fedef7a067e05/href">https://medium.com/media/c81f9ab77c2c4443d78fedef7a067e05/href</a></iframe><p>The following command creates the container <br>docker build --no-cache -t natix-io/edge-device:v1 -f ./edge-device/Dockerfile</p><p>Just like Kubernetes, in order to deploy our code in ioFog platform, we should create an ioFog App Descriptor file to tell the ioFog platform how to deploy our app.</p><p>To examine what we did so far, let’s create a config.yaml file inside the folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b42645922fc4fc5e3835cd09c306478/href">https://medium.com/media/9b42645922fc4fc5e3835cd09c306478/href</a></iframe><p>The final folder structure looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/175/1*uO9YL61Yq5XKc1lrq3Glqw.png" /><figcaption>edge-device project structure</figcaption></figure><p>Note that we have defined two microservices using the same image we have just created, passing different parameters on their config section. We also explicitly connected these two using routes the key which is in the same level of microservices as a child of spec.</p><p>Now, if you run iofogctl deploy application -f edge-device/config.yaml, the two edge devices will be running. You will see something similar to the following picture if you run iofogctl get microservices</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*JKj4a2ed1TqgsGDd9cQQzA.png" /><figcaption>iofogctl get microservices output</figcaption></figure><p>Then get the Cam2 docker id using docker ps and trace its log using docker logs -f [Cam2 docker id]. You will see messages showing up as the log.</p><h4>Implementing Frequent Electrical Surge Detector</h4><p>This application’s role is to analyze and detect surges (anomalies) in power consumption behavior. Notice, in real-world scenarios, it is more practical to broadcast the detected surges as an alarm to the teams in charge by publishing it using an app like Slack. For this demo, we publish its data via an API.</p><p>To develop the app, let’s create a folder named usage-anomaly-detector and implement content below, inside a index.py file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4fdc1631f325e66687fa9b5b6364671/href">https://medium.com/media/d4fdc1631f325e66687fa9b5b6364671/href</a></iframe><p>Next, we create a container using the following docker file and command. As a reminder, we need this to encapsulate and prepare our app for ioFog platform.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ab2b7abe3e38077854f50a7b989f8ff/href">https://medium.com/media/7ab2b7abe3e38077854f50a7b989f8ff/href</a></iframe><p>docker build — no-cache -t natix-io/usage-anomaly-detector:v1 -f ./usage-anomaly-detector/Dockerfile .</p><p>Notice the port 5000 is exposed in order to facilitate API access.</p><p>Continue by creating a config.yaml file, just like we did before, to test the app. The final structure should be as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*qPZxHt1cwlPYNj2S7Wo4Bg.png" /></figure><h4>Implementing Dashboard</h4><p>Similar to what we have done before, we initiate the project with these commands:</p><pre>npm init<br>npm i <a href="http://twitter.com/vue/cli">@vue/cli</a><br>vue create usage-anomaly-dashboard</pre><p>If you are interested to know more about its structure and how it works, you can visit <a href="https://vuejs.org/v2/guide/">Vue.js</a> website.</p><p>vue create command will create the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*4m6ENkiVk8mKVzm0uC3d0Q.png" /></figure><p>Now we modify the main.js content using the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc09b4fb9754d6ac79f1dc8f4c600e9b/href">https://medium.com/media/dc09b4fb9754d6ac79f1dc8f4c600e9b/href</a></iframe><p>Change the content of App.vue using the provided code, as well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3a5458c8dff00b5443e9f52be2ed410/href">https://medium.com/media/a3a5458c8dff00b5443e9f52be2ed410/href</a></iframe><p>To create a component that lists the devices, we need a Vue file ./components/EdgeDeviceSelectDropDown.vue with the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbc28434c089a2b22e93d1badc850563/href">https://medium.com/media/dbc28434c089a2b22e93d1badc850563/href</a></iframe><p>The following Dockerfile and command create a container for this Dashboard</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/caefd5a4e188ef7cb39f505c171131ed/href">https://medium.com/media/caefd5a4e188ef7cb39f505c171131ed/href</a></iframe><p>docker build — no-cache -t natix-io/usage-anomaly-dashboard:v1 -f ./usage-anomaly-dashboard/Dockerfile .</p><p>Now we need to create .env file in the parent folder ( ../usage-anomaly-dashboard) and add VUE_APP_ANOMALY_REPORT_API=<a href="http://192.168.1.5:5000/api/raw">http://[your host ip]:5000/api/raw</a>.</p><p>In addition, create a config.yaml file in the parent folder ( ../usage-anomaly-dashboard) and add the following content to it. It does not matter where you place it. Just remember the location in order to pass it to iofogctl command.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebb48ce6d78263b41ed206f43bea7d75/href">https://medium.com/media/ebb48ce6d78263b41ed206f43bea7d75/href</a></iframe><p>Finally, run iofogctl delete -f config.yaml then iofogctl deploy application -f config.yaml and after a few minutes, you can see anomaly-detection API output at http://127.0.0.1:5000 and its dashboard at http://127.0.0.1:7778</p><p>You can skip all of the above steps and get a quick look by just checking out the project on <a href="https://github.com/NATIX-io/iofog-urban-ai-example">GitHub</a>.</p><p>To execute the project, you need to simply create .env file in the root folder and add VUE_APP_ANOMALY_REPORT_API=<a href="http://192.168.1.5:5000/api/raw">http://[your host ip]:5000/api/raw</a> and then clone the project:</p><p>git clone https://github.com/NATIX-io/iofog-urban-ai-example.git</p><p>As the last step, execute ./setup.sh and everything will be up and running shortly after.</p><h3><strong>Conclusion</strong></h3><p>ioFog is a developer-friendly platform, especially if you have experience working with Docker and Kubernetes technologies. The routes concept is a great facilitator. It handles security concerns by letting developers limit the visibility of the app at runtime via routes. This leads to fewer security concerns as long as you stick with the routes and have no urge to expose some custom ports which makes it a suitable platform to implement urban edge solutions.</p><p><em>DISCLAIMER: This post just reflects the author’s personal opinion, not any other organization. This is not official advice. The author is not responsible for any decisions that readers choose to make.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2bd914c3780" width="1" height="1" alt=""><hr><p><a href="https://medium.com/natix-io/implementing-an-intelligent-edge-ecosystem-using-iofog-b2bd914c3780">Implementing an Intelligent Edge Ecosystem using ioFog</a> was originally published in <a href="https://medium.com/natix-io">NATIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>