tag:blogger.com,1999:blog-23691839390778131602024-03-05T15:51:58.791-06:00IoT LaboratoryDesign and prototype various IoT devices to make our life more livable.Unknownnoreply@blogger.comBlogger38125tag:blogger.com,1999:blog-2369183939077813160.post-2787573737512620312020-02-11T03:06:00.000-06:002020-02-11T03:06:12.710-06:00CO2 air quality monitor with Telegram notification<h2>
Introduction</h2>
<div>
<br /></div>
<div>
CO2 Air Quality Monitoring System with Telegram notification<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHeFrcYtLBcQN-Ry9Om7gwwtFfkZwcodzze38Gxh8PDUzPG4aekSCWgJqdhd9XKh6r7L6JmlqT7elSQRGZ6AckAWc2JM3UEJ-Z553-e-bFW12ibjSAMarJPwul4PRdv3uwSRvZTKp_IU0/s1600/wemos_MH-Z19B_TELEGRAM_NOTIFY.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="720" data-original-width="960" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHeFrcYtLBcQN-Ry9Om7gwwtFfkZwcodzze38Gxh8PDUzPG4aekSCWgJqdhd9XKh6r7L6JmlqT7elSQRGZ6AckAWc2JM3UEJ-Z553-e-bFW12ibjSAMarJPwul4PRdv3uwSRvZTKp_IU0/s640/wemos_MH-Z19B_TELEGRAM_NOTIFY.PNG" width="640" /></a></div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to receive Telegram notification when CO2 air quality is higher than certain level from Wemos. It uses MH-Z19B sensor to measure CO2 air quality and visualizes the result with Google Chart API. CO2 measurement data is presented in gauge type. We can check current status via web browser using WiFi connection.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous projects,<br />
<br />
- <a href="http://hpclab.blogspot.com/2020/02/co2-air-quality-monitor-with-line_10.html">IoT Laboratory: CO2 air quality monitor with Line notification V2</a><br />
- <a href="http://hpclab.blogspot.com/2020/02/co2-air-quality-monitor-with-line.html">IoT Laboratory: CO2 air quality monitor with Line notification</a><br />
<br />
It replaces Line notification with Telegram notification. A user will be notified by Telegram when the level of CO2 hits a certain level which is specified by the user in the source code. The entire process for sending Telegram notification is like below. Wemos sends HTTP GET request to Telegram server, then, the message will be delivered to our Telegram messenger.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/wemos_communication_process.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="480" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/wemos_communication_process.png?raw=true" width="640" /></a></div>
<br />
For web server, we use <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>library and it is available at github. Additionally, we need to install <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a> to upload web server related files to Wemos. For example, in this project, we use HTML, Javacript, and CSS files under <span style="font-family: "courier new" , "courier" , monospace;">data </span>directory. In other words, we need to upload sketch and web related files separately.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://core.telegram.org/bots">Telegram Bot token and chat id</a><br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-MH-Z19B CO2 sensor : US$17.90 on <a href="https://www.aliexpress.com/item/32672336586.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
MH-Z19B sensor has many pins, but, we only use TX, RX, VCC, and GND pins. Connect TX of MH-Z19B to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create Telegram account and bot<br />
<br />
To be able to receive Telegram notification, we need two things; <span style="font-family: "courier new" , "courier" , monospace;">bot token</span> and <span style="font-family: "courier new" , "courier" , monospace;">chat id</span>. <span style="font-family: "courier new" , "courier" , monospace;">Bot token</span> is generated automatically when we create a new bot. Then, send a request on web browser to Telegram. After that, Telegram sends a response with <span style="font-family: "courier new" , "courier" , monospace;">chat id</span> in it. This process looks a little bit complicated at first, but, I found an easy and useful <a href="https://www.youtube.com/watch?v=qskqdjUZcRY">tutorial</a> on Youtube. It would be extremely helpful if you are not familiar with Telegram.<br />
<br />
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
This step is to upload sketch to Wemos as usual. In the following sketch, following values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">TG_TOKEN </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Token of Telegram bot</span><br />
<span style="font-family: inherit;">- <span style="font-family: "courier new" , "courier" , monospace;">TG_CHAT_ID </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Chat id that the bot will be sending message to</span></span><br />
<span style="font-family: inherit;"><br /></span>
In this example sketch, it send Line notification only when CO2 density hit 1000 or higher. And before sending again it waits 10 minutes. These values can be changed by user.<br />
<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">notifyLevel </span>: CO2 threshold for Line notification<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">notifyInterval </span>: Waiting time (specify in milliseconds)<br />
<span style="font-family: inherit;"></span><br />
<br />
<script src="https://gist.github.com/briankimstudio/26007bcbf897e6768fd0d65f39abf4d9.js"></script>
Step 4. Upload data to Wemos D1 mini<br />
<br />
This step is to upload web server related files (HTML, Javascript, CSS) to Wemos. These files are located in directory named <span style="font-family: "courier new" , "courier" , monospace;">data</span>. Click "ESP8266 Sketch Data Upload" under Tools menu in Arduino IDE to upload these files to Wemos. Once it shows the measurement data, it will refresh every 3 seconds automatically.<br />
<br />
HTML file<br />
<br />
On web interface, the size of gauge is defined in <span style="font-family: "courier new" , "courier" , monospace;">width</span>, <span style="font-family: "courier new" , "courier" , monospace;">height </span>of <span style="font-family: "courier new" , "courier" , monospace;">options </span>variable. Just change these values to customize chart size. And if you want to modify refresh rate, change the value of <span style="font-family: "courier new" , "courier" , monospace;">30000 </span>in <span style="font-family: "courier new" , "courier" , monospace;">setInterval </span>function to other value.<br />
<br />
<script src="https://gist.github.com/briankimstudio/222fdf30fcbf96dd02aeaf16138e9c36.js"></script>
CSS file<br />
<br />
<script src="https://gist.github.com/briankimstudio/0ef15c535db0e49033246f270c1f4e37.js"></script>
<br />
Javascript file<br />
<br />
<div>
<script src="https://gist.github.com/briankimstudio/24bdc14983b50af3e95728c4eebcc287.js"></script>
</div>
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows a welcome message, CO2 threshold, and waiting period. When CO2 is higher than threshold it will send Telegram notification to the user as below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="484" data-original-width="676" height="458" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
In this project, Wemos sends two types of message. The first type is for informing IP address of itself. And the second type is for notification with measured CO2 density.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/notification.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="637" data-original-width="360" height="640" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/notification.png?raw=true" width="360" /></a></div>
<br />
We can use web browser to connect to the device, then it will show current time and visualized information, which is based on Google Chart API. It will refresh itself every 3 seconds automatically.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/web.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="418" data-original-width="800" height="334" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_TELEGRAM_NOTIFY/img/web.png?raw=true" width="640" /></a></div>
<br />
<h2>
<span style="color: red;">Cautious!</span></h2>
<div>
<span style="color: red;"><br /></span></div>
In this project, Wemos uses <span style="font-family: "courier new" , "courier" , monospace;">softwareserial </span>library to communicate with MH-Z19B sensor. However, this library will be interfered by other library which uses timer or interrupt internally. Originally, I plant to use Adafruit Neopixel library in this project to lit some of LED strip, but, it interfered the communication of <span style="font-family: "courier new" , "courier" , monospace;">softwareserial </span>library. So, I decided not to use LED strip for this project. One possible work around would be to ESP32 board which has more than one hardware serial.<br />
<br />
<h2>
References</h2>
<div>
<br /></div>
<div>
- <a href="http://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality_4.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- MH-Z19B Manual PDF: <a href="https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf">mh-z19b-co2-ver1_0.pdf</a><br />
- <a href="https://revspace.nl/MHZ19">MHZ19 - RevSpace</a></div>
<div>
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://developers.google.com/chart/interactive/docs/gallery/gauge">Google Chart : Gauge</a><br />
- <a href="https://core.telegram.org/bots">Telegram Bot token and chat id</a><br />
- <a href="https://www.youtube.com/watch?v=qskqdjUZcRY">How To Create Telegram Bot</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_MH-Z19B_TELEGRAM_NOTIFY">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-39360993055971533942020-02-10T04:37:00.001-06:002020-02-10T04:44:06.455-06:00CO2 air quality monitor with Line notification V2<h2>
Introduction</h2>
<div>
<br /></div>
<div>
This is an updated version of previous project <a href="http://hpclab.blogspot.com/2020/02/co2-air-quality-monitor-with-line.html">IoT Laboratory: CO2 air quality monitor with Line notification</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRI4N-maa7IzBRHwRw7lT7ozmd3zzpyAzHUWyCO_-kQ8l2Qul8x6m-ZFfVZ9Rb5AnuKrDUhAJWEqJQ2JA6E6M096oK5zEnliSnT167NOChYoKDWTsoAMBxPqtsPpqTFtczqUCDM0wam3E/s1600/web.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="615" data-original-width="946" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRI4N-maa7IzBRHwRw7lT7ozmd3zzpyAzHUWyCO_-kQ8l2Qul8x6m-ZFfVZ9Rb5AnuKrDUhAJWEqJQ2JA6E6M096oK5zEnliSnT167NOChYoKDWTsoAMBxPqtsPpqTFtczqUCDM0wam3E/s640/web.png" width="640" /></a></div>
<br />
<h2>
Why?</h2>
<br />
After cold start, it takes about 65 seconds for MH_Z19B to preheat itself. During this period, the reading will be somewhere between 410 and 430, but, it should not be considered as an actual measurement. Once preheating period has finished, it starts showing actual CO2 density. Therefore, it is recommended to read sensor after 65 seconds at least. For your reference, according to the manual, preheating time is 3 minutes.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY_V2/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="539" data-original-width="729" height="472" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY_V2/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
<h2>
What's changed</h2>
<br />
- Display current status: <span style="font-family: "courier new" , "courier" , monospace;">Preheating</span>, <span style="font-family: "courier new" , "courier" , monospace;">Measuring</span><br />
- Add line chart on web interface<br />
<br />
<h2>
Source code</h2>
<br /></div>
<script src="https://gist.github.com/briankimstudio/56dc5c15a73b4dff46c8f1954a25373d.js"></script>
<h2>
References
</h2>
<div>
<br /></div>
<div>
- <a href="http://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality_4.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- MH-Z19B Manual PDF: <a href="https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf">mh-z19b-co2-ver1_0.pdf</a></div>
<div>
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://developers.google.com/chart/interactive/docs/gallery/gauge">Google Chart : Gauge</a><br />
- <a href="https://notify-bot.line.me/en/">LINE Notify</a><br />
- <a href="https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/">Using LINE Notify to send messages to LINE from the command-line - LINE ENGINEERING</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_MH-Z19B_LINE_NOTIFY_V2">Source codes</a> at github
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-51290603996038827372020-02-08T01:43:00.000-06:002020-02-08T01:57:39.545-06:00CO2 air quality monitor with Line notification<h2>
Introduction</h2>
<div>
<br /></div>
<div>
CO2 Air Quality Monitoring System with Line notification<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PS3D-1i2SK2wOXnLNJBHtJtA-auDvqaw8F3hUFitGPfKT_fHJV6p3eXdJl0nU-RMDEzIYsTUuz-uFTpRxrp57zl8UN7OFT9eUHo1hPPICdCkP51152B-LO_tW7grMyGV5s3_lXzvJgk/s1600/wemos_MH-Z19B_LINE_NOTIFY.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="720" data-original-width="960" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PS3D-1i2SK2wOXnLNJBHtJtA-auDvqaw8F3hUFitGPfKT_fHJV6p3eXdJl0nU-RMDEzIYsTUuz-uFTpRxrp57zl8UN7OFT9eUHo1hPPICdCkP51152B-LO_tW7grMyGV5s3_lXzvJgk/s640/wemos_MH-Z19B_LINE_NOTIFY.png" width="640" /></a></div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to receive Line notification when CO2 air quality is higher than certain level from Wemos. It uses MH-Z19B sensor to measure CO2 air quality and visualizes the result with Google Chart API. CO2 measurement data is presented in gauge type. We can check current status via web browser using WiFi connection.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous project named "<a href="http://hpclab.blogspot.com/2020/02/send-line-notification-from-esp8266.html">IoT Laboratory: Send Line notification from ESP8266 when PM2.5 is too high</a>" It replaces air quality sensor with CO2 sensor. A user will be notified by Line when the level of CO2 hits a certain level which is specified by the user in the source code. The entire process for sending Line notification is like below. Wemos sends HTTP POST request to Line Notify website, then, the message will be delivered to our Line messenger.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/wemos_communication_process.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="480" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/wemos_communication_process.png?raw=true" width="640" /></a></div>
<br />
For web server, we use <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>library and it is available at github. Additionally, we need to install <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a> to upload web server related files to Wemos. For example, in this project, we use HTML, CSS files under <span style="font-family: "courier new" , "courier" , monospace;">data </span>directory. In other words, we need to upload sketch and web related files separately.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://notify-bot.line.me/en/">Line account and Token</a><br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-MH-Z19B CO2 sensor : US$17.90 on <a href="https://www.aliexpress.com/item/32672336586.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
MH-Z19B sensor has many pins, but, we only use TX, RX, VCC, and GND pins. Connect TX of MH-Z19B to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create Line account and Token for notification<br />
<br />
To be able to receive Line notification, we need to get a token from Line Notify website and put it in our source sketch. Useful tutorial on how to create a token is available at <a href="https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/">https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/</a>. Take a good look at it to understand basic procedure to create a token.<br />
<br />
First, login to the <a href="https://notify-bot.line.me/en/">LINE Notify</a> website<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify_login.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify_login.png?raw=true" width="640" /></a></div>
<br />
Click "My page"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_mypage.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_mypage.png?raw=true" width="640" /></a></div>
<br />
Click "Generate token"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_generate_token.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_generate_token.png?raw=true" width="640" /></a></div>
<br />
<b><span style="color: red;">Important!</span></b> Then, type any name for the token and choose who will receive Line notification. We can choose a single recipient or group. For testing purpose, let's choose myself here, then it will send notification only to me.<br />
<br />
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
This step is to upload sketch to Wemos as usual. In the following sketch, following values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">LINE_TOKEN </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Token string from Line Notify website</span><br />
<span style="font-family: inherit;"><br /></span>
In this example sketch, it send Line notification only when CO2 density hit 1000 or higher. And before sending again it waits 10 minutes. These values can be changed by user.<br />
<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">notifyLevel </span>: CO2 threshold for Line notification<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">notifyInterval </span>: Waiting time (specify in milliseconds)<br />
<span style="font-family: inherit;"></span><br />
<br />
<script src="https://gist.github.com/briankimstudio/3f17f2e2a5f523663e423f9f29777837.js"></script>
Step 4. Upload data to Wemos D1 mini<br />
<br />
This step is to upload web server related files (HTML, CSS) to Wemos. These files are located in directory named <span style="font-family: "courier new" , "courier" , monospace;">data</span>. Click "ESP8266 Sketch Data Upload" under Tools menu in Arduino IDE to upload these files to Wemos. Once it shows the measurement data, it will refresh every 3 seconds automatically.<br />
<br />
HTML file<br />
<br />
On web interface, the size of gauge is defined in <span style="font-family: "courier new" , "courier" , monospace;">width</span>, <span style="font-family: "courier new" , "courier" , monospace;">height </span>of <span style="font-family: "courier new" , "courier" , monospace;">options </span>variable. Just change these values to customize chart size. And if you want to modify refresh rate, change the value of <span style="font-family: "courier new" , "courier" , monospace;">30000 </span>in <span style="font-family: "courier new" , "courier" , monospace;">setInterval </span>function to other value.<br />
<br />
<script src="https://gist.github.com/briankimstudio/7df293ddb947132fe76dd5905edd62d7.js"></script>
CSS file<br />
<br />
<script src="https://gist.github.com/briankimstudio/82a6ce794d97640c2afe0da36dae3cae.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows a welcome message, CO2 threshold, and waiting period. When CO2 is higher than threshold it will send Line notification to the user as below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="518" data-original-width="729" height="454" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
One Wemos sends notification, Line messenger will show you the content of it as below. Notice that "Air quality" in the message is actually the token name we typed when the token was created.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/line_notification.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="515" data-original-width="353" height="640" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/line_notification.png?raw=true" width="438" /></a></div>
<br />
We can use web browser to connect to the device, then it will show current time and visualized information, which is based on Google Chart API. It will refresh itself every 3 seconds automatically.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/web.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="557" data-original-width="800" height="444" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_MH-Z19B_LINE_NOTIFY/img/web.png?raw=true" width="640" /></a></div>
<br />
<h2>
<span style="color: red;">Cautious!</span></h2>
<div>
<span style="color: red;"><br /></span></div>
In this project, Wemos uses <span style="font-family: "courier new" , "courier" , monospace;">softwareserial </span>library to communicate with MH-Z19B sensor. However, this library will be interfered by other library which uses timer or interrupt internally. Originally, I plant to use Adafruit Neopixel library in this project to lit some of LED strip, but, it interfered the communication of <span style="font-family: "courier new" , "courier" , monospace;">softwareserial </span>library. So, I decided not to use LED strip for this project. One possible work around would be to ESP32 board which has more than one hardware serial.<br />
<br />
<h2>
References</h2>
<div>
<br /></div>
<div>
- <a href="http://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality_4.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- MH-Z19B Manual PDF: <a href="https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf">mh-z19b-co2-ver1_0.pdf</a></div>
<div>
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://developers.google.com/chart/interactive/docs/gallery/gauge">Google Chart : Gauge</a><br />
- <a href="https://notify-bot.line.me/en/">LINE Notify</a><br />
- <a href="https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/">Using LINE Notify to send messages to LINE from the command-line - LINE ENGINEERING</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_MH-Z19B_LINE_NOTIFY">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-88729920690005333992020-02-06T00:58:00.000-06:002020-02-07T00:46:32.017-06:00Control ESP8266 with Google Assistant. OK GOOGLE TURN ON THE LIGHT!<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Voice control ESP8266 with Google Assistant<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUTszSs78B_IiFJhSOxkaIKIdn2HRIR2Hzttrr0gW4K9JkFX2OdxrZAxejwTq5LfhHk64_Mifl316HpewQxyG2oNP1GVL2xYQhQAvVRbthtW-JCjlI3nHP-PeoND4igwq6p9s9AF8QFBo/s1600/wemos_GOOGLE_ASSISTANT_title.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="720" data-original-width="1280" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUTszSs78B_IiFJhSOxkaIKIdn2HRIR2Hzttrr0gW4K9JkFX2OdxrZAxejwTq5LfhHk64_Mifl316HpewQxyG2oNP1GVL2xYQhQAvVRbthtW-JCjlI3nHP-PeoND4igwq6p9s9AF8QFBo/s640/wemos_GOOGLE_ASSISTANT_title.png" width="640" /></a></div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to voice control ESP8266 with Google Assistant. We talk to Google Assistant app. Once Google Assistant hear our voice command, it will communicate with IFTTT. Then, IFTTT forwards command to Adafruit MQTT broker. Finally, ESP8266 receives the command through MQTT subscribe function and executes it.<br />
<br />
<h2>
Features</h2>
<br />
This project requires multiple services to complete the mission. First, it requires Google Assistant app on your phone. Then, we need to create IFTTT account and Adafruit MQTT broker account. In IFTTT, create an applet to link Google Assistant and MQTT broker, so, IFTTT can forward our command from Google Assistant to MQTT broker. Wemos receives a messge from MQTT broker using subscribe function. The whole communication flow looks like this,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/wemos_GOOGLE_ASSISTANT.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="450" data-original-width="800" height="360" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/wemos_GOOGLE_ASSISTANT.png?raw=true" width="640" /></a></div>
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://ifttt.com/">IFTTT</a><br />
- <a href="https://io.adafruit.com/nchu_iot/dashboards">Adafruit MQTT broker</a><br />
- <a href="https://github.com/adafruit/Adafruit_NeoPixel">Adafruit_NeoPixel Library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)</a><br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
- Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
- NeoPixel compatible LED stick: <a href="https://www.adafruit.com/product/1426">https://www.adafruit.com/product/1426</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
Normally, LED stick has VCC, GND, DATA pin. Wiring is very simple, just connect DATA of LED stick to D1 of Wemos.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/led_strip_bb.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/led_strip_bb.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create IFTTT account and Adafruit MQTT account<br />
<br />
After creating Adafruit MQTT account, create a "feed" and dashboard for it just like this. We are going to use this dashboard to test communication between Wemos and MQTT broker later.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/dashboard.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="486" data-original-width="800" height="388" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/dashboard.png?raw=true" width="640" /></a></div>
<br />
Useful tutorial about how to create a "feed" on MQTT broker is available here <a href="https://learn.adafruit.com/adafruit-io-basics-digital-output?view=all">https://learn.adafruit.com/adafruit-io-basics-digital-output?view=all</a><br />
<br />
Then, create two applets on IFTTT, one is for "turning off the light" and the other is for "turning on the light". Useful tutorial is here <a href="https://www.electronicwings.com/nodemcu/control-home-appliances-using-google-assistant">https://www.electronicwings.com/nodemcu/control-home-appliances-using-google-assistant</a><br />
<br />
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
This step is to upload sketch to Wemos as usual. In the following sketch, following values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">AIO_USERNAME </span>: Value of 'IO_USERNAME' of MQTT broker<br />
- <span style="font-family: "courier new" , "courier" , monospace;">AIO_KEY </span>: Value of 'IO_KEY' of the MQTT broker<br />
<br />
<script src="https://gist.github.com/briankimstudio/69385296ba1597989ca1a8fd7ed1befb.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 has restarted, serial monitor shows a welcome message and IP address of Wemos. It displays detail about the command whenever it receives new one. In this example, there are two different commands; on and off.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="518" data-original-width="729" height="454" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
Right after upload sketch, it is recommended to test whether Wemos is working with MQTT broker without problem by clicking onoff switch on MQTT broker dashboard. It would be good news if console message shows the correct command whenever you click the switch on dashboard.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/mqtt_esp8266_test.gif?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="338" data-original-width="600" height="360" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/mqtt_esp8266_test.gif?raw=true" width="640" /></a></div>
<br />
After confirming above step, now it is time to test the system altogether.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/ga_esp8266_test.gif?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="338" data-original-width="600" height="360" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_GOOGLE_ASSISTANT/img/ga_esp8266_test.gif?raw=true" width="640" /></a></div>
<br />
<h2>
References</h2>
<div>
<br /></div>
<div>
- <a href="https://ifttt.com/">IFTTT</a><br />
- <a href="https://io.adafruit.com/nchu_iot/dashboards">Adafruit MQTT broker</a><br />
- <a href="https://github.com/adafruit/Adafruit_NeoPixel">Adafruit_NeoPixel Library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_GOOGLE_ASSISTANT">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-52415966044682678672020-02-05T03:48:00.000-06:002020-02-05T03:48:29.302-06:00homebridge [rpi camera] ffmpeg exited with code 1<h2>
Homebridge, Raspberry Pi camera, HomeKit</h2>
<div>
<br /></div>
<div>
Installing homebridge on Raspberry Pi seems to be easy if we follow tutorials like <a href="https://github.com/nfarina/homebridge">nfarina/homebridge: HomeKit support for the impatient</a> and <a href="https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi">Running Homebridge on a Raspberry Pi · nfarina/homebridge Wiki</a>.</div>
<div>
<br /></div>
<div>
But, once we finish all the processes and setup <span style="font-family: "courier new" , "courier" , monospace;">systemd </span>configuration, then hit this command to run homebridge in background.</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ sudo systemctl start homebridge.service</span></div>
<div>
<br /></div>
</div>
<div>
Then, some of you may encounter error like this,</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxOA9GrOxe8RhicL6kY-xqccqOwbsEyz2uZP-9KOvlKfcTSB-Nx8oKIBqRTx8N-JDa0sx_FBSi24Ga-gZoE9MwChEtpkoblFmkK6CmPXZic4Ym4fOPniwtI0Edd3NV3WEOXSeHJkopZA/s1600/homekit_error.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="778" data-original-width="1600" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxOA9GrOxe8RhicL6kY-xqccqOwbsEyz2uZP-9KOvlKfcTSB-Nx8oKIBqRTx8N-JDa0sx_FBSi24Ga-gZoE9MwChEtpkoblFmkK6CmPXZic4Ym4fOPniwtI0Edd3NV3WEOXSeHJkopZA/s640/homekit_error.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
</div>
<div>
And we use following command to check the status of service.</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ sudo systemctl status home-assistant@homeassistant.service</span></div>
<div>
<br /></div>
<div>
We may see error like this,</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[rpi camera] ffmpeg exited with code 1</span></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqRSnMPowttNXuqNiauOYaZEy0S_dIIW5_9HvpWFrWeDh289ZUQbUVqgCZQh-lfq-P2QqhidPkmWp_YfJmoaMYwEtqOrKtL0ql7mr9uOf4ykXtyy2a49dwItHYA7MskLQHPuFXYH9_Lrk/s1600/ffmpeg_error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="321" data-original-width="1118" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqRSnMPowttNXuqNiauOYaZEy0S_dIIW5_9HvpWFrWeDh289ZUQbUVqgCZQh-lfq-P2QqhidPkmWp_YfJmoaMYwEtqOrKtL0ql7mr9uOf4ykXtyy2a49dwItHYA7MskLQHPuFXYH9_Lrk/s640/ffmpeg_error.png" width="640" /></a></div>
<div>
<br /></div>
<div>
How to fix this error is really simple. If we have followed tutorials mentioned above, then we already created a user <span style="font-family: "courier new" , "courier" , monospace;">homebridge. </span></div>
<div>
<br /></div>
<div>
<span style="font-family: inherit;">Run the following command to add user </span><span style="font-family: "courier new" , "courier" , monospace;">homebridge </span><span style="font-family: inherit;">to the </span><span style="font-family: "courier new" , "courier" , monospace;">video</span><span style="font-family: inherit;"> group.</span></div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">$ sudo usermod -a -G video homebridge</span></div>
<div>
<br /></div>
<div>
then, restart homebridge.</div>
<div>
<br /></div>
<div>
If homebridge failss even earlier, take a look at the location of <span style="font-family: "courier new" , "courier" , monospace;">homebridge </span>binary. In <span style="font-family: "courier new" , "courier" , monospace;">/etc/systemd/system/homebridge.service </span>in tutorial, it says <span style="font-family: "courier new" , "courier" , monospace;">/usr/local/bin/homebridge</span>, but, somehow, it is located in <span style="font-family: "courier new" , "courier" , monospace;">/usr/bin/homebridge</span> in my case. So, I modified it in <span style="font-family: "courier new" , "courier" , monospace;">/etc/systemd/system/homebridge.service</span></div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[Unit]</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Description=Node.js HomeKit Server</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">After=syslog.target network-online.target</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[Service]</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Type=simple</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">User=homebridge</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">EnvironmentFile=/etc/default/homebridge</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"># Adapt this to your specific setup (could be /usr/bin/homebridge)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"># See comments below for more information</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">#ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">ExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTS</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Restart=on-failure</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">RestartSec=10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">KillMode=process</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[Install]</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">WantedBy=multi-user.target</span></div>
</div>
<div>
<br /></div>
<h2>
References</h2>
<div>
<br /></div>
<div>
- <a href="https://github.com/nfarina/homebridge">nfarina/homebridge: HomeKit support for the impatient</a></div>
<div>
- <a href="https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi">Running Homebridge on a Raspberry Pi · nfarina/homebridge Wiki</a>.</div>
<div>
- <a href="https://linux.die.net/man/8/usermod">usermod(8): modify user account - Linux man page</a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-28782254196851501322020-02-04T20:42:00.002-06:002020-02-04T22:08:07.831-06:00Send Line notification from ESP8266 when PM2.5 is too high<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Low-cost (US$19) Air Quality Monitoring System with Line notification<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMno3KIy8UqgR5f6XOa11EOShq6NtBvr2QCT_eoHdrzfVebZUXedFNuZDb84HYyksz2E0votF2JcVQfp_AYJEMTh4YAQWbOZ7QQfPYgbv19qoRzP_GU7iTcj_5fi-oBPCLau1j3gaKO0Y/s1600/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="720" data-original-width="1280" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMno3KIy8UqgR5f6XOa11EOShq6NtBvr2QCT_eoHdrzfVebZUXedFNuZDb84HYyksz2E0votF2JcVQfp_AYJEMTh4YAQWbOZ7QQfPYgbv19qoRzP_GU7iTcj_5fi-oBPCLau1j3gaKO0Y/s640/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY.png" width="640" /></a></div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to receive Line notification when air quality is higher than certain level from Wemos. It uses PMS7003 sensor to measure air quality and visualizes the result with Google Chart API. Air quality measurement data is presented in gauge type. We can check current status via web browser using WiFi connection.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous project named "<a href="http://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality_4.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization</a>." It adds Line notification functionality to notify user when the level of air quality hits a certain level which is specified by the user in the source code. The entire process for sending Line notification is like below. Wemos sends HTTP POST request to Line Notify website, then, the message will be delivered to our Line messenger.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/notification_process.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="344" data-original-width="800" height="274" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/notification_process.png?raw=true" width="640" /></a></div>
<br />
For web server, we use <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>library and it is available at github. Additionally, we need to install <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a> to upload web server related files to Wemos. For example, in this project, we use HTML, CSS files under <span style="font-family: "courier new" , "courier" , monospace;">data </span>directory. In other words, we need to upload sketch and web related files separately.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://notify-bot.line.me/en/">Line account and Token</a><br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-PMS7003 air quality sensor : US$16.80 on <a href="https://www.aliexpress.com/item/32623909733.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
PMS7003 sensor comes with a small breakout board, which has TX, RX, VCC, GND pins. Connect TX of PMS7003 to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create Line account and Token for notification<br />
<br />
To be able to receive Line notification, we need to get a token from Line Notify website and put it in our source sketch. Useful tutorial on how to create a token is available at <a href="https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/">https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/</a>. Take a good look at it to understand basic procedure to create a token.<br />
<br />
First, login to the <a href="https://notify-bot.line.me/en/">LINE Notify</a> website<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify_login.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify_login.png?raw=true" width="640" /></a></div>
<br />
Click "My page"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_mypage.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_mypage.png?raw=true" width="640" /></a></div>
<br />
Click "Generate token"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_generate_token.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="552" data-original-width="800" height="440" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_generate_token.png?raw=true" width="640" /></a></div>
<br />
<b><span style="color: red;">Important!</span></b> Then, type any name for the token and choose who will receive Line notification. We can choose a single recipient or group. For testing purpose, let's choose myself here, then it will send notification only to me.<br />
<br />
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
This step is to upload sketch to Wemos as usual. In the following sketch, following values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">LINE_TOKEN </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Token string from Line Notify website</span><br />
<span style="font-family: inherit;"><br /></span>
In this example sketch, it send Line notification only when PM2.5 hit 20 or higher. And before sending again it waits 10 minutes. These values can be changed by user.<br />
<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">notifyLevel </span>: PM2.5 threshold for Line notification<br />
<span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">interval </span>: Waiting time (specify in milliseconds)<br />
<span style="font-family: inherit;"></span><br />
<br />
<span style="font-family: inherit;"><br /></span>
<script src="https://gist.github.com/briankimstudio/249f5ad131c502f8fab4f770cf789cd8.js"></script>
Step 4. Upload data to Wemos D1 mini<br />
<br />
This step is to upload web server related files (HTML, CSS) to Wemos. These files are located in directory named <span style="font-family: "courier new" , "courier" , monospace;">data</span>. Click "ESP8266 Sketch Data Upload" under Tools menu in Arduino IDE to upload these files to Wemos. Once it shows the measurement data, it will refresh every 3 seconds automatically.<br />
<br />
HTML file<br />
<br />
On web interface, the size of gauge is defined in <span style="font-family: "courier new" , "courier" , monospace;">width</span>, <span style="font-family: "courier new" , "courier" , monospace;">height </span>of <span style="font-family: "courier new" , "courier" , monospace;">options </span>variable. Just change these values to customize chart size. And if you want to modify refresh rate, change the value of <span style="font-family: "courier new" , "courier" , monospace;">30000 </span>in <span style="font-family: "courier new" , "courier" , monospace;">setInterval </span>function to other value.<br />
<br />
<script src="https://gist.github.com/briankimstudio/d8fd512f217662fd89c5cdb46d68f6f6.js"></script>
CSS file<br />
<br />
<script src="https://gist.github.com/briankimstudio/647cbedeb0df52e4860f57731e7a5c68.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows a welcome message, PM2.5 threshold, and waiting period. When PM2.5 is higher than threshold it will send Line notification to the user as below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
One Wemos sends notification, Line messenger will show you the content of it as below. Notice that "Air quality" in the message is actually the token name we typed when the token was created.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify.PNG?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="515" data-original-width="353" height="640" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/line_notify.PNG?raw=true" width="436" /></a></div>
<br />
Use web browser to connect to the device, then it will show current time and visualized information, which is based on Google Chart API. It will refresh itself every 3 seconds automatically.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/output.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="388" data-original-width="800" height="310" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY/img/output.png?raw=true" width="640" /></a></div>
<br />
<h2>
References</h2>
<div>
- <a href="http://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality_4.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- PMS7003 sensor : <a href="http://www.plantower.com/en/content/?110.html">http://www.plantower.com/en/content/?110.html</a></div>
<div>
- <a href="http://download.kamami.pl/p564008-PMS7003%20series%20data%20manua_English_V2.5.pdf">PMS7003 datasheet pdf</a><br />
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://developers.google.com/chart/interactive/docs/gallery/gauge">Google Chart : Gauge</a><br />
- <a href="https://notify-bot.line.me/en/">LINE Notify</a><br />
- <a href="https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/">Using LINE Notify to send messages to LINE from the command-line - LINE ENGINEERING</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_PMS7003_WIFI_WEBSERVER_LINE_NOTIFY">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-68122303389053971222020-02-04T01:19:00.000-06:002020-02-04T04:44:34.906-06:00ESP8266-based WiFi air quality monitoring system using PMS7003 sensor with Google Chart visualization<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Low-cost (US$19) WiFi Air Quality Monitoring System with Google Chart visualization<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUdmFwMGBQ14egI9D5hCAe_Z9vdrbo5La5Gg60thZQbL2m49Ixw3dIaqeDdkcynKyjd_Jpe_xVK7Dlw4Xz8vDm7MK6RhxI3GkEhU_qdo5rL7LuV9u9HI6eFBMVmY32dWWv42_uvXEwmuw/s1600/wemos_PMS7003_WIFI_WEBSERVER.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="778" data-original-width="1600" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUdmFwMGBQ14egI9D5hCAe_Z9vdrbo5La5Gg60thZQbL2m49Ixw3dIaqeDdkcynKyjd_Jpe_xVK7Dlw4Xz8vDm7MK6RhxI3GkEhU_qdo5rL7LuV9u9HI6eFBMVmY32dWWv42_uvXEwmuw/s640/wemos_PMS7003_WIFI_WEBSERVER.jpg" width="640" /></a></div>
<br />
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to use PMS7003 sensor to measure air quality and visualize the result with Google Chart API. Air quality measurement data is presented in gauge type. We can check current status via web browser using WiFi connection.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous project named "<a href="http://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">ESP8266-based air quality monitoring system using PMS7003 sensor</a>". It adds web server functionality to offer web-based user interface, which is based on Google Chart API to visualize measured air quality data. For web server, we use <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>library and it is available at github. Additionally, we need to install <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a> to upload web server related files to Wemos. For example, in this project, we use HTML, CSS files under <span style="font-family: "courier new" , "courier" , monospace;">data </span>directory. In other words, we need to upload sketch and web related files separately.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-PMS7003 air quality sensor : US$16.80 on <a href="https://www.aliexpress.com/item/32623909733.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
PMS7003 sensor comes with a small breakout board, which has TX, RX, VCC, GND pins. Connect TX of PMS7003 to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Upload sketch to Wemos D1 mini<br />
<br />
This step is to upload sketch to Wemos as usual. In the following sketch, two values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
<br />
<script src="https://gist.github.com/briankimstudio/600502cfd6d89532c70490aae3ada46d.js"></script>
Step 3. Upload data to Wemos D1 mini<br />
<br />
This step is to upload web server related files (HTML, CSS) to Wemos. These files are located in directory named <span style="font-family: "courier new" , "courier" , monospace;">data</span>. Click "ESP8266 Sketch Data Upload" under Tools menu in Arduino IDE to upload these files to Wemos. Once it shows the measurement data, it will refresh every 3 seconds automatically.<br />
<br />
HTML file<br />
<br />
The size of gauge is defined in <span style="font-family: "courier new" , "courier" , monospace;">width</span>, <span style="font-family: "courier new" , "courier" , monospace;">height </span>of <span style="font-family: "courier new" , "courier" , monospace;">options </span>variable. Just change these values to customize chart size. And if you want to modify refresh rate, change the value of <span style="font-family: "courier new" , "courier" , monospace;">30000 </span>in <span style="font-family: "courier new" , "courier" , monospace;">setInterval </span>function to other value.<br />
<br />
<script src="https://gist.github.com/briankimstudio/d8fd512f217662fd89c5cdb46d68f6f6.js"></script>
CSS file<br />
<br />
<script src="https://gist.github.com/briankimstudio/917a39e01d58672a14efb604ec1168ac.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows welcome message as below. Remember IP address of Wemos to connect it via web browser.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
<br />
Use web browser to connect to the device, then it will show current time and visualized information, which is based on Google Chart API. It will refresh itself every 3 seconds automatically.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER/img/google_chart.PNG?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="334" data-original-width="800" height="266" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_WEBSERVER/img/google_chart.PNG?raw=true" width="640" /></a></div>
<br />
<br />
<br />
<h2>
References</h2>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- PMS7003 sensor : <a href="http://www.plantower.com/en/content/?110.html">http://www.plantower.com/en/content/?110.html</a></div>
<div>
- <a href="http://download.kamami.pl/p564008-PMS7003%20series%20data%20manua_English_V2.5.pdf">PMS7003 datasheet pdf</a><br />
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://github.com/esp8266/arduino-esp8266fs-plugin">EPS8266 Sketch Data Upload</a><br />
- <a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP </a>Library<br />
- <a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer </a>Library<br />
- <a href="https://developers.google.com/chart/interactive/docs/gallery/gauge">Google Chart : Gauge</a><br />
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_PMS7003_WIFI_WEBSERVER">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-88608070463571642172020-02-03T04:18:00.000-06:002020-02-04T01:22:34.241-06:00ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Low-cost (US$19) MQTT Air Quality Monitoring System<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlpgaXrbzGxILb4qvS_lWadWht2pC7kM6eDBNFvVIZ2b8m0CCY0JIDEf1U0g01F016mwtD5oQGdRtljzWfLmCIMyKho4TH2RmKtwAAaW-r-17GJt8tVvVayh_7HcTXzWOKBxkCX6ehyphenhyphenY0/s1600/wemos_PMS7003_WIFI_MQTT.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1390" data-original-width="1600" height="556" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlpgaXrbzGxILb4qvS_lWadWht2pC7kM6eDBNFvVIZ2b8m0CCY0JIDEf1U0g01F016mwtD5oQGdRtljzWfLmCIMyKho4TH2RmKtwAAaW-r-17GJt8tVvVayh_7HcTXzWOKBxkCX6ehyphenhyphenY0/s640/wemos_PMS7003_WIFI_MQTT.jpg" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to use PMS7003 sensor to measure air quality and publish data to MQTT broker.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous project named "<a href="http://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">ESP8266-based air quality monitoring system using PMS7003 sensor</a>". It adds MQTT functionality to publish measured data to the MQTT broker. Especially, io.adafruit.com offers a free account, which is good enough for prototyping IoT device easily.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
- Adafruit MQTT Library(We can install this from Library Manager in Arduino IDE)<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://io.adafruit.com/">io.adafruit.com </a>free account<br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-PMS7003 air quality sensor : US$16.80 on <a href="https://www.aliexpress.com/item/32623909733.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
PMS7003 sensor comes with a small breakout board, which has TX, RX, VCC, GND pins. Connect TX of PMS7003 to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create io.adafruit.com free account and feeds. Additionally, create a dashboard to show the value of feeds.<br />
<br />
In this project, we will create 3 feeds. Each feed stores value for PM1.0, PM2.5, and PM10.0, respectively. We will use the 'Key' of each feed in our sketch to publish new value to MQTT broker.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit_feed.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="451" data-original-width="800" height="360" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit_feed.png?raw=true" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After creating feeds, click 'AIO Key' menu to find out <span style="font-family: "courier new" , "courier" , monospace;">IO_USERNAME </span>and <span style="font-family: "courier new" , "courier" , monospace;">IO_KEY </span>value, which we will use in our sketch.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
In the following sketch, four values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">AIO_USERNAME </span>: Value of '<span style="font-family: "courier new" , "courier" , monospace;">IO_USERNAME</span><span style="font-family: inherit;">' of MQTT broker</span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;">- </span><span style="font-family: "courier new" , "courier" , monospace;">AIO_KEY </span><span style="font-family: inherit;">: Value of '</span><span style="font-family: "courier new" , "courier" , monospace;">IO_KEY</span><span style="font-family: inherit;">' of the MQTT broker</span></span><br />
<span style="font-family: inherit;"><br /></span>
For WiFi feature, three functions are added to the sketch of our previous project.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">connectWifi()</span> : Connect to WiFi router<br />
- <span style="font-family: "courier new" , "courier" , monospace;">connectMQTT()</span> : Connect to MQTT broker<br />
- <span style="font-family: "courier new" , "courier" , monospace;">publishMQTT()</span> : Publish to MQTT broker<br />
<br />
<script src="https://gist.github.com/briankimstudio/41e6a99d1cec74f44042dfada73b9c07.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows air quality data from PMS7003 every 5 minutes. In the following serial console output, it shows MQTT server is connected and published 3 feeds successfully.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
On MQTT broker website, we can check the data which is sent from device. In the menu, go 'Feeds', then, click the name of feed to see the line graph of published value.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit_feed_graph.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="677" data-original-width="800" height="540" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit_feed_graph.png?raw=true" width="640" /></a></div>
<br />
<br />
Additionally, we can create a dashboard to display all related feeds in a single screen such as following screenshot. In the dashboard, it shows value of PM1.0, PM2.5 and PM10.0 altogether.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="484" data-original-width="800" height="386" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI_MQTT/img/adafruit.png?raw=true" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<h2>
References</h2>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a></div>
<div>
- PMS7003 sensor : <a href="http://www.plantower.com/en/content/?110.html">http://www.plantower.com/en/content/?110.html</a></div>
<div>
- <a href="http://download.kamami.pl/p564008-PMS7003%20series%20data%20manua_English_V2.5.pdf">PMS7003 datasheet pdf</a><br />
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="http://io.adafruit.com/">io.adafruit.com</a><br />
- <a href="https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino">Adafruit MQTT Library example code</a></div>
<div>
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_PMS7003_WIFI_MQTT">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-15705896994936482042020-02-03T02:57:00.001-06:002020-02-04T01:22:38.011-06:00ESP8266-based WiFi air quality monitoring system using PMS7003 sensor<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Low-cost (US$19) WiFi Air Quality Monitoring System<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeN64OnT6CzuoaWtJD7CyS4ACy9SKHs8pdLdVYBmTePTt0_9qXHy6AMEritpeuHfhZqxNhAieHCsm23HiDsooQRsoZrHqC7n-c-WnibWZu6ATsLBe8NX6Ltap7hu6ypxeCGFBtRlvLuUI/s1600/wemos_PMS7003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1390" data-original-width="1600" height="556" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeN64OnT6CzuoaWtJD7CyS4ACy9SKHs8pdLdVYBmTePTt0_9qXHy6AMEritpeuHfhZqxNhAieHCsm23HiDsooQRsoZrHqC7n-c-WnibWZu6ATsLBe8NX6Ltap7hu6ypxeCGFBtRlvLuUI/s640/wemos_PMS7003.jpg" width="640" /></a></div>
<br />
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to use PMS7003 sensor to measure air quality and transmit data to ThingSpeak IoT cloud platform via WiFi.<br />
<br />
<h2>
Features</h2>
<br />
This project is based on our previous project named "<a href="http://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">ESP8266-based air quality monitoring system using PMS7003 sensor</a>". It adds WiFi functionality to send measured data to the IoT cloud. Especially, ThingSpeak offers a free account, which is good enough for prototyping IoT device easily.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
- <a href="https://thingspeak.com/">ThingSpeak </a>free account<br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-PMS7003 air quality sensor : US$16.80 on <a href="https://www.aliexpress.com/item/32623909733.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
PMS7003 sensor comes with a small breakout board, which has TX, RX, VCC, GND pins. Connect TX of PMS7003 to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
Step 2. Create ThingSpeak free account and channel<br />
<br />
In this project, we will create a channel with 3 fields. Each field stores value for PM1.0, PM2.5, and PM10.0, respectively.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/channel-setting.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="549" data-original-width="800" height="438" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/channel-setting.png?raw=true" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After creating a channel, click 'API Keys' menu to find out 'Write API Key' value, which we will use in our sketch.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/api-key.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="688" data-original-width="800" height="550" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/api-key.png?raw=true" width="640" /></a></div>
<br />
Step 3. Upload sketch to Wemos D1 mini<br />
<br />
In the following sketch, three values need to be modified with your own.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_SSID </span><span style="font-family: inherit;">: Name of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">WIFI_PASS </span><span style="font-family: "arial" , "helvetica" , sans-serif;">: </span><span style="font-family: inherit;">Password of WiFi router</span><br />
- <span style="font-family: "courier new" , "courier" , monospace;">TS_KEY </span>: Value of '<span style="font-family: inherit;">Write API Key' of the channel</span><br />
<span style="font-family: inherit;"><br /></span>
For WiFi feature, two functions are added to the sketch of our previous project.<br />
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">connectWifi()</span> : Connect to WiFi router<br />
- <span style="font-family: "courier new" , "courier" , monospace;">uploadCloud()</span> : Upload measured data to ThingSpeak cloud using HTTP GET request<br />
<br />
<br />
<br />
<script src="https://gist.github.com/briankimstudio/2a959e44fe2296783a7852b208b225d2.js"></script>
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows air quality data from PMS7003 every 5 minutes. In the following serial console output, it shows a HTTP GET request and response from ThingSpeak.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/serial_monitor.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/serial_monitor.png?raw=true" width="640" /></a></div>
<br />
On ThingSpeak website, we can check the data which is sent from device. In the menu, go 'Channels/My channels', then, click 'Private' submenu of the channel. By default, it will show you line graph of each individual field. By clicking 'Add Widgets' menu, you can create a gauge widget as well. For example, in the following screenshot, the bottom right gauge is added manually to make it easier to read for users.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/ts-chart.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="531" data-original-width="800" height="424" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003_WIFI/img/ts-chart.png?raw=true" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<h2>
References</h2>
<div>
<br /></div>
<div>
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-air-quality-monitoring.html">IoT Laboratory: ESP8266-based air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- PMS7003 sensor : <a href="http://www.plantower.com/en/content/?110.html">http://www.plantower.com/en/content/?110.html</a></div>
<div>
- <a href="http://download.kamami.pl/p564008-PMS7003%20series%20data%20manua_English_V2.5.pdf">PMS7003 datasheet pdf</a><br />
- <a href="https://www.arduino.cc/en/Reference/WiFiClient">Arduino WiFiClient</a><br />
- <a href="https://www.mathworks.com/help/thingspeak/writedata.html#d117e33160">ThingSpeak HTTP GET request</a><br />
<br /></div>
<div>
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_PMS7003_WIFI">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-25891640584707035032020-02-02T23:54:00.000-06:002020-02-04T01:21:57.070-06:00ESP8266-based air quality monitoring system using PMS7003 sensor<h2>
Introduction</h2>
<div>
<br /></div>
<div>
Low-cost (US$19) Air Quality Monitoring System<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSsUTCHFFzqnHNbBs5Te8nLV6O4WhgjEceiOHZk8oAhQ8REvz-8Q5ziaBQ06KBKvPIIMXegIXgg4mQkdtuY7DsfPWQ948gAgtEgfqGe8NMm9DELWVUwGNPiFeET-crJvnggda4whE1PLE/s1600/wemos_PMS7003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1390" data-original-width="1600" height="556" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSsUTCHFFzqnHNbBs5Te8nLV6O4WhgjEceiOHZk8oAhQ8REvz-8Q5ziaBQ06KBKvPIIMXegIXgg4mQkdtuY7DsfPWQ948gAgtEgfqGe8NMm9DELWVUwGNPiFeET-crJvnggda4whE1PLE/s640/wemos_PMS7003.jpg" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br /></div>
<div>
The aim of this project is to use PMS7003 sensor without 3rd party library. Additionally, it allows <span style="font-family: "courier new" , "courier" , monospace;">delay</span> function in the <span style="font-family: "courier new" , "courier" , monospace;">loop </span>and demonstrates how to communicate with sensor via software serial.<br />
<br />
<h2>
Features</h2>
<br />
- <span style="font-family: "courier new" , "courier" , monospace;">delay </span>function : Some example codes on Internet do not work with <span style="font-family: "courier new" , "courier" , monospace;">delay </span>in <span style="font-family: "courier new" , "courier" , monospace;">loop </span>and generate endless <span style="font-family: "courier new" , "courier" , monospace;">checksum error</span>. That is caused by serial buffer overflow between PMS7003 and Wemos. To avoid the issue, this project incorporates preamble searching mechanism to locate exact data stream in the serial buffer. Therefore, we are able to use various value in <span style="font-family: "courier new" , "courier" , monospace;">delay </span>function without checksum error.<br />
<br /></div>
<div>
<h2>
Prerequisites</h2>
<div>
<br /></div>
- Arduino IDE<br />
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE<br />
<br />
<h2>
Requirements</h2>
<div>
<br /></div>
<b>Hardware</b><br />
-Wemos D1 mini : US$1.77 on <a href="https://www.aliexpress.com/item/32635160765.html?spm=a2g0o.productlist.0.0.6d785f31jkMy2z&algo_pvid=74c6b552-d01e-41a9-8990-8972adba8931&algo_expid=74c6b552-d01e-41a9-8990-8972adba8931-1&btsid=d1cc563e-767a-4772-872b-10101dab836e&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_53">Aliexpress</a><br />
-PMS7003 air quality sensor : US$16.80 on <a href="https://www.aliexpress.com/item/32623909733.html">Aliexpress</a><br />
<br />
<h2>
Instructions</h2>
<div>
<br /></div>
Step 1. Setup hardware<br />
<br />
PMS7003 sensor comes with a small breakout board, which has TX, RX, VCC, GND pins. Connect TX of PMS7003 to D5 of Wemos, RX to D6, VCC to 5V, and GND to G. Finally, connect micro usb to Wemos for uploading firmware, and check serial monitor and serial plotter in Android IDE to make sure the sensor works correctly.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="800" height="230" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/wemos_PMS7003_circuit.png?raw=true" width="640" /></a></div>
<br />
<br />
Step 2. Upload sketch to Wemos D1 mini<br />
<br />
<script src="https://gist.github.com/briankimstudio/516efc547d28895fc408cca74ea2736f.js"></script>
<br />
<br />
<h2>
Results</h2>
<div>
<br /></div>
After uploading firmware, Wemos restarts itself automatically. Once Wemos D1 mini has restarted, serial monitor shows air quality data from PMS7003 every 2 seconds. On the output, each line consists of PM1.0, PM2.5, and PM10 measurement. For example, the last line of the output says PM1.0 is 15 μg/m³, PM2.5 is 20 μg/m³, and PM10.0 is 22 μg/m³.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/briankimstudio/IoT_tutorial/master/wemos_PMS7003/img/serial_monitor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://raw.githubusercontent.com/briankimstudio/IoT_tutorial/master/wemos_PMS7003/img/serial_monitor.png" width="640" /></a></div>
<br />
Using serial plotter of Arduino IDE we can see a graph of these three values in a single plot. In the graph, Green line represents PM1.0, Red line represents PM2.5, and Green line represents PM10.0.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/serial_plotter.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="729" height="474" src="https://github.com/briankimstudio/IoT_tutorial/blob/master/wemos_PMS7003/img/serial_plotter.png?raw=true" width="640" /></a></div>
<br />
<br />
<h2>
References</h2>
<div>
<br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-air-quality.html">IoT Laboratory: ESP8266-based WiFi air quality monitoring system using PMS7003 sensor</a><br />
- <a href="https://hpclab.blogspot.com/2020/02/esp8266-based-wifi-mqtt-air-quality.html">IoT Laboratory: ESP8266-based WiFi MQTT air quality monitoring system using PMS7003 sensor</a></div>
<div>
- PMS7003 sensor : <a href="http://www.plantower.com/en/content/?110.html">http://www.plantower.com/en/content/?110.html</a></div>
<div>
- <a href="http://download.kamami.pl/p564008-PMS7003%20series%20data%20manua_English_V2.5.pdf">PMS7003 datasheet pdf</a></div>
<div>
<br /></div>
<a href="https://github.com/briankimstudio/IoT_tutorial/tree/master/wemos_PMS7003">Source codes</a> at github</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-27604103008984578302015-06-12T22:34:00.001-05:002015-06-16T13:15:29.452-05:00ESP8266 based Wifi weather monitoring system<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbQ0a7cU2RIlDzFWMgr-2uhrQFDsEHI06_wGq7-rHgavP-VLR97TIlhZVJtit56ILlCtq9uy7XqEjYLh-nYl3StEHtMpr25p3zwtmBTb3sy9epAcuO-7V0SGdLK1YJqLH9impx6eA2CRE/s1600/esp8266-1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbQ0a7cU2RIlDzFWMgr-2uhrQFDsEHI06_wGq7-rHgavP-VLR97TIlhZVJtit56ILlCtq9uy7XqEjYLh-nYl3StEHtMpr25p3zwtmBTb3sy9epAcuO-7V0SGdLK1YJqLH9impx6eA2CRE/s640/esp8266-1.JPG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
Introduction</h2>
<div>
<br />
Low-cost Wireless Weather Monitoring System</div>
<div>
<br /></div>
<h2>
Purpose</h2>
<div>
<br />
This system transmits temperature and humidity data to cloud on internet via Wifi and provides web interface to monitor those measured information.<br />
<br />
In this system, ESP8266 reads data from DHT22 sensor, then, send it to data.sparkfun.com cloud system using simple HTTP protocol. For web interface, all charts are implemented with <a href="https://developers.google.com/chart/">Google Chart</a> APIs. </div>
<div>
<br /></div>
<h2>
Prerequisites</h2>
<div>
<br />
- Arduino IDE</div>
<div>
- <a href="https://github.com/esp8266/Arduino">ESP8266 package</a> for Arduino IDE (*Refer to <a href="http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html">http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html</a> for more information)<br />
<br />
Compiling and uploading is done in Arduino IDE with ESP8266 package installed. Therefore, basic knowledge about Arduino IDE is required to proceed following steps. </div>
<div>
<br /></div>
<h2>
Requirements</h2>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
Hardware</h3>
<div>
<br />
-ESP8266 ( Around $3 on ebay )</div>
<div>
-DHT22 ( Around $7 on eBay )</div>
<div>
-Resistor 10k(Pull up)</div>
<div>
<br />
To keep the cost low, ESP8266 is used as not only controller, but also Wifi transmitter. DHT22 sensor can be replaced by any other temperature sensor. Pull up resistor is used for the input pin of ESP8266.</div>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
Software</h3>
<div>
<br />
-data.sparkfun.com</div>
<div>
-Google Chart </div>
<div>
<br />
We used data.sparkfun.com cloud system to store measured data with two reasons. First, it provides free service and even does not require any account. We just need to create a 'free stream', which is basically a storage area. Secondly, it's easy to use. A single HTTP GET request can send measured data to cloud.<br />
<br />
For web interface, Google Chart is used to draw gauge and graph to show historical change of temperature, humidity, and heat index.<br />
<br /></div>
<h2>
Instructions</h2>
<div>
<br /></div>
<div>
<h3>
Setup hardware</h3>
<h4>
</h4>
<h4>
</h4>
<h4>
For uploading</h4>
<br />
Here is a wiring information to upload sketch to ESP8266 using USB to TTL converter. Since my converter is 5v version, I used another power supply to provide 3.3v to ESP8266. GPIO 0 should be pulled down to the ground for uploading.<br />
<b><span style="color: #e06666;"><br /></span></b>
<b><span style="color: #e06666;">BE CAREFUL! ESP8266 works with only 3.3v, not 5v!</span></b><br />
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQBymLQ_IGhp2fi6g6n5m9JXY7Rt11kK2mVgXGfoP0nz_HVo5xdPt_LpgJCYvALaDhe_JcweUipyykdmqXCTl7tzO5off-YL_TPqRNC7Z49Ylwt_56ULMzyU6-ZYQT_uAWEEcJHZJthSo/s1600/usb-to-ttl_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQBymLQ_IGhp2fi6g6n5m9JXY7Rt11kK2mVgXGfoP0nz_HVo5xdPt_LpgJCYvALaDhe_JcweUipyykdmqXCTl7tzO5off-YL_TPqRNC7Z49Ylwt_56ULMzyU6-ZYQT_uAWEEcJHZJthSo/s640/usb-to-ttl_bb.png" width="640" /></a></div>
<br />
<h4>
For running</h4>
<br />
Connect ESP8266 to DHT22 temperature sensor. GPIO 2 pin of ESP8266 is used to read measured data of DHT22.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1srN_HtrnzG3p0EGggJJRAhz3nuQdI7Oim_lY-qRfpm62dyEblESFhVelBDh7xYPkmrBEdj8CmQMYNGGoiJ4WCywcO4uzxU46Z6YkTq0HY09d0oKHRxm_UE1K8pqXJ55sVmL-Ukj7ejQ/s1600/wifi-weather-sensor_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1srN_HtrnzG3p0EGggJJRAhz3nuQdI7Oim_lY-qRfpm62dyEblESFhVelBDh7xYPkmrBEdj8CmQMYNGGoiJ4WCywcO4uzxU46Z6YkTq0HY09d0oKHRxm_UE1K8pqXJ55sVmL-Ukj7ejQ/s640/wifi-weather-sensor_bb.png" width="640" /></a></div>
<br />
<br />
<div>
<h3>
Step 1. Create 'free data stream' at data.sparkfun.com</h3>
<br />
Visit <a href="https://data.sparkfun.com/">https://data.sparkfun.com/</a> and click 'CREATE' menu to create a 'free data stream'. It's like an identifier for your data to read and write. One interesting feature of data.sparkfun.com is that it doesn't require you to create or activate any account. Just create 'free data stream'. Just remember that no more than 100 requests within 15 minutes window are allowed. On average, one request is allowed every 9 seconds. Check <a href="http://phant.io/docs/input/limit/">here</a> for detail.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIkzWN3KK-wBJSVKGn4qygKCbD0yxD-PfR43ZNmq0fvWGVz0-jQA0fauYGLb7IUFNJZ6hahO4GNiGRCx3vHtu0OGTyKtWAzR6WfgJ7BxM6PWF-hfBhMsvpNKClTfcnECrkxWtaMwFIqkI/s1600/data.sparkfun1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIkzWN3KK-wBJSVKGn4qygKCbD0yxD-PfR43ZNmq0fvWGVz0-jQA0fauYGLb7IUFNJZ6hahO4GNiGRCx3vHtu0OGTyKtWAzR6WfgJ7BxM6PWF-hfBhMsvpNKClTfcnECrkxWtaMwFIqkI/s640/data.sparkfun1.png" width="640" /></a></div>
<br />
Among several fields in the creation form, 'Fields' and 'Stream Alias' are important. Fields are actual variable name for data when you send it with HTTP GET request. 'Stream Alias' is a name which can be used in URL to retrieve data from cloud.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk5a9X-65-LqWJplBST90CNrxHLEBvnkF7DKg41Qcj5rsSfNWjitvhyphenhyphent5CZcqzaJg_M3tfXoYEUD_KKSxzETjrgBWLCrMPkGfpk-ksr9b8-wnNV1gh5PUoyW0adHt7MvUa4p7XmUjs7Qg/s1600/data.sparkfun2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk5a9X-65-LqWJplBST90CNrxHLEBvnkF7DKg41Qcj5rsSfNWjitvhyphenhyphent5CZcqzaJg_M3tfXoYEUD_KKSxzETjrgBWLCrMPkGfpk-ksr9b8-wnNV1gh5PUoyW0adHt7MvUa4p7XmUjs7Qg/s640/data.sparkfun2.png" width="640" /></a></div>
<br />
Once you finish creating 'stream', it provides several information such as private key, public key and simple instructions on how to send and retrieve data. Don't loose them, you need them to proceed to the next step.</div>
<div>
<br /></div>
<h3>
Step 2. Upload Sketch</h3>
<br />
For this step, you need those information at hand,<br />
<br />
-SSID & Password of you Access Point<br />
-List of field names you typed in 'Fields' in the creation form in Step 1<br />
-Public Key from Step 1<br />
-Private Key from Step 1</div>
<div>
<br />
In this example, we used 3 fields to send data to cloud,<br />
<br />
-temp: for temperature value measured in DHT22<br />
-hum: for humidity value measured in DHT22<br />
-hidx: for heat index calculated in the sketch<br />
<br />
HTTP GET request for sending data looks like this,<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">data.sparkfun.com/input/YOUR_PUBLIC_KEY?private_key=YOUR_PRIVATE_KEY&temp=82.04&hum=53.10&hidx=83.29</span><br />
<br />
Modify those values in the sketch according to your configuration. Then, compile and upload to ESP8266 using USB to TTL converter. If you face errors on Mac machine, refer to <a href="http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html">http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html</a> for solution.<br />
<br />
Once finish uploading, open 'Serial Monitor' in Arduino IDE, then you will see something like this,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjALerGQwUPsAKrI7OjfZj32dk-cSqY2NC6g4M14fOus7EXwcK9crcS8OD0ony2pvtFXVUvVoxN5T3dvjuyPCcfUurleYgwpfrqmMh-1RlcqUMiAX3eJd20wVcLfXurI2HYF1bQWHN-qvc/s1600/console.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="454" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjALerGQwUPsAKrI7OjfZj32dk-cSqY2NC6g4M14fOus7EXwcK9crcS8OD0ony2pvtFXVUvVoxN5T3dvjuyPCcfUurleYgwpfrqmMh-1RlcqUMiAX3eJd20wVcLfXurI2HYF1bQWHN-qvc/s640/console.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
To verify whether the data has been transmitted and stored in cloud without error, type this URL in web browser.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">https://data.sparkfun.com/streams/YOUR_PUBLIC_KEY</span><br />
<br />
You will see this kind of output if everything has gone well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-DP8J10uNUi5LsRwF1SlHRBqhY3fE5xLrPjdFQoUaMWfWVwMMQfw5O2xFDx5PjcV5BCDzRK4YSRipcDdYWZXW5kINPVhSXtptcY5K-JSrUPP5iSOVPA0NtFro0msluKePmmLGFvvSbZw/s1600/data.sparkfun3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-DP8J10uNUi5LsRwF1SlHRBqhY3fE5xLrPjdFQoUaMWfWVwMMQfw5O2xFDx5PjcV5BCDzRK4YSRipcDdYWZXW5kINPVhSXtptcY5K-JSrUPP5iSOVPA0NtFro0msluKePmmLGFvvSbZw/s640/data.sparkfun3.png" width="640" /></a></div>
<br /></div>
<div>
<script src="https://gist.github.com/briankimstudio/33d32e3fce9577bb0f3e.js"></script>
<br />
<h3>
Step 3. Create HTML file</h3>
</div>
<div>
<br />
For this step, you need this information at hand,<br />
<br />
-Public key from Step 1<br />
<br />
Modify the value of <span style="font-family: Courier New, Courier, monospace;">public_key</span> to your own key in example HTML file for web interface. Basically, it retrieves data in JSON format from cloud, then pass it to Google Chart API for drawing chart. In this example, gauge chart and line chart are used for demonstration.<br />
<br />
<script src="https://gist.github.com/briankimstudio/6c22727ac1a92ea6e2d4.js"></script><br />
<h2>
Results</h2>
<br />
Open HTML file with web browser, then you will see this chart right away. If you would like to access web interface from anywhere in the world, then, just upload this HTML file to your web site. It does not require any additional files or libraries or anything, just one single HTML file. That's it!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkJA31QC5GupopC47IDiMvrz7Q6rc6YcZt3zuF2gwr9IafwasmYKhQt14X_U6rr4JLUykr42w4Blgcub568lgMpQcGOIMspCyYNWy70zi5jgEeqp-tBXgLDDXhW1gdeFQhy6s9EIf-vvQ/s1600/data.sparkfun4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkJA31QC5GupopC47IDiMvrz7Q6rc6YcZt3zuF2gwr9IafwasmYKhQt14X_U6rr4JLUykr42w4Blgcub568lgMpQcGOIMspCyYNWy70zi5jgEeqp-tBXgLDDXhW1gdeFQhy6s9EIf-vvQ/s640/data.sparkfun4.png" width="640" /></a></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWlrEQV1_rDX8Wlf5VdwQu-6Yf4wK2TZoJU3-qTuu6KcYlVeCj6DRX9omII9QJfdMR7vLGzRvanHLKwKxIana615qSgqo0yMcRu9M-4hA-tCDc3JnhlA-5VVIleXLf7TB1VET4pexW1UQ/s1600/esp8266-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWlrEQV1_rDX8Wlf5VdwQu-6Yf4wK2TZoJU3-qTuu6KcYlVeCj6DRX9omII9QJfdMR7vLGzRvanHLKwKxIana615qSgqo0yMcRu9M-4hA-tCDc3JnhlA-5VVIleXLf7TB1VET4pexW1UQ/s640/esp8266-2.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
</h2>
<h2>
</h2>
<h2>
References</h2>
<div>
<br />
<a href="https://data.sparkfun.com/">https://data.sparkfun.com/</a><br />
<a href="http://phant.io/graphing/google/2014/07/07/graphing-data/">http://phant.io/graphing/google/2014/07/07/graphing-data/</a><br />
<a href="http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html">http://hpclab.blogspot.com/2015/06/esp8266-arduino-ide-on-mac-os-x.html</a><br />
<a href="https://developers.google.com/chart/">https://developers.google.com/chart/</a><br />
<br />
<a href="https://github.com/briankimstudio/wifi-weather-sensor">Source</a> at github</div>
Unknownnoreply@blogger.com14tag:blogger.com,1999:blog-2369183939077813160.post-69614606285501317122015-06-09T15:44:00.000-05:002015-06-09T15:54:00.052-05:00ESP8266 Arduino IDE on Mac OS X Yosemite 10.10.3<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJfP8q984darNrZB0c5glrHKTn7AVUffL0PgBcsvFN2tAvFMqqstTJDvlCEGIlBl4c3eM6g7Z3XP5r4AqkD0fcT42_Kcu7luZ8uNE5cSN7-diKVNh-Igh3O-pu9wj6htARHL9BCwYRfYQ/s1600/esp8266-arduino.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="425" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJfP8q984darNrZB0c5glrHKTn7AVUffL0PgBcsvFN2tAvFMqqstTJDvlCEGIlBl4c3eM6g7Z3XP5r4AqkD0fcT42_Kcu7luZ8uNE5cSN7-diKVNh-Igh3O-pu9wj6htARHL9BCwYRfYQ/s640/esp8266-arduino.JPG" width="640" /></a></div>
<h2>
<span style="font-family: Verdana, sans-serif;"><br /></span></h2>
<h2>
<span style="font-family: Verdana, sans-serif;">Introduction</span></h2>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">How to program ESP8266 with Arduino IDE on Mac OS X Yosemite 10.10.3</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<h2>
<span style="font-family: Verdana, sans-serif;">Purpose</span></h2>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">This article provides a walkaround for using Arduino IDE to program ESP8266 on Mac OS X Yosemite 10.10.3.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<h2>
<span style="font-family: Verdana, sans-serif;">Environment</span></h2>
<span style="font-family: Verdana, sans-serif;">To be able to follow this article, make sure your environment is same as below.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">1. OS X Yosemite 10.10.3</span><br />
<span style="font-family: Verdana, sans-serif;">2. Arduino IDE 1.6.4</span><br />
<span style="font-family: Verdana, sans-serif;">3. ESP8266 Package for Arduino IDE 1.6.4-673-g8cd3697 </span><br />
<span style="font-family: Verdana, sans-serif;"> *Refer to <a href="https://github.com/esp8266/Arduino">https://github.com/esp8266/Arduino</a> for more information about this package </span><br />
<br />
<span style="font-family: Verdana, sans-serif;">FYI, I used USB to TTL Serial Cable Adapter Chipset PL2303HX' from ebay. Different chipset may produce different output.</span><br />
<h2>
<span style="font-family: Verdana, sans-serif;">What is problem?</span></h2>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">If you click 'upload' on Arduino IDE, then you most likely end up with these errors and your ESP8266 won't be programmed properly.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Sketch uses 240,292 bytes (45%) of program storage space. Maximum is 524,288 bytes.</span><br />
<span style="font-family: Courier New, Courier, monospace;">Uploading 33216 bytes from /var/folders/94/rt16wrlj14ng3z47m6q85qgr0000gn/T/build5456473246941663239.tmp/wifi-weather-sensor.cpp_00000.bin to flash at 0x00000000</span><br />
<span style="font-family: Courier New, Courier, monospace;">error: failed reading byte</span><br />
<span style="font-family: Courier New, Courier, monospace;">warning: espcomm_send_command: cant receive slip payload data</span><br />
<span style="font-family: Courier New, Courier, monospace;">warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">It means that compilation has been completed successfully, but, there is an error while it is uploading compiled binaries to ESP8266. To fix the problem, we need to identify who is taking care of the 'uploading'? It's a little program, called '</span><span style="font-family: Courier New, Courier, monospace;">esptool</span><span style="font-family: Verdana, sans-serif;">' and full path to it is</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">/Users/$USER/Library/Arduino15/packages/esp8266/tools/esptool/0.4.4/esptool</span><br />
<br />
<h2>
<span style="font-family: Verdana, sans-serif;">Solution</span></h2>
<span style="font-family: Verdana, sans-serif;">Since '</span><span style="font-family: Courier New, Courier, monospace;">esptool</span><span style="font-family: Verdana, sans-serif;">' does not work correctly, we need to use alternative tool to upload binaries to ESP8266. One of the solution is '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">', which is a little python program for uploading and it works fine on Mac.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Follow these steps to install '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">', then, inform Arduino IDE to use '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">' instead of 'esptool' to upload binary to EPS8266.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<h3>
<span style="font-family: Verdana, sans-serif;">Step 1: Close Arduino IDE completely</span></h3>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<h3>
<span style="font-family: Verdana, sans-serif;">Step 2: Install esptool.py</span></h3>
<div>
<span style="font-family: Verdana, sans-serif;">Follow installation instruction at </span><a href="https://github.com/themadinventor/esptool"><span style="font-family: Verdana, sans-serif;">https://github.com/themadinventor/esptool</span></a></div>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">In my case, I just downloaded a single python file '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">', then, installed </span>pySerial<span style="font-family: Verdana, sans-serif;">, which </span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;"> requires to run. Make a note where you installed </span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">. We need full path to it in Step 3.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">All installation is done. Now, we just need to ask Arduino IDE to use '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">' we've just installed instead of '</span><span style="font-family: Courier New, Courier, monospace;">esptool</span><span style="font-family: Verdana, sans-serif;">'</span><br />
<h3>
<span style="font-family: Verdana, sans-serif;">Step 3: Modify platform.txt file</span></h3>
<span style="font-family: Verdana, sans-serif;">By modifying 'platform.txt' file, we can specify '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">' as an uploading tool. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">In my case, I installed '</span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;">' at </span><b style="font-family: 'Courier New', Courier, monospace;">/Users/$USER/tmp/esp8266/esptool/esptool.py"</b><br />
<div>
<b style="font-family: 'Courier New', Courier, monospace;"><br /></b></div>
<span style="font-family: Verdana, sans-serif;">Just open </span><span style="font-family: Courier New, Courier, monospace;">platform.txt</span><span style="font-family: Verdana, sans-serif;"> located at </span><br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">/Users/$USER/Library/Arduino15/packages/esp8266/hardware/esp8266/1.6.4-673-g8cd3697/platform.txt</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">and move to the end of file. </span><span style="font-family: Verdana, sans-serif;">Then you will se this line.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Change it like this way</span><br />
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: 'Apple SD Gothic Neo'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: 'Apple SD Gothic Neo'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span style="font-family: Courier New, Courier, monospace;">#tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin"</span></div>
<span style="font-family: Courier New, Courier, monospace;">tools.esptool.upload.pattern=<b>"/Users/$USER/tmp/esp8266/esptool/esptool.py"</b> --port "{serial.port}" write_flash 0x00000 "{build.path}/{build.project_name}_00000.bin" 0x10000 "{build.path}/{build.project_name}_10000.bin"</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">You can change the full path to </span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;"> to wherever you installed </span><span style="font-family: Courier New, Courier, monospace;">esptool.py</span><span style="font-family: Verdana, sans-serif;"> on your system.</span><br />
<br />
<h3>
<span style="font-family: Verdana, sans-serif;">Step 4: Open Arduino IDE and Load esp8266 example sketch</span></h3>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Set 'Board' to 'Generic ESP8266' and 'Port' to wherever ESP8266 connected to currently. It is '</span><span style="font-family: Courier New, Courier, monospace;">/dev/cu.usbserial/</span><span style="font-family: Verdana, sans-serif;">' in my case.</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Click 'upload' on Arduino IDE, then you will see following message if everything goes well.</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Sketch uses 240,292 bytes (45%) of program storage space. Maximum is 524,288 bytes.</span><br />
<span style="font-family: Courier New, Courier, monospace;">/Users/$USER/tmp/esp8266/esptool/esptool.py --port /dev/cu.usbserial write_flash 0x00000 /var/folders/94/rt16wrlj14ng3z47m6q85qgr0000gn/T/build8386918307655313675.tmp/wifi-weather-sensor.cpp_00000.bin 0x10000 /var/folders/94/rt16wrlj14ng3z47m6q85qgr0000gn/T/build8386918307655313675.tmp/wifi-weather-sensor.cpp_10000.bin </span><br />
<span style="font-family: Courier New, Courier, monospace;">Connecting...</span><br />
<span style="font-family: Courier New, Courier, monospace;">Erasing flash...</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00000000... (3 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00000400... (6 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00000800... (9 %) </span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Writing at 0x00007400... (90 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00007800... (93 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00007c00... (96 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00008000... (100 %)</span><br />
<span style="font-family: Courier New, Courier, monospace;">Erasing flash...</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00010000... (0 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00010400... (0 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00010800... (1 %) </span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Writing at 0x00041c00... (98 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00042000... (99 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00042400... (99 %) </span><br />
<span style="font-family: Courier New, Courier, monospace;">Writing at 0x00042800... (100 %)</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Leaving...</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Now, ESP8266 starts to run with newly installed sketch.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">In the following post, I will describe how I made a wifi weather monitoring system using ESP8266, DHT22 sensor, data.sparktfun.com, and Google Chart APIs.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy4fU1aIBWI3YJvYZe4lZLDkgA_p7hj3gCGAJLsBZ8ymAqfGsTqQSgHfwfX5WABG-H2e36f0S8uspAO6GVCCnBQ9p_Mc3SadKrlYPiO4jKkACWu2H2My95HSaFlLjTdewWvRJXqNB49o0/s1600/esp8266-dht22-wifi-weather-monitoring-system.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy4fU1aIBWI3YJvYZe4lZLDkgA_p7hj3gCGAJLsBZ8ymAqfGsTqQSgHfwfX5WABG-H2e36f0S8uspAO6GVCCnBQ9p_Mc3SadKrlYPiO4jKkACWu2H2My95HSaFlLjTdewWvRJXqNB49o0/s640/esp8266-dht22-wifi-weather-monitoring-system.png" width="640" /></a></div>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Thanks</span><br />
<br />
<h2>
<span style="font-family: Verdana, sans-serif;">References</span></h2>
<div style="margin: 0px;">
<br /></div>
<div style="margin: 0px;">
<a href="https://github.com/themadinventor/esptool"><span style="font-family: Verdana, sans-serif;">https://github.com/themadinventor/esptool</span></a></div>
<div style="margin: 0px;">
<a href="https://github.com/igrr/esptool-ck/issues/9"><span style="font-family: Verdana, sans-serif;">https://github.com/igrr/esptool-ck/issues/9</span></a></div>
<div>
<a href="https://nurdspace.nl/ESP8266"><span style="font-family: Verdana, sans-serif;">https://nurdspace.nl/ESP8266</span></a><br />
<a href="http://www.electrodragon.com/w/ESP8266"><span style="font-family: Verdana, sans-serif;">http://www.electrodragon.com/w/ESP8266</span></a><br />
<a href="http://www.esp8266.com/"><span style="font-family: Verdana, sans-serif;">http://www.esp8266.com/</span></a><br />
<a href="http://bbs.espressif.com/"><span style="font-family: Verdana, sans-serif;">http://bbs.espressif.com/</span></a></div>
Unknownnoreply@blogger.com22tag:blogger.com,1999:blog-2369183939077813160.post-83173538148802383222015-06-01T21:29:00.000-05:002015-06-16T13:49:02.487-05:00Arduino implementation of La Crosse TX6U<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
Introduction</h1>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
Arduino implementation of La Crosse TX6U Remote Temperature Sensor with Arduino Uno, DHT22 temperature humidity sensor, 433Mhz Transmitter.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2RFJNTMMeKOk9_7a8xZD4FE5qFtZTwFTsiRCBZQM_Kx7tbvaIc3swD0jIr5U-LGJtgP_zrouzpDzHjA35cugga-faX_YYtae5FUp7oCpmw8RC7Zix2KMQqD9mYDEMeiv1Mh8Vn3PzGAA/s1600/tx6u-arduino.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2RFJNTMMeKOk9_7a8xZD4FE5qFtZTwFTsiRCBZQM_Kx7tbvaIc3swD0jIr5U-LGJtgP_zrouzpDzHjA35cugga-faX_YYtae5FUp7oCpmw8RC7Zix2KMQqD9mYDEMeiv1Mh8Vn3PzGAA/s640/tx6u-arduino.jpg" width="640" /></a></div>
<br />
<br /></div>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#purpose" id="user-content-purpose" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Purpose</h1>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
Low cost remote temperature sensor comaptible with La Crosse Weather Station</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
Source at <a href="https://github.com/briankimstudio/tx6u-arduino">github</a></div>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.75em; line-height: 1.225; margin-bottom: 16px; margin-top: 1em; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#la-crosse-weather-station-ws-9016u" id="user-content-la-crosse-weather-station-ws-9016u" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>La Crosse Weather Station WS-9016U</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
WS-9016U consists of Indoor Weather Station(WS-9016U) and Remote Temperature Sensor(TX6U)</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
Acording to <a href="http://www.lacrossetechnology.com/9016/manual.pdf" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">WS-9016U</a> & <a href="https://www.lacrossetechnology.com/tx6/manual.pdf" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">TX6U</a> manual,</div>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;">Power up remote sensor first, then, power up base station</li>
<li style="box-sizing: border-box;">Range of 80 feet</li>
</ul>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#ws-9016u-indoor-weather-station" id="user-content-ws-9016u-indoor-weather-station" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>WS-9016U Indoor Weather Station,</h3>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;">can have up to 3 remote sensors</li>
</ul>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#tx6u-remote-temperature-sensor" id="user-content-tx6u-remote-temperature-sensor" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>TX6U Remote Temperature Sensor,</h3>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;">transmits temperature every 1 minute</li>
</ul>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#parts" id="user-content-parts" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Parts</h1>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.75em; line-height: 1.225; margin-bottom: 16px; margin-top: 1em; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#hardware" id="user-content-hardware" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Hardware</h2>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;">Arduino Uno</li>
<li style="box-sizing: border-box;">DHT22 Temperature Humidity Sensor</li>
<li style="box-sizing: border-box;">433Mhz Transmitter</li>
<li style="box-sizing: border-box;">10k resistor(pull up)</li>
<li style="box-sizing: border-box;">Breadboard</li>
</ul>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.75em; line-height: 1.225; margin-bottom: 16px; margin-top: 1em; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#software" id="user-content-software" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Software</h2>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;">Adafruit's <a href="https://learn.adafruit.com/dht?view=all" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">DHT library</a></li>
</ul>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#wiring" id="user-content-wiring" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Wiring</h1>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
<a href="https://github.com/briankimstudio/tx6u-arduino/blob/master/tx6u-arduino.png?raw=true" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img alt="" src="https://github.com/briankimstudio/tx6u-arduino/raw/master/tx6u-arduino.png?raw=true" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#testing" id="user-content-testing" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Testing</h1>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
<a href="https://camo.githubusercontent.com/c89b48c092e5cca3811f0ed13693f45d9597c886/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f2d565a37314b396c6a5169772f56574937614c66663335492f414141414141414143696f2f6f72596336475066576e302f773834342d68313335382d6e6f2f4c323641323435352e4a5047" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img data-canonical-src="https://lh3.googleusercontent.com/-VZ71K9ljQiw/VWI7aLff35I/AAAAAAAACio/orYc6GPfWn0/w844-h1358-no/L26A2455.JPG" height="500" src="https://camo.githubusercontent.com/c89b48c092e5cca3811f0ed13693f45d9597c886/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f2d565a37314b396c6a5169772f56574937614c66663335492f414141414141414143696f2f6f72596336475066576e302f773834342d68313335382d6e6f2f4c323641323435352e4a5047" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#license-and-credits" id="user-content-license-and-credits" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>License and Credits</h1>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
tx6u-arduino is based on Adafruit's <a href="https://learn.adafruit.com/dht?view=all" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">DHT library</a> and jremington's <a href="http://forum.arduino.cc/index.php?topic=303888.0" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">TX6U_send.ino</a> source code.</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; widows: 1;">
tx6u-arduino is distributed under GPL License.</div>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative; widows: 1;">
<a aria-hidden="true" class="anchor" href="https://github.com/briankimstudio/tx6u-arduino#reference" id="user-content-reference" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Reference</h1>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 0px !important; margin-top: 0px; padding: 0px 0px 0px 2em; widows: 1;">
<li style="box-sizing: border-box;"><a href="http://forum.arduino.cc/index.php?topic=303888.0" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">http://forum.arduino.cc/index.php?topic=303888.0</a></li>
<li style="box-sizing: border-box;"><a href="https://learn.adafruit.com/dht?view=all" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">https://learn.adafruit.com/dht?view=all</a></li>
<li style="box-sizing: border-box;"><a href="http://shop.ninjablocks.com/blogs/how-to/7501042-adding-rf-433mhz" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">http://shop.ninjablocks.com/blogs/how-to/7501042-adding-rf-433mhz</a></li>
</ul>
<div>
<a href="https://github.com/briankimstudio/tx6u-arduino">Source</a> at github</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-27417752989473329612012-07-20T16:03:00.000-05:002012-07-20T16:08:52.583-05:00Is GPU good for large vector addition?<div><p><b>Introduction</b></p><p> With more than one GPU programming interfaces available, there is a great interest in converting regular program to GPU program with two frequently asked questions. </p><ol><li>How much performance improvement can we expect from it?</li><li>Which programming interface is better than others? </li></ol></div><div><p>In this post, the performance of CPU and GPU are compared for vector addition and matrix multiplication, which are widely used building blocks for scientific application.</p><p>Additionally, the performance of OpenCL, CUDA, and PGI Accelerator on NVIDIA's M2050GPU are analyzed to compare different GPU programming interfaces.</p></div><div><b>1. Is GPU faster than CPU? </b><p>No - for vector addition</p><p>Yes - for matrix multiplication</p><p> Figure 1 shows 'elapsed time' for vector addition on CPU and GPU. CPU is about 4 times faster than GPU in this experiment.<br /></p><p><br /></p><table style="margin-right: auto; margin-left: auto; text-align: center;" class="tr-caption-container" align="center" cellpadding="0" cellspacing="0"><tbody><tr><td style="text-align: center;"><a style="margin-left: auto; margin-right: auto;" href="http://farm7.static.flickr.com/6187/6153413288_3c62b7985d.jpg"><img src="http://farm7.static.flickr.com/6187/6153413288_3c62b7985d.jpg" style="" border="0" height="400" width="400" /> </a></td><td style="text-align: center;"><br /></td></tr><tr><td style="text-align: center;" class="tr-caption">Figure 1. CPU is faster than GPU for vector addition</td><td style="text-align: center;" class="tr-caption"><br /></td><td style="text-align: center;" class="tr-caption"><br /></td></tr></tbody></table><table style="margin-right: auto; margin-left: auto; text-align: center;" class="tr-caption-container" align="center" cellpadding="0" cellspacing="0"><tbody><tr><td style="text-align: center;"><a style="margin-left: auto; margin-right: auto;" href="http://farm7.static.flickr.com/6181/6153413328_b60dc54faa.jpg"><img src="http://farm7.static.flickr.com/6181/6153413328_b60dc54faa.jpg" style="" border="0" height="400" width="400" /></a></td></tr><tr><td style="text-align: center;" class="tr-caption">Figure 2. Elapsed time per function on GPU<br /></td></tr></tbody></table><p>Large vectors need to be copied from CPU memory to GPU memory through relatively slow PCIe bus and it overshadows the higher computational capability of GPU. Figure 2 tells us that most of time on GPU are used to copy data.<br /></p><p> However, for matrix multiplication, GPU is 200 times or more faster than CPU. Computing intensive calculation such as matrix multiplication is best candidate for GPU.<br /></p></div><div><table style="margin-right: auto; margin-left: auto; text-align: center;" class="tr-caption-container" align="center" cellpadding="0" cellspacing="0"><tbody><tr><td style="text-align: center;"><a style="margin-left: auto; margin-right: auto;" href="http://farm7.static.flickr.com/6175/6152869235_a1c7086b8a.jpg"><img src="http://farm7.static.flickr.com/6175/6152869235_a1c7086b8a.jpg" style="" border="0" height="400" width="400" /></a></td></tr><tr><td style="text-align: center;" class="tr-caption">Figure 3. GPU is extremely faster than CPU for matrix multiplication<br /></td></tr></tbody></table><p>Most of times are consumed for computations and data transfer time is almost negligible for matrix multiplication on GPU.<br /></p><p> </p><table style="margin-right: auto; margin-left: auto; text-align: center;" class="tr-caption-container" align="center" cellpadding="0" cellspacing="0"><tbody><tr><td style="text-align: center;"><a style="margin-left: auto; margin-right: auto;" href="http://farm7.static.flickr.com/6173/6152869221_8cd65a3fb9.jpg"><img src="http://farm7.static.flickr.com/6173/6152869221_8cd65a3fb9.jpg" style="" border="0" height="400" width="400" /></a></td></tr><tr><td style="text-align: center;" class="tr-caption">Figure 4. Elapsed time per function on GPU</td></tr></tbody></table><p> </p><p><b>2. Is OpenCL better than CUDA?</b></p><p>Yes for compatibility</p><p>??? for performance</p><p>CUDA is about 5% faster than OpenCL for matrix multiplication in this experiment on NVIDIA M2050 platform.<br /></p><p> </p><p style="text-align: center; clear: both;" class="separator"><a style="margin-left: 1em; margin-right: 1em;" href="http://farm7.static.flickr.com/6206/6152869199_703dfd438b.jpg"><img src="http://farm7.static.flickr.com/6206/6152869199_703dfd438b.jpg" style="" border="0" height="400" width="400" /></a></p><p><b>Conclusion</b><br /></p><p>To be able to get maximum performance out of NVIDIA GPU, try to take advantage of CUBLAS as much as possible. If there is any chance that your program need to be running on different GPU platform such as AMD or INTEL, etc, then use OpenCL for compatibility.</p><p>If you are interested in full article about this experiment, check <a href="https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B-crIDDaxB7_MjVlYTE2ODItNWRmMi00ZmMzLTk3MGQtMjBhNmRjNmZmMmY3&hl=en">here</a>.</p><p><br /></p><p><br /></p><p><br /></p></div><div><p><br /></p></div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2369183939077813160.post-66013467821591800492012-05-17T15:43:00.000-05:002012-05-21T10:30:57.248-05:00Remote Visualization using TurboVNC and VirtualGL on Cluster<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span id="internal-source-marker_0.22039417317137122"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b>1. Purpose</b></span></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Remote visualization is a technique to overcome two major difficulties of "local visualization." First, visualization process requires a high performance GPU device, but, not every local system has such device. Secondly, even if local system has a high performance GPU device installed, it might take unreasonably long time to transfer huge data from remote system(cluster) to local system for visualization. Those two difficulties can be resolved efficiently by using GPU device on cluster for rendering and displaying it remotely on the display of local system.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">You will see these errors if you don't have appropriate GPU device on your local system.</span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHlSMQfTDcolwofT-fctz7fn3el4QFCI9RgGYKJAmJtcBG263iBk-4V5VclENDKBkQgsADtjZETg-zzv8UcvCDO9oT82_mERE-qvzW9B_WqDFCHur1D4kpi6EYQ4GyUMIfBZkh5uy5PCc/s1600/abaqus-local.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHlSMQfTDcolwofT-fctz7fn3el4QFCI9RgGYKJAmJtcBG263iBk-4V5VclENDKBkQgsADtjZETg-zzv8UcvCDO9oT82_mERE-qvzW9B_WqDFCHur1D4kpi6EYQ4GyUMIfBZkh5uy5PCc/s1600/abaqus-local.jpg" /></a></div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpYqycvSuomHpT_9JpdO4Bu5UM6A4aoZEqR3fnNeV-PWpn5zKXFPyPr9MZalSG_iC-LOkOU8RLhREUyvrGvmLHapYKOPkVBtAin_XxOP53DwPC056bdkdIoHjK0HdOuqbL5M1EvQTJOzs/s1600/paraview-local.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpYqycvSuomHpT_9JpdO4Bu5UM6A4aoZEqR3fnNeV-PWpn5zKXFPyPr9MZalSG_iC-LOkOU8RLhREUyvrGvmLHapYKOPkVBtAin_XxOP53DwPC056bdkdIoHjK0HdOuqbL5M1EvQTJOzs/s1600/paraview-local.jpg" /></a></div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">With remote visualization, you will see those instead. Ta-da!</span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilh1-sIVMnS8rHlF7q__MlnpFT82r26CzvtApxo7q3hsTUAm0pXZb9WEaS71bIgrM1dOAxfvnZmLv_n_Ya0Df-qlJdGyy-CTcOARgbKaYWoWhKK9TaE1tJIfP7dspbnf50PUzIhXm3k8g/s1600/paraview-remote.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="532" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilh1-sIVMnS8rHlF7q__MlnpFT82r26CzvtApxo7q3hsTUAm0pXZb9WEaS71bIgrM1dOAxfvnZmLv_n_Ya0Df-qlJdGyy-CTcOARgbKaYWoWhKK9TaE1tJIfP7dspbnf50PUzIhXm3k8g/s640/paraview-remote.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7rdBmO48hiWqaBvU_3XCE6bLuauP1bYJOgKVujGTYyUDCoZ5Gc5c-ywVfC7t_gekvXlwiNxbHxA1tjjilMx5so8kA3BWgnsBc9QyD8wVVnWxrslYeTs-MO8cY-emr6b-gOZcgpVItSlQ/s1600/abaqus-remote.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="534" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7rdBmO48hiWqaBvU_3XCE6bLuauP1bYJOgKVujGTYyUDCoZ5Gc5c-ywVfC7t_gekvXlwiNxbHxA1tjjilMx5so8kA3BWgnsBc9QyD8wVVnWxrslYeTs-MO8cY-emr6b-gOZcgpVItSlQ/s640/abaqus-remote.jpg" width="640" /></a></div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><br /></b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b>2. Requirements</b></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">These are software and hardware requirements for remote visualization on EOS cluster.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Software requirements : CentOS, TurboVNC, VirtualGL</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Hardware requirements : NVIDIA GPU</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b><br /></b></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>3. Installation</b></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b><br /></b></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">3.1 Install X Window package on GPU node</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Even though GPU node has no monitor attached, it still must have X Window package installed and running to provide virtual screen where GPU can draw objects on. These objects eventually will be displayed on physical monitor of local system through SSH tunnel.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$yum groupinstall "X Window System"</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">3.2 Install TurboVNC on GPU node</span><br />
<a href="http://www.virtualgl.org/Downloads/TurboVNC" style="font-weight: bold;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">http://www.virtualgl.org/Downloads/TurboVNC</span></a><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">TurboVNC is a software that display a screen of remote system on monitor of local system via RFB(remote framebuffer) protocol.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">3.3 Install VirtualGL on GPU node</span><br />
<a href="http://www.virtualgl.org/" style="font-weight: bold;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">http://www.virtualgl.org/</span></a><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">VirtualGL is a key software that actually utilize GPU on remote system and redirect drawing event to use hardware rendering feature.</span><br />
<span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">3.4 Install TurboVNC on local system</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">During installation, select just vncviewer. vncserver is not necessary for local system.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>4. Configuration</b></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Since GPU node on EOS has no physical monitor attached to it, ‘--use-display-device=none’ option need to be used to configure X Window</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$nvidia-xconfig -a --virtual=1024x768 --use-display-device=none</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$/usr/bin/X :0 -ac -audit 0 -tst -auth /var/gdm/:0.Xauth -nolisten tcp vt7&</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$cat ~/.vnc/xstartup</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">#!/bin/sh</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"># Uncomment the following two lines for normal desktop:</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"># unset SESSION_MANAGER</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"># exec /etc/X11/xinit/xinitrc</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">xsetroot -solid grey</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">vncconfig -iconic &</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">twm &</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b><br /></b></span><br />
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>User Guide</b></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">For remote visualization, user is required to go through 3 steps. First, start vncserver on GPU node, secondly, establish SSH tunnel between local system and GPU node via login node. Finally, start vncviewer on local machine to open remote display.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Terminal 1</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Connect to login node(eos3)</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Connect to GPU node(node349,node361,node350,node362)</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Start vncserver</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$vncserver </span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Terminal 2</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Create SSH Tunnel</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$ssh -L 10000:node349:5901 eos3.tamu.edu</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Terminal 3</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$vncviewer -medqual localhost:10000</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$module load paraview</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$vglrun glxspheres64</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$vglrun paraview </span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Multiple GPUs</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">$vglrun -d :0.x paraview % x is set to 0 for first GPU, 1 for second GPU, and so on.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Special for ABAQUS CAE</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">On some system, abacus cae has an issue with color scheme. In that case, set environment variable to fix it.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">export XLIB_SKIP_ARGB_VISUALS=1</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">The reason of this issue is incompatibility between abaqus’s graphic toolkit(</span><a href="http://www.fox-toolkit.org/" style="font-weight: bold;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">http://www.fox-toolkit.org/</span></a><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">) and Compiz software package.</span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-9988036718664970602012-02-08T11:38:00.000-06:002012-02-08T15:34:47.371-06:00Setting up email server on CentOS 6.2 within 5 minutesIf you have only 5 minutes, you can still setup an email server on CentOS 6.2. Don't waste it :)<br />
<br />
This email server supports SMTP(TCP port 25) and IMAPS(secure IMAP,TCP port 993). Now, you can specify this as an outgoing and incoming email server on email client such as Thunderbird on your PC.<br />
<br />
1. Install packages<br />
<br />
Three packages are required for this. Install them if you haven't done yet.<br />
<span style="font-family: 'Courier New', Courier, monospace;">$yum install sendmail</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">$yum install sendmail-cf</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">$yum install dovecot</span><br />
<br />
The role of <span style="font-family: 'Courier New', Courier, monospace;">sendmail</span> is to receive emails destined to you and keep them in your mailbox on email server. Then, <span style="font-family: 'Courier New', Courier, monospace;">dovecot</span> actually delivers those emails to your PC when you open Thunderbird or Microsoft Outlook. For outgoing email, Thunderbird first contacts <span style="font-family: 'Courier New', Courier, monospace;">sendmail</span>, then <span style="font-family: 'Courier New', Courier, monospace;">sendmail</span> relays the email to final destination for you.<br />
<br />
2. Configure <span style="font-family: 'Courier New', Courier, monospace;">sendmail</span><br />
<br />
You just need to change 2 lines in configuration file<span style="font-family: 'Courier New', Courier, monospace;"> /etc/mail/sendmail.mc</span><br />
<br />
Comment out this to allow receiving email from anywhere.<br />
<span style="font-family: 'Courier New', Courier, monospace;">dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl</span><br />
<br />
<br />
Add this line<br />
<span style="font-family: 'Courier New', Courier, monospace;">FEATURE(`relay_hosts_only')dnl</span><br />
<div>
<div>
<br /></div>
<div>
Add your PC's full hostname in this file. Create one if this file doesn't exist.</div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">/etc/mail/relay-domains</span></div>
</div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
After changing configuration file, run this command to activate it.</div>
<br />
<span style="font-family: 'Courier New', Courier, monospace;">$/etc/mail/make</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">$service sendmail start</span><br />
<br />
3. Configure dovecot<br />
<br />
You just need to edit two files.<br />
<br />
In<span style="font-family: 'Courier New', Courier, monospace;"> /etc/dovecot/dovtcot.conf</span>, just edit these two lines<br />
<span style="font-family: 'Courier New', Courier, monospace;">protocols = imap</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">listen = *, ::</span><br />
<br />
In<span style="font-family: 'Courier New', Courier, monospace;"> /etc/dovtcot/dovecot.d/10-mail.conf</span>, edit these 3 lines<br />
<br />
<div>
<span style="font-family: 'Courier New', Courier, monospace;">mail_location = mbox:~/mail:INBOX=/var/mail/%u</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">mail_privileged_group = mail</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">mbox_write_locks = dotlock fcntl</span></div>
<div>
<br />
Start dovecot service<br />
<span style="font-family: 'Courier New', Courier, monospace;">$service dovecot start</span><br />
<br /></div>
<div>
4. (Optional) Reconfigure iptables only if you are already using iptables</div>
<div>
Add these 2 lines into <span style="font-family: 'Courier New', Courier, monospace;">/etc/sysconfig/iptables </span>to allow email to go through firewalls.</div>
<br />
<span style="font-family: 'Courier New', Courier, monospace;">-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">-A INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT</span><br />
<br />
then, restart <span style="font-family: inherit;">iptables</span> by<br />
<span style="font-family: 'Courier New', Courier, monospace;">$service iptables restart</span><br />
<br />
<div>
DONE</div>
<div>
<br /></div>
<div>
This is it. Of course, you can do more to enhance the security level of your email server. For example, you can make sendmail more secure by using SMTP over SSL. Feel free to suggest any idea about this article. Thanks.</div>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-2369183939077813160.post-81597923019147094122012-01-30T17:45:00.000-06:002012-01-31T09:25:52.228-06:002012 Spring Short Course, Introduction to Unix/Linux<div style="text-align: left;">
<span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 1.3em;">Date : Jan. 30(Monday) ~ Dec. 2(Thursday).</span></div>
<div class="post-body entry-content" id="post-body-6300796825339315409" style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">
Time : 3PM ~ 5PM<br />
Location : Teague Rm# 103<br />
<br />
It is highly recommended for all attendee to get your EOS login ID ready before the first day of class. EOS login ID is required for hands-on lab.<br />
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Introduction to Linux is a short course specifically designed for beginner to Linux/Unix system. It will cover basic concept of Linux and frequently used commands.<br />
<br />
Basic<br />
<ul>
<li>What is Linux/Unix?</li>
<li>File and Directory</li>
<li>Edit text file</li>
<li>Setup environment</li>
<li>Remote access</li>
</ul>
Advanced<br />
<ul>
<li>Process,Signal</li>
<li>I/O redirection,Pipe</li>
<li>Alias</li>
<li>Permission</li>
<li>Kernel & Shell</li>
</ul>
</div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
For detail,<br />
<br />
<a href="https://sites.google.com/site/tamulinux/introduction-to-linux" style="color: #336699;">https://sites.google.com/site/tamulinux/introduction-to-linux</a><br />
<br />
Please, post a comment or feedback about this class. It would be helpful to improve the class.</div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Thanks you.</div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Brian Kim</div>
<div style="line-height: 1.3em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
</div>Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-2369183939077813160.post-22550893983940832502011-10-26T15:51:00.000-05:002011-10-26T15:51:39.041-05:00Performance Analysis of NAMD on NVIDIA GPU<div class="separator" style="clear: both; text-align: -webkit-auto;">
</div>
<b>Abstract</b><br /><br />As GPU become readily available resources in high performance computing environment, more and more applications are being considered to be a target application for taking advantage of highly parallel computing capability of GPU. To evaluate the performance improvement in application level, molecular dynamics applications, NAMD, is experimented in this article and its performance has been analyzed in three different perspectives: Scalability, speedup, and GPU utilization.<br /><br /><b>1. Experimental environment</b><br /><br />GPU nodes are relatively new addition to the existing EOS system at Texas A&M University. Table 1 shows detail of the node tested in this experiment. It has two six core 2.8Ghz Intel Xeon X5660 processors based on Westmere architecture and 24GB DDR3 DRAM with 1,333Ghz clock cycle. Additionally, it is equipped with two NVIDIA M2050 GPU devices. Each M2050 GPU device runs at 1.15Ghz and 2687MB GDDR5 memory with 1.546Ghz clock cycle. M2050 is a high performance grade device with 14 streaming multiprocessors and each of them has 32 cores which is based on Fermi architecture. It also has ECC memory error protection, and L1 and L2 cache to provide not only accuracy but also high performance on computation. The node is running 64-bits Red Hat Enterprise Linux Server release 5.4.<br /> <br />NAMD has been tested on three configurations. First, it is executed with CPU only configuration. Secondly, it is executed with 1 NVIDIA M2070 GPU. Finally, it is executed with 2 NVIDIA M2050 GPUs. Since these tests are submitted through batch system and there is no guarantee that each test ran exclusively on compute node and compute node could be shared by several other jobs as well. Therefore, the performance presented in this article could be different from exclusive testing environment.<div style="font-family: 'Times New Roman', serif; text-align: center;">
<span style="color: black;"><b><i><br /></i></b></span></div>
<table cellpadding="0" cellspacing="0" style="font-family: 'Times New Roman', serif; page-break-after: avoid; text-align: center; width: 336px;">
<colgroup><col width="125"></col>
<col width="70"></col>
<col width="70"></col>
<col width="69"></col>
</colgroup><tbody>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding: 0in;" width="70">
<div style="margin-bottom: 0in; text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">NVIDIA</span></i></b></div>
<div style="text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">M2050</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding: 0in;" width="70">
<div style="margin-bottom: 0in; text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">NVIDIA</span></i></b></div>
<div style="text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">M2070</span></i></b></div>
</td>
<td style="border: 1px solid #000000; padding: 0in;" width="69">
<div style="margin-bottom: 0in; text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">INTEL</span></i></b></div>
<div style="text-align: center; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">X5660</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">Clock
speed(GHz)</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">1.15</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">1.15</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">2.8</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">Memory(GB)</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">2.687</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">5.375</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">24.081</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">Memory
Clock(GHz)</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">1.546</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">1.566</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">1.333</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;"># of CUDA
cores</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">448</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">448</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">N/A</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">CUDA Driver
ver.</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">4.0</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">4.0</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">N/A</span></i></b></div>
</td>
</tr>
<tr valign="TOP">
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="125">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">CUDA CC ver.</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">2.0</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding: 0in;" width="70">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">2.0</span></i></b></div>
</td>
<td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding: 0in;" width="69">
<div style="text-align: right; text-indent: 0in;">
<b><i><span class="Apple-style-span" style="font-size: x-small;">N/A</span></i></b></div>
</td>
</tr>
</tbody></table>
Table 1: Specification of experimental environment<br /> <br />To benchmark NAMD, apoa1 dataset is used in experiment. This dataset contains 92,000 atoms and simulates 500 steps. Among several parameters in input file, outputEnergies set to 100 as suggested in user manual to remove unnecessary CPU involvement for generating additional output in file.<br /> <br /><b>2.Results </b><br /><br />In this section, performance of NAMD has been analyzed in three aspects: Scalability, speedup, and GPU utilization. <br /><br /><div>
<b>A.Scalability </b><br /><br />The ratio of CPU cores and GPU is 12:1 on single GPU node and 12:2 on multi GPU node. Each process of NAMD occupy one CPU core and 1 GPU. However, GPU can be shared by multiple process. Therefore, it is possible that GPU can be oversubscribed by too many processes and become bottleneck in certain configuration. <br /><div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBzeqd328SI9FMl8KdXqzW_cIJeaZV1HUjxmTk4aIOuTPKFpCcMoeu6V7N8lDCM57wN8rym1ZyDt6qNxjzeU6RLHyrKtnuAx4JVa0Woux-hjDThbI6LP91xxlH2G5vYqStwbRnDmrsmh4/s1600/e.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBzeqd328SI9FMl8KdXqzW_cIJeaZV1HUjxmTk4aIOuTPKFpCcMoeu6V7N8lDCM57wN8rym1ZyDt6qNxjzeU6RLHyrKtnuAx4JVa0Woux-hjDThbI6LP91xxlH2G5vYqStwbRnDmrsmh4/s320/e.png" width="320" /></a></div>
<div style="text-align: center;">
<span class="Apple-style-span" style="font-size: 13px;">Figure 1</span></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
Since each process on NAMD maps to single CPU cores, number of cores means same as number of process in graph. CPU version of NAMD scales well up to 12 cores on Westmere node in Figure 1. However, GPU version of NAMD shows best performance around 4-6 cores. On 1 GPU nodes, all processes invoke kernel on same GPU concurrently, so it breaks scalability when there is 12 processes.</div>
<br /><b>B.Performance</b><br /><br />
Figure 2 shows relative speedup of GPU version compared to CPU
only version. Suppose the performance of CPU only version with 1 core
is 1x. With 1 CPU core and 1 GPU, NAMD runs 7 times faster than CPU
only version. With 2 CPU cores and 1 GPU, NAMD runs 13 times faster.
While CPU version scales up well until 12 cores, GPU version hits the
peak around 6 cores and starts falling.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8BzX2vYd67f7GDgjh13L28izlIqR-L6j6o7fRhy4ReAhTe_2Mn1eZprZoHz5Hxx1WG0fnlEdVsbCXRoM0SYwePuobPyS87YU8udTqGTLPtuv1YNoWse0iHgTemFjs3OB1E2SdAoD7eKc/s1600/1gs.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8BzX2vYd67f7GDgjh13L28izlIqR-L6j6o7fRhy4ReAhTe_2Mn1eZprZoHz5Hxx1WG0fnlEdVsbCXRoM0SYwePuobPyS87YU8udTqGTLPtuv1YNoWse0iHgTemFjs3OB1E2SdAoD7eKc/s320/1gs.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Figure 2</td></tr>
</tbody></table>
<b>C.GPU Utilization </b><br />
<div style="text-align: center;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: left;">
<b>1)Single GPU environment </b></div>
<div>
<br />Figure 3 shows how utilization of single GPU changes as the number of CPU core increases. With 1 CPU core, GPU uses only 30% of its capability. In other words, 70% of GPU is not doing anything and just stay idle. However, if there are 2 CPU cores, GPU is shared by these 2 cores and overall utilization has been doubled up to around 60%. Likewise, utilization goes over 90% when 4 CPU cores share GPU. <br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_FU95hHmb9i_hoi9nnZpwCOcs3LKzTMMvX-U7hfKfmSw61Y-bHD60BssC3eeWwJkXDMMw4wI49cLmkdtRC_L_pjXT0wWCcrR-efvbIlwNnl6rDJ3rE9by7ptRvKgIcCwssverLIRGNM/s1600/1gu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_FU95hHmb9i_hoi9nnZpwCOcs3LKzTMMvX-U7hfKfmSw61Y-bHD60BssC3eeWwJkXDMMw4wI49cLmkdtRC_L_pjXT0wWCcrR-efvbIlwNnl6rDJ3rE9by7ptRvKgIcCwssverLIRGNM/s320/1gu.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Figure 3</td></tr>
</tbody></table>
It turned out that higher GPU utilization directly affects on application’s performance as shown in Figure 2. With 2 CPU cores, NAMD runs twice faster than 1 CPU core.<br /><br /><b>2)Multi GPU environment </b><br /><br />Among two graphs in Figure 4, top one shows utilization of first GPU and bottom one shows utilization of second GPU. The fact that two graphs look very similar each other represents NAMD distributes workload evenly to multiple GPU for computation. With 2 CPU cores, utilization of each GPU stays around 40%. With 4 CPU cores, utilization of each GPU goes up over 60%.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs8uNvlIt2Aj_K0LojBoMTuUWMsreyInHsq0cu8mtt8qf3e5Srm9lxs2vQMXZ4Xh3g62p8B9zLrcTxURuaKwlH7pv-pzQ7CW0wjClFV5CesiHf_9gkV1KdaER7wMcT-BKxkmPn7bGeqRg/s1600/2gu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs8uNvlIt2Aj_K0LojBoMTuUWMsreyInHsq0cu8mtt8qf3e5Srm9lxs2vQMXZ4Xh3g62p8B9zLrcTxURuaKwlH7pv-pzQ7CW0wjClFV5CesiHf_9gkV1KdaER7wMcT-BKxkmPn7bGeqRg/s320/2gu.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Figure 4</td></tr>
</tbody></table>
<div>
<b>IV Conclusions</b><br /><br />GPU application shows different performance charac-teristics from CPU application. Scalability can be affected by the ratio of CPU core and GPU. Oversubscribing GPU can limit the scalability of application. On multi GPU node, the overall speedup is affected by how application distribute workload to each GPU device. At the same time, under-subscribing GPU device, such as workload is not big enough to keep all GPU devices busy, is also limit the performance of GPU application. <br /><div>
<div>
<span style="color: black;"><b><div style="font-size: small;">
</div>
</b></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
</div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-18715440666164675972011-10-26T10:38:00.000-05:002011-10-26T15:13:46.660-05:00Performance of Parallel Migrate-n on Linux cluster<a href="http://popgen.sc.fsu.edu/Migrate/Migrate-n_files/migicon.png"><img alt="" border="0" src="http://popgen.sc.fsu.edu/Migrate/Migrate-n_files/migicon.png" style="cursor: hand; cursor: pointer; float: right; height: 68px; margin: 0 0 10px 10px; width: 66px;" /></a><br />
<div style="text-align: left;">
<span class="Apple-style-span" style="font-weight: bold;">Introduction</span></div>
<br />
Migrate estimates effective population sizes and past migration rates between n population assuming a migration matrix model with asymmetric migration rates and different subpopulation sizes[1].<br />
<br />
<b>Experimental environment</b><br />
<br />
In this experiment, the performance of serial version, which runs on single core, is measured as a basis of comparison. Then, the number of core is increased to 8, 16, 32, and 64. Each compute node has two quad core 2.8Ghz Intel Xeon X5560 processors based on Nehalem architecture and 24GB DDR3 DRAM with 1333Ghz clock cycle[2].<br />
<br />
Since each compute node has 8 cores, 8 compute nodes are required for 64 core job. parmfile.testml is used as an input file for experiment. The only change made to it for this experiment is that value of menu parameter is changed to ‘NO’ to be able to run it in batch mode on EOS and HYDRA[3][4][5].<br />
<br />
<b>Results</b><br />
<br />
Migrate keeps improving its performance up to 32 cores on both HYDRA and EOS[Fig.1].<br />
<div>
<a href="http://farm7.static.flickr.com/6047/6282849087_3e9c314379.jpg"><img alt="" border="0" src="http://farm7.static.flickr.com/6047/6282849087_3e9c314379.jpg" style="cursor: pointer; display: block; height: 480px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 480px;" /></a></div>
<div style="text-align: center;">
[Figure 1]</div>
<div>
<br /></div>
<div>
However, with 64 cores, performance starts falling on HYDRA[Fig.2] and it does not perform better than 32 cores on EOS[Fig.3].<br />
<a href="http://farm7.static.flickr.com/6053/6283366370_f14136a744.jpg"><img alt="" border="0" src="http://farm7.static.flickr.com/6053/6283366370_f14136a744.jpg" style="cursor: pointer; display: block; height: 480px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 480px;" /></a></div>
<div>
<div style="text-align: center;">
[Figure 2]</div>
</div>
<div>
<br />
<a href="http://farm7.static.flickr.com/6119/6282849107_e929d1b35d.jpg"><img alt="" border="0" src="http://farm7.static.flickr.com/6119/6282849107_e929d1b35d.jpg" style="cursor: pointer; display: block; height: 480px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 480px;" /></a></div>
<div style="text-align: center;">
[Figure 3]</div>
<div>
<br /></div>
<div>
On EOS, 8 cores show 5 times faster than 1 core. There is almost no speedup between 32 and 64 cores. On HYDRA, 8 cores bring 4.5 times speedup compared to 1 core. 32 cores show best performance and 64 cores are a little bit slower than 32 cores.</div>
<div>
<a href="http://farm7.static.flickr.com/6040/6283366350_3c3ac22611.jpg"><img alt="" border="0" src="http://farm7.static.flickr.com/6040/6283366350_3c3ac22611.jpg" style="cursor: pointer; display: block; height: 480px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 480px;" /></a></div>
<div style="text-align: center;">
[Figure 4]</div>
<div>
<br /></div>
<div>
Migrate runs more than twice faster on EOS than on HYDRA in general. With 8 cores EOS is about 3 times faster than HYDRA[Fig.4].<br />
<br />
<b>References</b><br />
<br />
1.<a href="http://popgen.sc.fsu.edu/Migrate/Info.html">http://popgen.sc.fsu.edu/Migrate/Info.html</a><br />
2.<a href="http://sc.tamu.edu/systems/eos/hardware.php">http://sc.tamu.edu/systems/eos/hardware.php</a><br />
3.<a href="http://sc.tamu.edu/help/eos/batch/">http://sc.tamu.edu/help/eos/batch/</a><br />
4.<a href="http://sc.tamu.edu/help/hydra/batch.php">http://sc.tamu.edu/help/hydra/batch.php</a><br />
5.<a href="http://sc.tamu.edu/systems/hydra/hardware.php">http://sc.tamu.edu/systems/hydra/hardware.php</a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-63007968253393154092011-09-05T10:23:00.000-05:002011-09-05T14:13:24.393-05:002011 Fall Short Course, Introduction to Unix/LinuxFall 2011 class starts on Sep. 5 through Sep. 8 at Teague B013.
<br />
<br />Date : Sep. 5(Monday) ~ Sep. 8(Thursday).
<br />Time : 3PM ~ 5PM
<br />Location : Teague B013
<br />
<br />This short course will be held in computer room and each attendee will be able to access computer for hands-on lab session. It is highly recommended for all attendee to get your EOS login ID ready before the first day of class. EOS login ID is required for hands-on lab.<div>
<br /></div><div>Introduction to Linux is a short course specifically designed for beginner to Linux/Unix system. It will cover basic concept of Linux and frequently used commands.
<br />
<br />Basic
<br /><ul><li>What is Linux/Unix?</li><li>File and Directory</li><li>Edit text file</li><li>Setup environment</li><li>Remote access</li></ul>Advanced
<br /><ul><li>Process,Signal</li><li>I/O redirection,Pipe</li><li>Alias</li><li>Permission</li><li>Kernel & Shell</li></ul>
<br /></div><div>For detail,
<br />
<br /><a href="https://sites.google.com/site/tamulinux/introduction-to-linux">https://sites.google.com/site/tamulinux/introduction-to-linux</a>
<br />
<br />Please, post a comment or feedback about this class. It would be helpful to improve the class.
<br />
<br /></div><div>Thanks you.</div><div>
<br /></div><div>
<br /></div><div> </div>Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-2369183939077813160.post-75174025279158896322011-08-28T12:43:00.000-05:002011-08-28T13:21:35.817-05:00Setting up dual monitor on Ubuntu 11.04 with NVIDIA<a href="http://www.ubuntu.com/sites/default/themes/ubuntu10/images/footer_logo.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 118px; height: 27px;border-style:none" src="http://www.ubuntu.com/sites/default/themes/ubuntu10/images/footer_logo.png" border="0" alt="" /></a><div style="text-align: center;"><div style="text-align: left;">Several users have been complaining that global menu bar is disappeared after setting up dual monitor on Ubuntu 11.04. It happened to me as well. Finally, I found an alternative setting which is not exactly what I wanted, but, it gives me minimum functionality that I can accept.</div></div><div>
<br /></div><div>Run 'NVIDIA X Server Settings' and make it look like these setup, then restart gdm.</div><div>
<br /></div><div style="text-align: center;">Primary monitor</div><div><div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj91ePj5ywrE1TCFybJgyqETV0l6XzjXnOpdpNnvbs6QqXU6akXQd-3scAmTGpueJ5IVVw42Tyh1-X2idm62mTlitqy-AdKlpI3ZSXeNka5kLtkYDq213GRU3qE-hxlYnjulfDQqZcLXgY/s400/Screenshot-NVIDIA+X+Server+Settings.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 375px;border-style:none;" border="0" alt="" id="BLOGGER_PHOTO_ID_5645967920461189922" /></div><div style="text-align: center;">Secondary monitor</div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGeWoVSOZo8GbxVE5FI0WoO_ryheL6HoIPGq0kF6yW-HLL33lBXvwEQjER-TSgIw5R51SlnDIJUBwgzvDIL5I4K3Oy7qVnRg71VdcZ2Wu_zOvOusdhPyyxXxOP0whyphenhyphendmWARoraQjriTFs/s400/Screenshot-NVIDIA+X+Server+Settings-1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5645968044579314594" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 375px;border-style:none " /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; ">
<br /></span></div><div>With this setting, you will get these features,</div><div>
<br /></div><div>(1) dual monitors</div><div>(2) move windows across dual monitors</div><div>(3) global menu bar on each monitor*</div><div>
<br /></div><div>I don't like (3). What I wanted is having dual monitor with global menu bar on primary monitor only. But, I couldn't find a solution for that. </div><div>
<br /></div><div>After using this setup several days, I found out that having global menu bar on secondary monitor is actually very useful or must have feature. Global menu bar becomes application menu bar once application is launched on secondary monitor. So application menu bar resides close to application itself. Otherwise, you will end up with application menu bar on primary monitor and application on secondary monitor.</div><div>
<br /></div><div>Let me know if you have better solution about this.</div><div>
<br /></div><div>Thanks.</div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-13588090272222361402011-05-02T15:53:00.000-05:002011-09-16T15:29:27.289-05:00Compile libpng + pngwriter on IBM AIX 5.3<style type="text/css">p { margin-bottom: 0.08in; }</style> <p style="margin-bottom: 0in;"><br /></p><p style="margin-bottom: 0in;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://pngwriter.sourceforge.net/site_images/logo1.png"><img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 188px; height: 39px; border-style: none;" src="http://pngwriter.sourceforge.net/site_images/logo1.png" alt="" border="0" /></a>Compiling pngwriter, generally speaking, compiling any open source code with IBM compiler on IBM AIX machine is challenging. Sometimes, it only takes few minutes to build it, but, s<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i377.photobucket.com/albums/oo212/praveenindiaa/Logos/th_IBM-AIX-1.png"><img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 47px; height: 47px; border-style: none;" src="http://i377.photobucket.com/albums/oo212/praveenindiaa/Logos/th_IBM-AIX-1.png" alt="" border="0" /></a>ometimes, it takes more than several days to figure it out that you could not use xlc to compile it in the first place because of compiler compatibility issue. Then, you might end up with gcc and, most likely, it's a snap.</p> <p style="margin-bottom: 0in;"><span style="font-family:courier new;">pngwriter-0.5.4</span> requires libpng, but, avoid version 1.5.2(which is the latest version ATTOW) as much as possible. Instead, pick <span style="font-family:courier new;"> libpng-<span style="font-weight: bold;">1.2.44</span></span> to be able to build it and afford going home tonight and have a dinner on time. :)</p> <p style="margin-bottom: 0in;">You will see only one error when you try to build it. Only one! What a day!</p> <p style="margin-bottom: 0in;">The error message is </p> <p style="margin-bottom: 0in; font-family: courier new;"></p><blockquote>"pngwriter.cc", line 1533.25: 1540-0217 (S) "__jmpbuf" is not a member of "struct png_struct_def".</blockquote><p></p> <p style="margin-bottom: 0in;"><span style="font-family:courier new;">pngwriter.h</span> includes <span style="font-family:courier new;">png.h</span> for struct <span style="font-family:courier new;">png_struct_def</span>, then, along many other header files, <span style="font-family:courier new;">/usr/include/sys/context.h</span> is included. This is the reason why the error occurs. A macro to modify <span style="font-family:courier new;">jmpbuf</span> to <span style="font-family:courier new;">__jmpbuf</span> is defined in context.h and it actually modified it in line 1533 at <span style="font-family:courier new;">pngwriter.cc</span>, whereas the struct definition itself remains unmodified.<br /></p><p style="margin-bottom: 0in;">That's why it think '__jmpbuf is not a member of struct'. One easy solution is to move down the struct definition after context.h. By this way, jmpbuf in the struct definition also will be modified to <span style="font-family:courier new;">__jmpbuf</span>.</p> <p style="margin-bottom: 0in;">Moving down <span style="font-family:courier new;">#include <png.h></png.h></span> right before <span style="font-family:courier new;">#include <iostream.h></iostream.h></span> in <span style="font-family:courier new;">pngwriter.h</span> solves the problem and you should be able to build it without any error.</p> <p style="margin-bottom: 0in;">Good luck.</p> <p style="margin-bottom: 0in;">Brian </p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-48504399101922048542010-11-09T13:49:00.000-06:002010-11-09T15:44:48.775-06:00Matlab DCS + Torque : What's missing?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.mathworks.com/cmsimages/51151_wm_pct5_fig1_mainimage.jpg"><img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 180px; height: 140px;" src="http://www.mathworks.com/cmsimages/51151_wm_pct5_fig1_mainimage.jpg" alt="" border="0" /></a>Matlab Distributed Computing Server directly supports Torque scheduler with minimum configuration. However, when it passes parameter such as number of CPU to Torque, it only allows passing one parameter using '^N^' keyword, which is defined in 'ResourceTemplate' at 'Scheduler Configuration Properties' window.<br /><br />Unfortunately, Torque, in general, needs two parameters to specify number of CPU in this format to submit multi-nodes job.<br /><br /><span style="font-family:courier new;">nodes=X:ppn=Y</span><br /><br />where X denotes number of node, Y denotes processor per node, respectively.<br /><br />Torque set ppn to 1 by default if it is not explicitly specified. In other words, 4 way job result in<br /><br /><span style="font-family:courier new;">nodes=4:ppn=1</span><br /><br />instead of<br /><br /><span style="font-family:courier new;">nodes=1:ppn=4</span><br /><br />which is ideal for system having node with 4 cores each.<br /><br />I needed a Matlab function that can handle this conversion between Matlab user and Matlab Distributed Computing Server.<br /><br /><span style="font-family:courier new;">TASKLAYOUT(X,Y)</span> takes one parameter and claculates optimal way to define X, Y values and constructs right string which can be used by 'psub' command internally.<br /><br />For example, assume each node has 8 cores, then <span style="font-family:courier new;">TASKLAYOUT(X,Y) </span>generate these output;<br /><br /><span style="font-family:courier new;"> 4 -> nodes=1:ppn=4</span><br /><span style="font-family:courier new;"> 8 -> nodes=1:ppn=8<br />12 -> nodes=</span><span style="font-family:courier new;">2:ppn=6</span><span style="font-size:100%;"><br /></span><span style="font-family:courier new;">13 -> nodes=</span><span style="font-family:courier new;">2:ppn=7</span><span style="font-size:100%;"><br /></span><span style="font-family:courier new;">16 -> nodes=</span><span style="font-family:courier new;">2:ppn=8</span><span style="font-size:100%;"><br /></span><span style="font-family:courier new;">18 -> nodes=</span><span style="font-family:courier new;">3:ppn=</span><span style="font-size:100%;">6<br /></span><span style="font-family:courier new;">23 -> nodes=</span><span style="font-family:courier new;">3:ppn=8</span><span style="font-size:100%;"><br /></span><span style="font-family:courier new;">24 -> nodes=</span><span style="font-family:courier new;">3:ppn=8</span><span style="font-size:100%;"><br /></span><span style="font-family:courier new;">32 -> nodes=</span><span style="font-family:courier new;">4:ppn=8</span><span style="font-size:100%;"><br /></span><br />In case of 12,13 and 18 way job, it does not requests full number of cores per node to minimized waste of unused cores. But, there is still sort of internal fragmentation in case of 13, which requests 14 cores even though it only needs 13 cores. In other words, requesting 13 cores are not really efficient at all.<br /><br />Now it's time to install and test it.<br /><br />Follow these steps to install <span style="font-family:courier new;">tasklayout.m</span>.<br /><br />1. Define 'ResourceTemplate' in TORQUE Scheduler Configuration Properties<br /><br />Click 'Parallel/Manage Configurations' on Matlab window.<br />Click 'File/Import' on 'Configurations Manager window'.<br />Double click configuration you want to modify.<br />Set 'ResourceTemplate' to <span style="font-family:courier new;">'-l nodes=^N^,walltime=24:00:00'</span>.<br />*Probably, most of you have done this already.<br /><br />2. Copy <span style="font-family:courier new;">tasklayout.m</span> to Matlab directory.<br /><span style="font-family:courier new;"><br />cp tasklayout.m $MATLAB/toolbox/local</span><br /><br />3. Modify <span style="font-family:courier new;">$MATLAB/toolbox/distcomp/@distcomp/@pbsscheduler/pSubmitParallelJob.m</span>. Assume each node has 8 cores.<br /><br /><span style="font-family:courier new;">selectStr=strrep(pbs.ResourceTemplate,'^N^',num2str(length(job.Tasks)))</span><br /><br />to<br /><br /><span style="font-family:courier new;">selectStr=strrep(pbs.ResourceTemplate,'^N^',tasklayout(length(job.Tasks),8))</span><br /><br />4. Done<br /><br />Please, let me know if it is not compatible in certain environment or have bugs or anything is missing in this function.<br /><br />Thanks<br /><br /><br /><span style="font-size:85%;"><span style="font-family:courier new;"><br /><pre><br />function taskStr = tasklayout( numTasks,numPpn )<br />%TASKLAYOUT Construct CPU requirement string for Torque Scheduler<br />% TASKLAYOUT(X,Y) construct CPU requirement string for X tasks<br />% with each node has Y cores.<br />%<br />% Notes:<br />%<br />% Matlab Distributed Computing Server directly supports Torque scheduler<br />% with minimum configuration. However, when it passes parameter such as<br />% number of CPU to Torque, it only allows passing one parameter using '^N^'<br />% keyword, which is defined in 'ResourceTempalte' at 'Scheduler<br />% Configuration Properties' window.<br />%<br />% Unfortunately, Torque, in general, needs two parameters in this format<br />% to submit multi nodes job.<br />%<br />% nodes=X:ppn=Y<br />%<br />% where X denotes number of node, Y denotes processor per node,<br />% respectively.<br />%<br />% TASKLAYOUT takes one parameter and claculates optimal way to define X, Y<br />% values and constructs right string which can be used by 'psub' command<br />% internally.<br />%<br />% Example 1:<br />% % Run 16 way job, each node has 8 cores.<br />% reqStr = tasklayout(16,8)<br />%<br />% ans =<br />%<br />% nodes=2:ppn=8<br />%<br />% returns<br />% taskStr<br />%<br />% See also matlabpool<br /><br />% For Matlab Distributed Computing Server<br />% (c) Brian Kim @ Texas A&M University<br /><br />if ( numTasks <= numPpn ) <br />taskStr = strcat('1:ppn=',num2str(numTasks)) ;<br />elseif ( numTasks > numPpn )<br />if ( rem(numTasks,numPpn) == 0 )<br /> taskStr = strcat(num2str(ceil(numTasks/numPpn)), ... ,<br /> ':ppn=',num2str(numPpn));<br />else<br /> taskStr = strcat(num2str(ceil(numTasks/numPpn)),':ppn=', ... ,<br /> num2str(ceil(numTasks/ceil(numTasks/numPpn))));<br />end<br />end<br /><br /></pre><br /></span></span>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2369183939077813160.post-37915359638989033642010-05-18T14:13:00.000-05:002010-05-19T10:08:44.175-05:00Scalability study of StarCCM+ on cluster<span style="font-weight: bold;">Introduction</span><br /><br />Latest version of StarCCM+ starts supporting multi nodes job on POE/IBM/AIX environment. Previously, it was not possible to run StarCCM+ on more than one node in parallel. Therefore, the maximum number of cores is limited to 16 on hydra[1]. But, with StarCCM+ ver 5.02, it became possible to spawn parallel processes on remote compute node through POE parallel environment on IBM cluster. Now, the question is how scalable StarCCM+ is?<br /><br /><span style="font-weight: bold;">Experimental environment</span><br /><br />For experiment , lemans_poly_17m.sim file has been tested, which is one of simulation input file frequently used for benchmark. The file size is 6.5GB and it has 17 millions of cells and 95 millions of vertices.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3312/4619074391_f43a529b86_o.jpg"><img style="cursor: pointer; width: 337px; height: 137px;" src="http://farm4.static.flickr.com/3312/4619074391_f43a529b86_o.jpg" alt="" border="0" /></a><br /><br /><div style="text-align: left;">The primary purpose of experiment is to identify how scale StarCCM+ is on hydra, however, the relative performance of two different machines is also evaluated. Each compute node on eos[2] has two quad core Intel X5560 based cluster and each node is connected via Infiniband, whereas, compute node on hydra has 8 dual core Power5+ and HPS is used as a interconnect.<br /><br /></div></div><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm5.static.flickr.com/4062/4619074413_e26618aca7_o.jpg"><img style="cursor: pointer; width: 524px; height: 216px;" src="http://farm5.static.flickr.com/4062/4619074413_e26618aca7_o.jpg" alt="" border="0" /></a><br /></div><div style="text-align: center;"><br /><div style="text-align: left;"><span style="font-weight: bold;">Results</span><br /></div></div><br />The benchmark results are evaluated from two different perspectives; scalability, relative performance.<br /><br />Scalability<br /><br />The scalability on eos and hydra shows not much difference each other. The performance with 16 cores is used as a basis for speedup comparison.<br /><br />On eos, speedup is easily doubled as the number of core increase and it stays very scalable up to 64 cores. With 128 cores(8x), it slows down and shows only 6.2x speedup.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3413/4619698280_60e4fae1cd_o.jpg"><img style="cursor: pointer; width: 369px; height: 391px;" src="http://farm4.static.flickr.com/3413/4619698280_60e4fae1cd_o.jpg" alt="" border="0" /></a><br /></div><br />On hydra, it shows very similar result and stays very scalable up to 64 cores and starts slow down around 128 cores.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3356/4619698278_50d0b4e7aa_o.jpg"><img style="cursor: pointer; width: 372px; height: 375px;" src="http://farm4.static.flickr.com/3356/4619698278_50d0b4e7aa_o.jpg" alt="" border="0" /></a><br /></div><br />Based on this result, there is no significant difference on the scalability of StarCCM+ on eos and hydra. However, it could be changed with different input files, I/O patterns, and characteristics of data in input file.<br /><br /><span style="font-weight: bold;">Performance</span><br /><br />The definition of 'performance' here is, simply, who finish simulation fast. With same input file, how long it take on each machine? The differences between eos and hydra varies as the number of cores increase. eos is about 2.51x faster than hydra on 16 cores and 2.41x faster on 128 cores.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm5.static.flickr.com/4003/4619074397_98c161912c.jpg"><img style="cursor: pointer; width: 500px; height: 400px;" src="http://farm5.static.flickr.com/4003/4619074397_98c161912c.jpg" alt="" border="0" /></a><br /></div><span style="font-weight: bold;"><br />Conclusion</span><br /><br />Benchmark results show that eos performs better than hydra to run StarCCM+ with given input file. However, the differences in hardware specification between 2 machines such as L3 cache size, interconnect, number of cores per node, can change the result with different characteristics of input file.<br /><br /><span style="font-weight: bold;">References</span><br /><br />1. http://sc.tamu.edu/help/hydra/<br />2. http://sc.tamu.edu/systems/eos/hardware.phpUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-2369183939077813160.post-90546974955056510732010-05-13T16:42:00.000-05:002010-05-14T14:50:43.813-05:00Quick install guide for LAMMPS on Linux clusterThis is a quick installation guide for LAMMS 10 May 2010 version for Linux cluster and it can be done within 1 hours if you follow this carefully.<br /><br />SYSTEM SPECIFICATION<br /><br />Intel(R) Xeon(R) CPU X5560 @ 2.80GHz<br />Red Hat Enterprise Linux Server release 5.4 (Tikanga) 2.6.18-164.11.1.el5<br />Intel compiler and MPI stack<br />mpiicc for the Intel(R) MPI Library 4.0 for Linux*<br />Copyright(C) 2003-2010, Intel Corporation. All rights reserved.<br />Version 11.1<br /><br />Prerequisites<br /><br />Download these 2 files and untar them, respectively.<br /><br />- <span style="font-family: courier new;">fftw-2.1.5.tar.gz</span><br /> http://www.fftw.org/fftw-2.1.5.tar.gz<br />- <span style="font-family: courier new;">lammps.tar.gz</span> (lib for LAMMPS, LAMMPS itself)<br /> http://lammps.sandia.gov/download.html<br /><br />Instruction<br /><br />In a nutshell, installation procedure consists of 3 steps; (1)FFTW, (2)libs for LAMMPS, (3)LAMMPS itself. And if you use <span style="font-family: courier new;">mpiicc</span> and<span style="font-family: courier new;"> mpiifort</span>, then you don't have to worry about the PATH of MPI package and it will be taken care of automatically.<br /><br />(1)FFTW<br /><br />Even though the latest version of FFTW is 3.2.2, but, unfortunately, LAMMS can not work with it. You better stick to 2.1.5 for now. And I assume you're installing it at /usr/local/fftw-2.1.5 directory.<br /><br />After uncompressing it,<br /><br /><span style="font-family: courier new;">cd fftw-2.1.5</span><br /><span style="font-family: courier new;">./configure CC=mpiicc F77=mpiifort --prefix=/usr/local/fftw-2.1.5</span><br /><span style="font-family: courier new;">make</span><br /><span style="font-family: courier new;">make check</span><br /><span style="font-family: courier new;">make install</span><br /><br />(2)libs for LAMMPS<br /><br />After uncompressing lammps.tar.gz,(actually, libs for LAMMPS is part of lammps.tar.gz)<br /><br /><span style="font-family: courier new;">cd lib/reax</span><br />Change ifort to mpiifort in Makefile.ifort<br /><span style="font-family: courier new;">make -f Makefile.ifort</span><br /><br /><span style="font-family: courier new;">cd lib/meam</span><br />Change ifort to mpiifort in Makefile.ifort<br /><span style="font-family: courier new;">make -f Makefile.ifort</span><br /><br /><span style="font-family: courier new;">cd lib/poems</span><br />Change icc to mpiicc in Makefile.icc<br /><span style="font-family: courier new;">make -f Makefile.icc</span><br /><br />(3)LAMMPS<br /><span style="font-family: courier new;">cd src</span><br /><br />Check which packages are included<br /><span style="font-family: courier new;">make package-status</span><br /><br />Choose all standard packages to be included<br /><span style="font-family: courier new;">make yes-standard</span><br /><br />If you don't have GPU, then exclude gpu package. Otherwise, you will see tons of error message when you compile it.<br /><span style="font-family: courier new;">make no-gpu</span><br /><br />Edit MAKE/Makefile.linux<br /><br />Remove MPI_PATH,MPI_LIB, it will be taken care of by <span style="font-family: courier new;">mpiicc</span>, <span style="font-family: courier new;">mpiifort</span><br /><span style="font-family: courier new;">#MPI_PATH =</span><br /><span style="font-family: courier new;">#MPI_LIB = -lmpich -lpthread</span><br /><br /><span style="font-family: courier new;">CC=mpiicc</span><br /><span style="font-family: courier new;">LINK=mpiicc</span><br /><span style="font-family: courier new;">FFT_INC = -I/usr/local/fftw-2.1.5/include -DFFT_FFTW</span><br /><span style="font-family: courier new;">FFT_PATH = -L/usr/local/fftw-2.1.5/lib</span><br /><span style="font-family: courier new;">FFT_LIB = -lfftw</span><br /><br />Build LAMMPS as an executable and library as well<br /><br /><span style="font-family: courier new;">make linux</span><br /><span style="font-family: courier new;">make makelib</span><br /><span style="font-family: courier new;">make -f Makefile.lib linux</span><br /><br />INSTALLATION<br /><br />I assume you're installing lammps at /usr/local/lammps directory.<br /><br /><span style="font-family: courier new;">copy bench/ doc/ examples/ potentials/ README tools/ to /usr/local/lammps</span><br /><span style="font-family: courier new;">copy all *.a to /usr/local/lammps/lib</span><br /><span style="font-family: courier new;">copy lmp_linux to /usr/local/lammps/bin</span><br /><br />Done!!!<br /><br />Once you have gotten this far, just let user know lammps is available at /usr/local/lammps, then they know how to play around it.Unknownnoreply@blogger.com9