Problem statement
----------------------------------------------------
Have you ever come across a situation where an automated intimation of ongoing process required. Lets not make it vary chaotic. Lets consider some practical scenario -
Scenario 1 - You're working on a project and you need to measure the ongoing/past activity anytime & anywhere.
Scenario 2 - End consumer of your product want to get intimation and detail report regarding the ongoing/past operation carried at his/her site anytime & anywhere.
Adding to these two cases, requirement also demand that the system should provide provision for quick analysis of operation in few glance.
Possible Solution
----------------------------------------------
If I am not wrong, the first thought appear to your mind is to make the system compatible for long distance connectivity and communication using Ethernet as one of the source.
yes, thats completely correct!!
But, what about the dynamic & static analysis of ongoing/past operation. Off course it may bring some faint idea of log collection or report collection. And made this accessible through Internet. That also somewhat correct!!
But, now if I say the report or log should be self explainable without intervening much into it.So, what's the next thought.Here also number of option arise -
What this blog going to say ??
--------------------------------------------------------------------------------
Hence, the intention of this blog is to tell about the method of accessing & analyzing any embedded system using suitable target device.The target device can be anything - Mac OS, Linux, Window, Android based device.
Proposed Solutions
-----------------------------------------------------
Solution is to provide a GUI on all above mentioned devices which should be capable of establishing distance connection and then talk to the embedded device to get the ongoing process data. Finally log the data and also represent the data in graphical format.
How it is practical for small system like Embedded ??
------------------------------------------------------------------------------------------------------------
There is nothing like high end and low end. Once the unit is connected to Ethernet then what high-end unit can deliver, the same can be delivered using an embedded device.It may/may not require any additional h/w support depend on the requirement.
You can refer my previous blog on "Web-interface for Embedded Device" [1], it give very detail idea on Ethernet connectivity.
How to begin??
-------------------------------
So, the idea is to develop a user interactive GUI which reside in customer machine like PC, Mobile or Tablet. And using this GUI, client/customer can communicate with the target device which is an embedded system.
What is QT?? What is VB??
-------------------------------------------------------
There are many GUI development tool available. Some of the well known & commonly used tools are QT and Visual Studio. QT is basically used for developing multi-platform applications and GUI that can run on various software and hardware with limited changes. Its a cross-platform application software.Its have very high end usage it supports a huge versatility which includes - Linux, mac/ios, Windows, Embedded - QNX, VXworks and many more. Its full fledge license cost is more then 3500$.
On other hand Visual Studio is also coming up with multi-platform support. Along with its native Window platform, it also facilitate installation on Android, Linux & Mac. It's an IDE which also support GUI development commonly known as "Window form application" or MFC. It support a huge variety of GUI also. And its license cost starts from 30K INR to some lakhs in INR depending on the version. Visual Studio currently doesn't support any GUI development for Embedded Platform [2]. But still its having demand in many application & GUI development.
And how much time needed for development??
---------------------------------------------------------------------------------
In today's date all these applications are so automated and trailing ample amount of resources on Internet using which one can become a quick learner of GUI development. Also user can start with trial version of these GUI in order to check the comfortability. So, bothering about development time is no more a stringent requirement. But, yes in essence developer need to be familiar with the object oriented concept. Because almost all well known GUI uses C++ as underlying concept.
I hope till now the rationale of this blog is very much clear to reader. So, before narrating ahead let me make the topic completely clear. In this blog I will be showing you how I am using Visual Studio "Visual basic C++" for GUI development and using this how I am reading an analog data from embedded device and plotting a graph for user analysis.Its a miniature demo of home automation & its live graphical capture.
End Application - IoT & Microsoft Azure
------------------------------------------------------------------------------------------------------------
Yes, its a part of cloud computing used in day-to-day life. It can be considered as an end solution for IoT, where number of sensors feeding the data to client end. And dynamic plotting of values done at client side for analysis. Similarly Microsoft Azure provide remote solution to client/customer. The same methodology can be plugged in to the Azure for remote uses.
Methodology - What exactly I done here ??
-----------------------------------------------------------------------------------------------------------------
Embedded based system is the server end. And visual basic based application running on client end on a windows platform. Both the server & client remain connected to a local LAN. Off course the same is very very apparent in WLAN, it require some paid uses [3]. So, the client application will ping to server system to send the latest data. On receiving the request the Embedded server end will run its .exe program for extracting the current analog value. [Here, basically an analogy of sensor is made by varying the potentiometer, but in practical there might be any real life sensors like temperature, light, pressure etc.]
So, the current analog data will be collected by a file stream and registered on the file. Once registered, the server side web-service i.e. a node.js based javascript will read and send the content of file to the client side service which is again a javascript for receiving the data from server. Client side web-service will read the data and append it to the repository file from where the Visual basic based application will fetch the data and plot the analysis graph.
On Window Platform end -
Here it contains the Visual c++ based Window form application (WFA) which provide the GUI part. Along with this there is a javascript running on the background which frequently make connection with the server end at an periodic interval of approximately 1.8sec. Fetch the data from server and log the data in appending form to the client file. The GUI which is an Visual basic based application checks continuously if the file is ideal or not. If the GUI find its ideal, then it read the latest value from the file and extrapolate the value on a line graph in X-Y format.
On Embedded Side -
Ideally speaking, it can be any embedded based device which is having capability of running Ethernet stack and capable of doing HTTP based interaction. So, here I had used a Beagle bone Black, a Linux based Embedded System. On this, a javascript which form the server runs and listen for any incoming connection. Once a connection is identified, then the immediate next task is to run the .exe application which is responsible for measuring the analog parameter and log the value on to the file system. Further the server script will read this file and pass the same data to the web-client, who has requested for the service.
You can refer the architectural block diagram shown below for better understanding -
Point of Interest
---------------------------------------
So, I guess with this much description one point strike the mind of most of the user & enthusiast is "how to build a GUI using Visual Basics."
The solution is pretty simple. I recommend viewing the tutorial available on You Tube, visual studio has a rich source of graphical widgets, so its not possible to expect You Tube to cover each & every widget usage in detail. But, yes it covers all basic concept right from installation of visual studio to uses of common widgets for application development. Also the msdn site [4] (i.e. Microsoft Native site) has all detail content right from methods & class related to all widgets provided by visual studio. Also it shows a bunch of code snippet in VB, .net & c++ which helps user to understand application development using Visual Studio. Also once the developer done with the GUI and tested all its functionality, then he can publish the .exe of this application and easily transfer to the customer via any media or online source.
From the technical point - Its a c++ based framework. So, at some point down the line the GUI developer has to link itself to the coding part and need to interact with C++ domain. Still C as a active logic can be used, but beauty will comes from the use of object oriented concept. e.g. In the GUI, if the requirement is to fetch a data from a file on a button press. Then with C++ advance concept like file class or stream class things can be directly used which minimize the developer handling effort. But, same time with generic c concept the developer has to handle in the code. Also as we know C++ has many advantage & some disadvantages. Disadvantage tells about the memory footprint, but it really doesn't matter for GUI end. Since, many time the intended app is developed on a target system which has quite a good memory as compared to the embedded counterpart. So, its really very much practical to develop a complete interactive and user friendly GUI on system like Windows, MACoS, Android & Linux.
Video Description Explanation
-------------------------------------------------------------------------
As mentioned earlier. Here, I had used a Beagle bone which form the web server. Apart from this the extra h/w used are - 2 2.5mm LED's, One 1k Potentiometer, connecting wire and a breadboard.
The Red LED is used for PWM dimming. Based on the potentiometer setting the dimming done. So, it will give clear indication to user that the analog section is varying the value. Also depending on the intensity the viewer can also realize the changes done on potentiometer variation.
The Blue LED is a pulsing LED. Although it appear to pulsate at an interval of 1.8 sec and so. But this period is not fixed. It depends on client side. When connection is established it become ON and when client disconnect it OFF. Since at the client system the process is carried synchronously, hence the Blue LED blink gives a feel of periodic event. i.e. pulsing.
The Potentiometer it use to control an analog voltage of 3.3V and feed output to AIN6 i.e. 6th channel of ADC in Beagle bone. Its a 1K pot which can vary the output from 3mV to 3V. Depending on these value the ADC counts will be calculated. Here, the ADC used is a 12-bit resolution based ADC. Furthur the code is programmed for taking this count and manage a 50% duty cycle PWM and accordingly manage the brightness intensity of Red LED.
Apart from this a console based controlling can be done for beagle bone which will be part of server side. Usually it needed for initiating the server side process only. But additionally the current analog value also thrown on the console window, it may be used for debugging purpose. But having no role in overall application.
Finally coming to the Windows App. On Visual Basics. Its basically has 2 operational button - StartScan & StopScan. Rest all are the non-operational part which is not intended for the use of demo perspective. Apart from this there are - 1 TextBox & 1 Chart. Textbox is for representing data in digital format. And chart will represent data in analog form i.e. line chart. Textbox will only show the starting 25 readings not more then that, as logic for that has not developed for demo version. Also the chart will read a max of 100 readings and then it will roll over from 1st reading. After completion of 100 data, the log will automatically initiate. Large graphical representation is not the intention of this demo. But yes, it can be increased to tens of thousands.
Once, the user hit the startscan button the process of reading start, which also additionally pop-up two window console in order to give better idea about ongoing process [5]. These consoles are solely for developer & debug purpose, hence it can be eliminated from actual application when handover to the customer. On hitting StopScan the running process stops. And the textbox & Chart area get cleaned. Also StopScan will automatically facilitate the logging of current data.
Log as shown in demo is having a specific format which clearly tell the data & time stamp in its name. Easy for user to identify when the log has been taken. The actual application also has facility to upload this log and view the same in graphical form. Also alert the user for any abnormality by sending mail. For user information - Visual studio also supports SMTP using which window application also capable of sending mail to configured user.
Possible Extension
---------------------------------------------
Its basically a concept. Its up to user to decide its possible usage. Since it involves 3 major activities - Connectivity, Current/Previous data fetching & extrapolating, And logging as well. So, it can be part of numerous application. The one for which this application is built is basically for dynamic update & image identification. Rest details led to proprietary act.
References
---------------------------
----------------------------------------------------
Have you ever come across a situation where an automated intimation of ongoing process required. Lets not make it vary chaotic. Lets consider some practical scenario -
Scenario 1 - You're working on a project and you need to measure the ongoing/past activity anytime & anywhere.
Scenario 2 - End consumer of your product want to get intimation and detail report regarding the ongoing/past operation carried at his/her site anytime & anywhere.
Adding to these two cases, requirement also demand that the system should provide provision for quick analysis of operation in few glance.
Possible Solution
----------------------------------------------
If I am not wrong, the first thought appear to your mind is to make the system compatible for long distance connectivity and communication using Ethernet as one of the source.
yes, thats completely correct!!
But, what about the dynamic & static analysis of ongoing/past operation. Off course it may bring some faint idea of log collection or report collection. And made this accessible through Internet. That also somewhat correct!!
But, now if I say the report or log should be self explainable without intervening much into it.So, what's the next thought.Here also number of option arise -
- Draw a graphical plot especially in line chart format which narrate the entire story.
- Mark the reading in logged data with special symbol or color to identify any abnormal occurrence.
What this blog going to say ??
--------------------------------------------------------------------------------
Hence, the intention of this blog is to tell about the method of accessing & analyzing any embedded system using suitable target device.The target device can be anything - Mac OS, Linux, Window, Android based device.
Proposed Solutions
-----------------------------------------------------
Solution is to provide a GUI on all above mentioned devices which should be capable of establishing distance connection and then talk to the embedded device to get the ongoing process data. Finally log the data and also represent the data in graphical format.
How it is practical for small system like Embedded ??
------------------------------------------------------------------------------------------------------------
There is nothing like high end and low end. Once the unit is connected to Ethernet then what high-end unit can deliver, the same can be delivered using an embedded device.It may/may not require any additional h/w support depend on the requirement.
You can refer my previous blog on "Web-interface for Embedded Device" [1], it give very detail idea on Ethernet connectivity.
How to begin??
-------------------------------
So, the idea is to develop a user interactive GUI which reside in customer machine like PC, Mobile or Tablet. And using this GUI, client/customer can communicate with the target device which is an embedded system.
What is QT?? What is VB??
-------------------------------------------------------
There are many GUI development tool available. Some of the well known & commonly used tools are QT and Visual Studio. QT is basically used for developing multi-platform applications and GUI that can run on various software and hardware with limited changes. Its a cross-platform application software.Its have very high end usage it supports a huge versatility which includes - Linux, mac/ios, Windows, Embedded - QNX, VXworks and many more. Its full fledge license cost is more then 3500$.
On other hand Visual Studio is also coming up with multi-platform support. Along with its native Window platform, it also facilitate installation on Android, Linux & Mac. It's an IDE which also support GUI development commonly known as "Window form application" or MFC. It support a huge variety of GUI also. And its license cost starts from 30K INR to some lakhs in INR depending on the version. Visual Studio currently doesn't support any GUI development for Embedded Platform [2]. But still its having demand in many application & GUI development.
And how much time needed for development??
---------------------------------------------------------------------------------
In today's date all these applications are so automated and trailing ample amount of resources on Internet using which one can become a quick learner of GUI development. Also user can start with trial version of these GUI in order to check the comfortability. So, bothering about development time is no more a stringent requirement. But, yes in essence developer need to be familiar with the object oriented concept. Because almost all well known GUI uses C++ as underlying concept.
I hope till now the rationale of this blog is very much clear to reader. So, before narrating ahead let me make the topic completely clear. In this blog I will be showing you how I am using Visual Studio "Visual basic C++" for GUI development and using this how I am reading an analog data from embedded device and plotting a graph for user analysis.Its a miniature demo of home automation & its live graphical capture.
End Application - IoT & Microsoft Azure
------------------------------------------------------------------------------------------------------------
Yes, its a part of cloud computing used in day-to-day life. It can be considered as an end solution for IoT, where number of sensors feeding the data to client end. And dynamic plotting of values done at client side for analysis. Similarly Microsoft Azure provide remote solution to client/customer. The same methodology can be plugged in to the Azure for remote uses.
Methodology - What exactly I done here ??
-----------------------------------------------------------------------------------------------------------------
Embedded based system is the server end. And visual basic based application running on client end on a windows platform. Both the server & client remain connected to a local LAN. Off course the same is very very apparent in WLAN, it require some paid uses [3]. So, the client application will ping to server system to send the latest data. On receiving the request the Embedded server end will run its .exe program for extracting the current analog value. [Here, basically an analogy of sensor is made by varying the potentiometer, but in practical there might be any real life sensors like temperature, light, pressure etc.]
So, the current analog data will be collected by a file stream and registered on the file. Once registered, the server side web-service i.e. a node.js based javascript will read and send the content of file to the client side service which is again a javascript for receiving the data from server. Client side web-service will read the data and append it to the repository file from where the Visual basic based application will fetch the data and plot the analysis graph.
On Window Platform end -
Here it contains the Visual c++ based Window form application (WFA) which provide the GUI part. Along with this there is a javascript running on the background which frequently make connection with the server end at an periodic interval of approximately 1.8sec. Fetch the data from server and log the data in appending form to the client file. The GUI which is an Visual basic based application checks continuously if the file is ideal or not. If the GUI find its ideal, then it read the latest value from the file and extrapolate the value on a line graph in X-Y format.
On Embedded Side -
Ideally speaking, it can be any embedded based device which is having capability of running Ethernet stack and capable of doing HTTP based interaction. So, here I had used a Beagle bone Black, a Linux based Embedded System. On this, a javascript which form the server runs and listen for any incoming connection. Once a connection is identified, then the immediate next task is to run the .exe application which is responsible for measuring the analog parameter and log the value on to the file system. Further the server script will read this file and pass the same data to the web-client, who has requested for the service.
You can refer the architectural block diagram shown below for better understanding -
Point of Interest
---------------------------------------
So, I guess with this much description one point strike the mind of most of the user & enthusiast is "how to build a GUI using Visual Basics."
The solution is pretty simple. I recommend viewing the tutorial available on You Tube, visual studio has a rich source of graphical widgets, so its not possible to expect You Tube to cover each & every widget usage in detail. But, yes it covers all basic concept right from installation of visual studio to uses of common widgets for application development. Also the msdn site [4] (i.e. Microsoft Native site) has all detail content right from methods & class related to all widgets provided by visual studio. Also it shows a bunch of code snippet in VB, .net & c++ which helps user to understand application development using Visual Studio. Also once the developer done with the GUI and tested all its functionality, then he can publish the .exe of this application and easily transfer to the customer via any media or online source.
From the technical point - Its a c++ based framework. So, at some point down the line the GUI developer has to link itself to the coding part and need to interact with C++ domain. Still C as a active logic can be used, but beauty will comes from the use of object oriented concept. e.g. In the GUI, if the requirement is to fetch a data from a file on a button press. Then with C++ advance concept like file class or stream class things can be directly used which minimize the developer handling effort. But, same time with generic c concept the developer has to handle in the code. Also as we know C++ has many advantage & some disadvantages. Disadvantage tells about the memory footprint, but it really doesn't matter for GUI end. Since, many time the intended app is developed on a target system which has quite a good memory as compared to the embedded counterpart. So, its really very much practical to develop a complete interactive and user friendly GUI on system like Windows, MACoS, Android & Linux.
Video Description Explanation
-------------------------------------------------------------------------
As mentioned earlier. Here, I had used a Beagle bone which form the web server. Apart from this the extra h/w used are - 2 2.5mm LED's, One 1k Potentiometer, connecting wire and a breadboard.
The Red LED is used for PWM dimming. Based on the potentiometer setting the dimming done. So, it will give clear indication to user that the analog section is varying the value. Also depending on the intensity the viewer can also realize the changes done on potentiometer variation.
The Blue LED is a pulsing LED. Although it appear to pulsate at an interval of 1.8 sec and so. But this period is not fixed. It depends on client side. When connection is established it become ON and when client disconnect it OFF. Since at the client system the process is carried synchronously, hence the Blue LED blink gives a feel of periodic event. i.e. pulsing.
The Potentiometer it use to control an analog voltage of 3.3V and feed output to AIN6 i.e. 6th channel of ADC in Beagle bone. Its a 1K pot which can vary the output from 3mV to 3V. Depending on these value the ADC counts will be calculated. Here, the ADC used is a 12-bit resolution based ADC. Furthur the code is programmed for taking this count and manage a 50% duty cycle PWM and accordingly manage the brightness intensity of Red LED.
Apart from this a console based controlling can be done for beagle bone which will be part of server side. Usually it needed for initiating the server side process only. But additionally the current analog value also thrown on the console window, it may be used for debugging purpose. But having no role in overall application.
Finally coming to the Windows App. On Visual Basics. Its basically has 2 operational button - StartScan & StopScan. Rest all are the non-operational part which is not intended for the use of demo perspective. Apart from this there are - 1 TextBox & 1 Chart. Textbox is for representing data in digital format. And chart will represent data in analog form i.e. line chart. Textbox will only show the starting 25 readings not more then that, as logic for that has not developed for demo version. Also the chart will read a max of 100 readings and then it will roll over from 1st reading. After completion of 100 data, the log will automatically initiate. Large graphical representation is not the intention of this demo. But yes, it can be increased to tens of thousands.
Once, the user hit the startscan button the process of reading start, which also additionally pop-up two window console in order to give better idea about ongoing process [5]. These consoles are solely for developer & debug purpose, hence it can be eliminated from actual application when handover to the customer. On hitting StopScan the running process stops. And the textbox & Chart area get cleaned. Also StopScan will automatically facilitate the logging of current data.
Log as shown in demo is having a specific format which clearly tell the data & time stamp in its name. Easy for user to identify when the log has been taken. The actual application also has facility to upload this log and view the same in graphical form. Also alert the user for any abnormality by sending mail. For user information - Visual studio also supports SMTP using which window application also capable of sending mail to configured user.
Possible Extension
---------------------------------------------
Its basically a concept. Its up to user to decide its possible usage. Since it involves 3 major activities - Connectivity, Current/Previous data fetching & extrapolating, And logging as well. So, it can be part of numerous application. The one for which this application is built is basically for dynamic update & image identification. Rest details led to proprietary act.
References
---------------------------
No comments:
Post a Comment
If you have any Question. Please let me know.