tag:blogger.com,1999:blog-27087256006825819592024-03-05T11:48:08.403-08:00I void warrantiesNotes on problems and solutions found while developing and goofing around, only technical and science stuff, no commercial pitchs, preaching or thought-leader crap, just hands-on stuff.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-2708725600682581959.post-59579983911808488322017-01-14T01:42:00.003-08:002017-01-14T01:42:28.041-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: January 14, 2017 at 09:49AM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-88845734449253088542017-01-14T01:42:00.001-08:002017-01-14T01:42:27.187-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: January 14, 2017 at 09:46AM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-17713592992098198062017-01-14T00:42:00.001-08:002017-01-14T00:42:36.190-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: January 14, 2017 at 09:30AM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-87018075861642007702017-01-13T10:42:00.001-08:002017-01-13T10:42:48.316-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: January 13, 2017 at 06:54PM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-76478607793899220992017-01-09T11:42:00.001-08:002017-01-09T11:42:39.974-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: January 9, 2017 at 07:49PM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-6324812817208797762016-12-16T23:42:00.001-08:002016-12-16T23:42:30.820-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: December 17, 2016 at 08:10AM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-73475470087162315162016-12-16T01:42:00.001-08:002016-12-16T01:42:35.313-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: December 16, 2016 at 10:02AM<br />
Extra Data: , , ,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-10333557297728840842016-12-13T09:21:00.005-08:002016-12-13T09:21:31.637-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: December 13, 2016 at 06:21PM<br />
Extra Data: 256, 25091, 3240,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-30072505758871881352016-12-13T09:21:00.003-08:002016-12-13T09:21:30.899-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: December 13, 2016 at 06:21PM<br />
Extra Data: 0, -31582, 3244,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-10641820382062941642016-12-13T09:21:00.001-08:002016-12-13T09:21:21.540-08:00This is a "test" of my 6LoWPAN connected deviceWhat: test<br />
When: December 13, 2016 at 06:21PM<br />
Extra Data: 256, 24834, 3240,
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-11169082758622913462015-10-18T06:07:00.000-07:002015-10-18T06:22:08.150-07:00A simple WiFi power cord switch with the OLIMEX ESP8266 evaluation board<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/AVvXsEjV1CASE6mALuCPAdklQ_5qtFik56j6ZwO3YEh_DggsRdV7zmdzIzkXtWx0yOZNEAo57OUC4Z4b00AVN2Lf7sFtL52EEZXIITcNciKtJpdxY1Z1x1lATUM5SN64Yxmak50HoYKGha0mCE0O/s1600/ESP8266-EVB.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV1CASE6mALuCPAdklQ_5qtFik56j6ZwO3YEh_DggsRdV7zmdzIzkXtWx0yOZNEAo57OUC4Z4b00AVN2Lf7sFtL52EEZXIITcNciKtJpdxY1Z1x1lATUM5SN64Yxmak50HoYKGha0mCE0O/s320/ESP8266-EVB.jpg" width="318" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image taken from OLIMEX website</td></tr>
</tbody></table>
<br />
After some months of having a couple of <a href="https://www.olimex.com/Products/IoT/ESP8266-EVB/open-source-hardware">OLIMEX ESP8266 evaluation boards</a> lying around in my office desk, I decided to jump in the ESP8266 hype train and see by myself how this US$5 WiFi module changed the maker landscape.<br />
<br />
I was not dissapointed.<br />
<br />
<h3>
The ESP2866</h3>
<br />
The <a href="http://www.esp8266.com/">ESP8266</a> is a highly integrated SoC (System on Chip) which includes Xtensa LX106 core processor, RAM, a RF front end and allow WiFi TCP/IP stack to be implemented on board. The ESP8266 is capable of either hosting an application or offloading all WiFi networking functions from another application processor.<br />
<div>
<br /></div>
<div>
I wasn't interested in driving the ESP8266 with another controller, but to flash an application and use it as a stand-alone module, mostly to keep any future BOM as low as possible. After taking a look at the ESP8266 features it seemed possible to run most applications from within the device:</div>
<div>
<ul>
<li>It has GPIO, I2C, ADC, SPI, PWM.</li>
<li>A 80 MHz operation frequency</li>
<li>64 Kb of instruction RAM</li>
<li>96 Kb of data RAM</li>
<li>64 Kb boot ROM</li>
<li>Winbond <a href="https://github.com/esp8266/esp8266-wiki/wiki/W25Q40BVNIG">W25Q40BVNIG</a> SPI flash</li>
<li>RISC architecture</li>
<li>The core is a 106micro Diamond Standard core (LX3) made by <a href="http://ip.cadence.com/">Tensilica</a>.</li>
</ul>
<div>
As we need to consider also the available resources left for the application taking into the account the stack itself, from <a href="http://bbs.espressif.com/viewtopic.php?t=129">this page</a> the actual RAM/ROM are about 40 Kb and 64 Kb.</div>
<div>
<br /></div>
<div>
The ESP8266 evaluation board by OLIMEX features a 220VAC/10A relay module and conveniently exposes most pins in a standard 2.54 mm header, which is great to have available when developing. It also features an user button which can also be used to put the ESP2866 in bootloader mode, to allow flashing over UART.</div>
<div>
<br /></div>
<h3>
Installing the toolchain</h3>
<div>
<br /></div>
The instructions to <a href="https://github.com/esp8266/esp8266-wiki/wiki/Toolchain">install the Toolchain</a> were straightforward to use, I had one dependency issue with my current <i>autoconf</i> version, easily fixable with the following:<br />
<br />
<pre class="prettyprint lang-bash">sudo add-apt-repository ppa:dns/gnu -y
sudo apt-get update -q
sudo apt-get install --only-upgrade autoconf
</pre>
<br />
As a general recommendation install the ESP8266 toolchain as suggested in the <b><i>/opt/Espressif</i></b>, as many applications (like the <a href="https://github.com/OLIMEX/ESP8266">OLIMEX examples and resources</a>) are heavily hard-coded to use this path.<br />
<br />
I also recommend to use the suggested Espressif SDK v0.9.3 instead of the newer v.1.2.0, as I (painfully) found that many applications and examples were written for the earlier version, and porting for the new SDK version required more time than I had available for a simple test run.<br />
<br />
<h3>
Flashing the ESP2866</h3>
<br />
The ESP2866-EVB comes with factory-enabled flash mode, which allows to program the device over UART. I used<a href="http://lghttp.38101.nexcesscdn.net/8012C4A/MSC_Magento/media/catalog/product/cache/1/image/650x/040ec09b1e35df139433887a97daa66f/u/s/usb-ttl-adpt_1.jpg"> a cheap USB to serial converter</a>, wired as shown below.<br />
<br />
<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/AVvXsEh-ITYKyrNKYxtCCJN6VWLpCnjcCmyyF3OUXCRtB0CF4A-xSVlecalqLkw5WcZvLSUQi7XxmYbOh6A0a-0Rwu8uxmfZ1MoFqX_dXQqdoC9OeLSbH-adxRPTPQnf-lqCX2SrX35iR4tTAIhk/s1600/FIM56U5IAEDIMBO.MEDIUM.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ITYKyrNKYxtCCJN6VWLpCnjcCmyyF3OUXCRtB0CF4A-xSVlecalqLkw5WcZvLSUQi7XxmYbOh6A0a-0Rwu8uxmfZ1MoFqX_dXQqdoC9OeLSbH-adxRPTPQnf-lqCX2SrX35iR4tTAIhk/s320/FIM56U5IAEDIMBO.MEDIUM.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image taken from <a href="http://www.instructables.com/id/ESP8266-Code-Generator-with-128bit-security-No-cod/?ALLSTEPS">Instructables</a> site</td></tr>
</tbody></table>
<br />
<br />
<ul>
<li>GND (blue wire to pin 2)</li>
<li>USB to Serial UART RX pin to ESP2866 UART TX (green wire to pin 3)</li>
<li>USB to Serial UART TX pin to ESP2866 UART RX (red wire to pin 4)</li>
</ul>
<br />
The <a href="https://github.com/OLIMEX/ESP8266/blob/master/HARDWARE/ESP8266-EVB/ESP8266-EVB_Rev_A.pdf">ESP8266-EVB datasheet</a> has more information.<br />
<br />
To put the device in bootloader mode just make sure the board is powered off, press and hold the user button (the big white one), and while pressing the button power the board (connect to 5VDC).<br />
<br />
<h3>
Making a WiFi enabled power cord switch</h3>
<br />
I wanted to see how fast would it be to make a connected application. In nearly 10 minutes I had a WiFi enabled power cord switch. The motivation was simple: power on and off anything in my house running at 220V/10A from anywhere in the world (as in my bed), without having to cut or adapt any home appliance for this purpose, a non-intrusive approach to keep my wife happy and myself out of the couch.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvsvYhevYTxwwkWpGe54sFp-bU0EDmNz6OiN02yMlmIvd2AEgDo2sR9WsyITs0AuDNlQIdo-jmEeHQmi6T4Dc6NmOVtHTV0KFmkTBLq_j8_S_GCElCgfRusoHYMLXvMRi18_nv2s-R9Ad/s1600/20151018_012906.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvsvYhevYTxwwkWpGe54sFp-bU0EDmNz6OiN02yMlmIvd2AEgDo2sR9WsyITs0AuDNlQIdo-jmEeHQmi6T4Dc6NmOVtHTV0KFmkTBLq_j8_S_GCElCgfRusoHYMLXvMRi18_nv2s-R9Ad/s320/20151018_012906.jpg" width="320" /></a></div>
<br />
<br />
The specification was simple enough: power the ESP8266 directly from mains and use the relay with the normally open (NO) mode as devices would normally have to be off. As time was my premise, I <strike>destroyed</strike> took an USB charger to power up the board, using a multimeter I found the 5VDC/GND pins on the USB charger and solder wires to pins 1 and 2 of the CON3 header.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSnItw3Ordoe3U3Y-7MkVTjc9oM21fbTDTFNJmU2-ZG2dQ5b2Dxjn03XjEf3DYSXQGLGlsZrYltb9qLOPXtnWEhZI2ySqqsifBPFdzIfy9eUxl97z_Y5TBzfV618wcxj_yDBrSkc-lH97Y/s1600/20151018_142949.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSnItw3Ordoe3U3Y-7MkVTjc9oM21fbTDTFNJmU2-ZG2dQ5b2Dxjn03XjEf3DYSXQGLGlsZrYltb9qLOPXtnWEhZI2ySqqsifBPFdzIfy9eUxl97z_Y5TBzfV618wcxj_yDBrSkc-lH97Y/s320/20151018_142949.jpg" width="320" /></a></div>
<br />
I kept the USB charger casing to isolate the electronics and avoid someone touching mains by accident.<br />
<br />
Now for the firmware I used the stock <a href="https://github.com/OLIMEX/ESP8266/tree/master/IoT%20Firmware">IoT Firmware image from OLIMEX</a> resources, this handy application allows any web developer to easily control most of the ESP8266 evaluation board features, like managing the wireless network, create and poll events and status related to the user button and relay, manage I2C devices, update the Firmware image remotely, amongst others.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
To drive the relay over WiFi the <a href="https://github.com/OLIMEX/ESP8266/blob/master/IoT%20Firmware/document/ESP-Sample-Application.html">ESP-Sample-Application.html</a> provides a friendly web interface, a screenshot is shown below.<br />
<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/AVvXsEiwLpPrC_SLgV_umt82kf0GFVtdofWvyS8DAJAPH9uIxOEYMsWRbHOG0y0Aw4OiwxeceFrMn0uyniMnhVHlL3ecojxXd4W1yRAlQMpQ2yMXPxWu_Mr3Xyp8gYe6-pPDYKQzKbSvNPWaZ8R7/s1600/IoT+app.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwLpPrC_SLgV_umt82kf0GFVtdofWvyS8DAJAPH9uIxOEYMsWRbHOG0y0Aw4OiwxeceFrMn0uyniMnhVHlL3ecojxXd4W1yRAlQMpQ2yMXPxWu_Mr3Xyp8gYe6-pPDYKQzKbSvNPWaZ8R7/s320/IoT+app.PNG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">OLIMEX IoT Firmware and sample application</td></tr>
</tbody></table>
<br />
And that's it! a simple WiFi-enabled power cord in 10 minutes.<br />
<br />
I tested with a desk lamp and other appliances (under 10A), as it only requires to plug into the female connector of the power cord is easy to use anywhere.<br />
<br />
A future enhancement would be to add sensors like an ambient light or temperature sensor, to provide more information about the current location, maybe a presence sensor to allow an event-based operation. Of course making a proper PCB with a 220VAC/5VDC transformer would be mandatory.<br />
<br />
Now to further play with the ESP8266 and dig into the source code.</div>
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0Cerdanyola del Vallès, Barcelona, Spain41.489549140418909 2.13821411132812541.465760140418908 2.0978736113281249 41.513338140418909 2.1785546113281251tag:blogger.com,1999:blog-2708725600682581959.post-87852753605606917332014-12-04T11:55:00.000-08:002015-01-18T12:05:01.389-08:00Wireless Garden sensing Prototype A and B (Intel Galileo, Spark Core and Grove)We have a small garden at home and adding sensors to it was merely a matter of time, specially now that <i>winter is coming</i>, and it is time to plant our pepper and tomatoes plants. Below are the two iterations made to my wireless gardening sensor (still in beta stage).<br />
<br />
<h3>
Prototype A: Intel Galileo on board</h3>
<br />
For the first prototype I used the <a href="https://communities.intel.com/community/makers/galileo/documentation/galileodocuments">Intel Galileo</a> Board <a href="http://techscrapbox.blogspot.com.es/2014/11/senzations-2014-summer-school.html">I won at Senzations</a>, the objective was to test the sensors, familiarize with the obtained values, and test publishing to <a href="http://ubidots.com/">Ubidots</a>. For the test I used my wife's pepper plant.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDQs9P2fFZQTVa2qW6cTClW4HDHlQ6QCjX-Nfk7BV2DoizrW3L0i0nqyvRUqPSSUNfwtqApvsKI8SQIWmnmVPcTY_RU0yrn3tw7eJGANVqyC2iSblVN0IQb0cIVwT9B7KaxzsQmHWhmKyb/s1600/20141026_122155.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDQs9P2fFZQTVa2qW6cTClW4HDHlQ6QCjX-Nfk7BV2DoizrW3L0i0nqyvRUqPSSUNfwtqApvsKI8SQIWmnmVPcTY_RU0yrn3tw7eJGANVqyC2iSblVN0IQb0cIVwT9B7KaxzsQmHWhmKyb/s1600/20141026_122155.jpg" height="400" width="240" /></a></div>
<br />
<br />
Light, Temperature and Humidity are variables easy to understand and correlate, but as there was litle information about the Soil Moisture sensor itself, I measured both with the sensor in the free air and submerged into a glass of water, I found out the range was between 0-700 units. The next step was to water the pepper pot and see the Soil Moisture value when the plant if fully watered, then see the chart going down until the next watering session (when the leaves are "sad" as my wife says), so we can see at which values do we have to trigger an alert.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxhyfCCvnGVVexxU7khHPiMSM1v7pKf5L431JJxRKg08vSLA9avx_TASaGvJ-J6oC0_JG5_oa31YkRvVFlMNwxfYSwiDDUL_kdJopGv5zgCk3TE_cKJC5cd3Y11HilI0J9d3KqbG3C0Ul/s1600/ubidots+values.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxhyfCCvnGVVexxU7khHPiMSM1v7pKf5L431JJxRKg08vSLA9avx_TASaGvJ-J6oC0_JG5_oa31YkRvVFlMNwxfYSwiDDUL_kdJopGv5zgCk3TE_cKJC5cd3Y11HilI0J9d3KqbG3C0Ul/s1600/ubidots+values.PNG" height="203" width="400" /></a></div>
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjynpff7Yv0-3wkgNnbvEXWkuJwR65ev2vkhPgjDt71ah470OwcSXy1Sz3x3E6jFSLPrvuuO1NbwMUu2tXhJ6rAaz7sg1qYvzVcFYmSnnURJ23O4rp5RjezHvQBepm1j0ik1xv4NZR_yPFV/s1600/Ubidots+events.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjynpff7Yv0-3wkgNnbvEXWkuJwR65ev2vkhPgjDt71ah470OwcSXy1Sz3x3E6jFSLPrvuuO1NbwMUu2tXhJ6rAaz7sg1qYvzVcFYmSnnURJ23O4rp5RjezHvQBepm1j0ik1xv4NZR_yPFV/s1600/Ubidots+events.PNG" height="343" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyFu_Zpg6RVRpouezeHFdeHKNDwqPWtEtkUFzOVFMXurpC5bFOAdxXBSOSsA35BP5ftU8MfKuXOn2WB0Zr9mTyJ0QaKzcbZqtVIUZ9yUUpuFuSb4XSnE15zRMomr5XQCd3fTS1kOMn5X6w/s1600/Ubidots+events.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
The actual code was mostly taken from <a href="http://ubidots.com/docs/devices/spark.html#devices-spark">Ubidots examples</a>, as the sensors at <b>this present stage</b> are mostlly analogue, it was only required to use the analogRead() call from the Arduino API. The sensors are from <a href="http://www.seeedstudio.com/wiki/GROVE_System">Grove</a>: the <a href="http://www.seeedstudio.com/wiki/Grove-_Temperature_and_Humidity_Sensor">temperature and humidity sensor</a> is I2C-based, the <a href="http://www.seeedstudio.com/wiki/Grove_-_Moisture_Sensor">soil moisture</a> and <a href="http://www.seeedstudio.com/depot/Grove-Light-Sensor-p-746.html">light sensor</a> are analogue.<br />
<br />
<h3>
Prototype B: Spark Core</h3>
<br />
With the sensors and the Ubidots platform figured out, the next step was to make the whole thing to run on battery as a stand-alone device. For this I used the <a href="https://www.spark.io/">Spark Core</a> <a href="http://techscrapbox.blogspot.com.es/2014/11/iotogether-hackaton-2014-iot-loving.html">I won at IoTogether Hackaton </a>along with a battery charger board I <strike>steal</strike> borrowed from work, and a 3.7V 800mAh Li-ion battery connected to a battery charging circuit.<br />
<br />
To avoid having to solder a wire to the USB 5VDC pin I added a scrambled jumper logic to enable charging the battery when connected to the micro-USB, else the Spark Core will be powered by the battery only. I have also one power input to throw in a solar panel and charge the battery in the day and discharge over the night, but I still have to figure out how to adapt it to the enclosure.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOu4actgDRmGBXkBmiqUGAq9k8_09EAiulE0jcB_5VNyqZkH88j2yIXBfoft9cMvRmVRiwct0jUCWEmKQ_pK4XlrOgc0CGabhqvhPZNTzkLNgwFgsEm97keA5s-21jrQwthmdgxFwM8X19/s1600/20141030_164729.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOu4actgDRmGBXkBmiqUGAq9k8_09EAiulE0jcB_5VNyqZkH88j2yIXBfoft9cMvRmVRiwct0jUCWEmKQ_pK4XlrOgc0CGabhqvhPZNTzkLNgwFgsEm97keA5s-21jrQwthmdgxFwM8X19/s1600/20141030_164729.jpg" height="240" width="400" /></a></div>
<br />
I added 2 <a href="http://www.phidgets.com/">Phidget-like</a> connector to be able to connect Phidget sensors or analog ones following the same pin-out (VDC/GND/Signal), and one <a href="http://webshop.zolertia.com/index.php/cPath/29_30">Ziglet-like</a> connector to connect any I2C-based sensor, as at the end I want to use digital sensors to keep the power consumption as <i>low as possible</i>, having wired a GPIO pin also to the connector to use interrupts from the sensors as well.<br />
<br />
The male pin-header exposes unused GPIOs to be used later, for example one wandering idea is to add an MP3 board with an amplifier and a small speaker, as allegedly this helps plants grow, or maybe do a playback of my wife talking to the plants, which one was it? nevertheless it would also be kinda cool to play nature music when presence is detected... this will be likely an improvement to make if the power consumption can be kept low.<br />
<br />
One caveat: I was one of the unlucky Spark owners who had a board with faulty DNS resolve, so I had to include an <a href="https://github.com/Hootie81/DNSClient">external DNS client</a> to resolve Ubidots IP address, and then add the host property to my header and initiliaze the Server IP address as shown below:<br />
<pre class="prettyprint lang-bash">http_header_t headers[] = {
{ "Content-Type", "application/json" },
{ "X-Auth-Token" , TOKEN },
{ "host", "things.ubidots.com" },
{ NULL, NULL }
};
IPAddress dnsServerIP(8,8,8,8);
IPAddress remote_addr;
DNSClient dns;
char serverName[] = "things.ubidots.com";
void setup() {
request.port = 80;
dns.begin(dnsServerIP);
dns.getHostByName(serverName, remote_addr);
request.ip = remote_addr;
}
</pre>
Then to take advantage of the Spark low power mode and try to save battery as most as possible, I use the <a href="http://docs.spark.io/firmware/">SLEEP_DEEP_MODE</a> to put the Spark to sleep and awake after 5 minutes, rebooting the code with no memory retention, which is fine in my case as I only want to take single readings and upstream these. The code runs as follows:<br />
<br />
<pre class="prettyprint lang-bash">void loop() {
// Read data from the sensors
getData();
// Send data to Ubidots
postData();
// Short blink to indicate we have finished posted
blink_led(500);
// Stay awake enough time to allow being reprogramed
delay(AWAKE_BEFORE_SLEEP);
// Put the core back to sleep
Spark.sleep(SLEEP_MODE_DEEP, SLEEP_SECONDS);
}</pre>
<br />
The AWAKE_BEFORE_SLEEP delay makes sure the Spark Core stays awake for 20 seconds, which gives me enough time to reprogram the Spark over the <a href="http://docs.spark.io/build/">Web IDE</a> from my PC without having to connect the Spark to the host over USB. One of the things on my to-do list is to measure the current consumption of the device.<br />
<br />
The whole thing fits into a standard enclosure, one of the things I have still pending to do is to adapt the sensors to the enclosure, make a small window to be able to visualize the LED, and also fix the solar panel. I have convinced my daughters to paint the enclosure with a festive theme, so surely I will post this anytime soon.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifbjgA14eaOXNPyrlaZ5lTfm0cPCDoeqNwCHdy2IIHN9ExTW2zCjzJ5MVE0dliPiJ5sRzn1SyfGrgXpy_T5nLK8mcZxyy8sY8ulcgbHG1Xsu36hW8AFJ6cQ_2qQN9fUtrxhizo_DF_Tvdt/s1600/20141030_170421.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifbjgA14eaOXNPyrlaZ5lTfm0cPCDoeqNwCHdy2IIHN9ExTW2zCjzJ5MVE0dliPiJ5sRzn1SyfGrgXpy_T5nLK8mcZxyy8sY8ulcgbHG1Xsu36hW8AFJ6cQ_2qQN9fUtrxhizo_DF_Tvdt/s1600/20141030_170421.jpg" height="240" width="400" /></a></div>
<br />
<br />
So that's it, I'm hoping in the holidays to have time to improve the Prototype B, make some measurements and work on the solar panel. One of the things I will surely test is the <a href="http://www.instructables.com/id/Using-the-ESP8266-module/">ESP8266</a> cheap WiFI board, but with my <a href="http://blog.spark.io/2014/11/12/introducing-the-19-dollar-photon/">Photon</a> already ordered in pre-sale for next year, I think it will make worth the wait, in time for the Prototype C, maybe even a release.<br />
<br />
<br />Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-33784586962609578362014-12-04T02:36:00.003-08:002014-12-04T02:53:43.641-08:00Bring Oneiric-based distros back to live in Linaro and IGEP boardFollowing the <i>end-of-year</i> tradition of updating production boards, I found an <a href="https://www.isee.biz/products/igep-processor-boards/igepv2-dm3730">ISEE IGEP v2</a> board running Linaro<a href="https://www.yoctoproject.org/"></a> distribution on an Oneiric-based release, which reached end of life on May 2013. One option would be upgrading to a new LTS distro, but as time was limited and the current owner has a <i>if-works-don't-touch</i> strict policy, I choosed instead to update at least its sources:<br />
<br />
<pre class="prettyprint lang-bash">W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/main/source/Sources 404 Not Found</pre>
<br />
Just edit the /etc/apt/sources.list file and replace with the following:<br />
<br />
<pre class="prettyprint lang-bash">deb http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric-updates universe
deb http://old-releases.ubuntu.com/ubuntu oneiric-security main
deb-src http://old-releases.ubuntu.com/ubuntu oneiric-security main
deb http://old-releases.ubuntu.com/ubuntu oneiric-security universe
deb-src http://old-releases.ubuntu.com/ubuntu oneiric-security universe</pre>
<br />
Then run:<br />
<br />
<pre class="prettyprint lang-bash">sudo apt-get update</pre>
<br />
Don't forget to also test for <a href="http://techscrapbox.blogspot.com.es/2014/12/fix-shellshock-on-non-ltsdeprecated.html">ShellShock vulnerability</a>.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-13566716106317384922014-12-03T04:08:00.001-08:002014-12-03T04:08:59.455-08:00Fix Shellshock on non LTS/deprecated Unix distrosPlenty of things have been said about <a href="http://en.wikipedia.org/wiki/Shellshock_%28software_bug%29">Shellshock</a> vulnerability and solutions, most of them consisting of upgrading the bash module for LTS distros, but lately as I have dusted my ALIX board based on Voyage 0.9.0 distribution, I found this was not an option: even after upgrading and downloading the bash packet from the dist pool, there were requirements missing to upgrade/install bash from the packet manager. This was my current bash version:<br />
<br />
<pre class="prettyprint lang-bash"># bash --version
GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></pre>
<br />
The bash version did not matched the fixed ones, anyways to test if you are affected you can run on a terminal the code below, if both lines are showed, then it is affected.<br />
<br />
<pre class="prettyprint lang-bash"># env X="() { :;} ; echo busted" `which bash` -c "echo completed"
busted
completed
</pre>
I found a fix at <a href="https://shellshocker.net/">ShellShocker</a> and it was as easy as running the snippet below (although I would not recommend executing remote scripts, it is not a good practice), but if you are curious about what it does, or you want to run this yourself, the sources are also listed below.<br />
<br />
<pre class="prettyprint lang-bash">curl https://shellshocker.net/fixbash | sh</pre>
<br />
After running the script the bash has been patched and the shellshock test now ommits the "busted" line.<br />
<br />
<pre class="prettyprint lang-bash"># bash --version
GNU bash, version 4.3.30(1)-release (i586-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></pre>
<br />
Sources:<br />
<ul>
<li><a href="https://github.com/wreiske/shellshocker/blob/master/fixbash">Fixbash script location</a></li>
<li><a href="https://shellshocker.net/">ShellShocker WebPage</a></li>
</ul>
<br />
<br />Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-20023955650246047712014-12-03T01:03:00.004-08:002014-12-03T01:03:59.952-08:00Fix EXT2 ext2_lookup deleted inode referencedDeleted <a href="http://en.wikipedia.org/wiki/Inode">inodes</a> are a common problem when working with SD cards, specially noticeable in ALIX-bsaed boards running Voyage or alike. Remove the SD, connect as an external drive to your host (I'm connecting to an Ubuntu-based VM) and do the following:<br />
<br />
<pre class="prettyprint lang-bash">$ sudo fdisk -l
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders, total 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cb32b
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 28350463 14174208 83 Linux
/dev/sda3 28352512 31457279 1552384 82 Linux swap / Solaris
Disk /dev/sdb: 3997 MB, 3997163520 bytes
128 heads, 63 sectors/track, 968 cylinders, total 7806960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfc8a205c
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 7370495 3685247+ 83 Linux</pre>
<br />
<br />
Identify your disk using the information above, then check and repair the file system using <a href="http://linux.die.net/man/8/e2fsck">e2fsck</a>, when prompted you can comply with the suggested fix by pressing "y". This should be the output if no errors are found.<br />
<br />
<pre class="prettyprint lang-bash">$ sudo e2fsck -f /dev/sdb1
e2fsck 1.42 (29-Nov-2011)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
ROOT_FS: 121871/230608 files (2.0% non-contiguous), 807088/921311 blocks</pre>
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-21794323523608705032014-12-02T08:50:00.001-08:002014-12-02T08:51:04.313-08:00Disable 6lbr to be launched at boot<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.cetic.be/IMG/png/6lbr-top-medium-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="135" src="https://www.cetic.be/IMG/png/6lbr-top-medium-2.png" width="400" /></a></div>
<br />
I luckily found out <a href="https://github.com/cetic/6lbr/wiki">6lbr</a> some months ago (I have an unfinished post about it yet to finish, loving <a href="http://cetic.github.io/foren6/">foren6</a> also), but I needed to stop the service to be launched from boot while I did some testing. As I didn't found any configuration tweak to do so, I disabled the service at all /etc/rcX.d run levels using the well known update-rc.d script.<br />
<br />
<pre class="prettyprint lang-bash">update-rc.d -f 6lbr remove</pre>
<br />
To enable back:<br />
<br />
<pre class="prettyprint lang-bash">update-rc.d 6lbr defaults</pre>
<br />
And business as usual.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-65193329937621369542014-12-01T01:44:00.003-08:002014-12-01T01:46:01.774-08:00Stop the LG SmartShare service to be launched at boot (Windows 7)Short story: LG SmartShare DLNA media sharing service was slowing down Windows boot abnormally, and the built-in settings do not provide the polite option to disable launching the application at boot. After checking the usual suspects (msconfig and Startup folder), I found where the SmartShare task was being scheduled.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONcr8kwkdoAbZhhlVbqQyc13HxO0zhXkZqOZkcw2fzoMvqUVmC35-1_z06IlyIkisfqHMl0-X9eRth8kuzoCr7bPS2KzcMAE1hxMwyO8bCD_QlCRtn0qgsi4LboQSTkSiqRsJbPd7ovCD/s1600/smartshare+removal.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONcr8kwkdoAbZhhlVbqQyc13HxO0zhXkZqOZkcw2fzoMvqUVmC35-1_z06IlyIkisfqHMl0-X9eRth8kuzoCr7bPS2KzcMAE1hxMwyO8bCD_QlCRtn0qgsi4LboQSTkSiqRsJbPd7ovCD/s1600/smartshare+removal.PNG" height="156" width="400" /></a></div>
<br />
Just go to the Administrative Tools menu and open the Task Scheduler.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com3tag:blogger.com,1999:blog-2708725600682581959.post-54065514113837866122014-11-30T12:17:00.001-08:002014-12-01T00:17:57.065-08:00IoTogether Hackaton 2014: IoT loving with the LoveTotem<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivO5hgNPhI2OYKVZkWoI2z9zSzo90PTXKFP8GPZRw9koIo4ww2yEUMC2qj7Z6la3iznutDvPF5ndL8a80jUFDCl-hbRomVXqnWcrQnCq3C7NqqxEreUxeioOpEyTEf27peLoegLGZmE1D1/s1600/BxwKwaPIgAAwmSa.jpg+large.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivO5hgNPhI2OYKVZkWoI2z9zSzo90PTXKFP8GPZRw9koIo4ww2yEUMC2qj7Z6la3iznutDvPF5ndL8a80jUFDCl-hbRomVXqnWcrQnCq3C7NqqxEreUxeioOpEyTEf27peLoegLGZmE1D1/s1600/BxwKwaPIgAAwmSa.jpg+large.jpg" height="183" width="400" /></a></div>
<br />
<blockquote class="tr_bq">
<i> <a href="http://iotogether.splashthat.com/">IoTogether</a> was a competition event for 7-8 co-located teams in Trento and Barcelona. Remote teams will be composed by participants from both sides who will be asked to interact via Future Internet videoconferencing tool provided by the SPECIFI project.</i><br />
<br />
<i>Sponsors: <a href="http://www.specifi.eu/">SPECIFI</a>, <a href="http://www.compose-project.eu/">COMPOSE </a>and <a href="http://www.infra-visionair.eu/">VISIONAIR</a>.<br />Partnership: <a href="http://www.create-net.org/">CREATE-NET</a>, <a href="http://www.muse.it/">MuSe</a>, <a href="http://www.barcelonalab.cat/ca">BCNLab</a>, <a href="http://www.i2cat.net/">I2CAT </a>and the <a href="http://www.bcn.cat/">City of Barcelona</a>.</i></blockquote>
*** <br />
<br />
The idea was as freaky as it could get, is a lot funnier to start explaining our team concept from the prototyping stage up to the final application...<br />
<br />
At the <a href="http://fabraicoats.bcn.cat/">Barcelona location</a> we implemented a force sensor with a 3-axis accelerometer integrated to a wool glove, to measure both force of impact, movement and acceleration, displayer over a LED bar for our viewing pleasure, hooked up with a <a href="http://en.wikipedia.org/wiki/Skin_conductance">GSR (Galvanic Skin Response)</a> sensor to measure the "arousal" level of its wearer. To interface the sensors we used an Arduino bundled with a WiFI module, to send the sensed data over <a href="http://www.gluethings.com/platform/whats-gluethings/">Glue.Things</a> to the Trento location.<br />
<br />
We did also manage to send data to <a href="http://ubidots.com/">Ubidots</a> and <a href="https://thethings.io/">The Things.IO</a>. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_iz7OG-Ry8j3wi8iEIoy0BiWu9_NJtEAcNj7UysX8L8QNQkzDd6Rg8TI0TGmU3vGHxkxJCsAUKPL_gUtbBsfePVHmcjjXtvjzMzcdHwo2M2MNka3zkF_r65flGkQbnLJ_AQDyp5vJTrZ/s1600/ByC-hmfIgAA2ru3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_iz7OG-Ry8j3wi8iEIoy0BiWu9_NJtEAcNj7UysX8L8QNQkzDd6Rg8TI0TGmU3vGHxkxJCsAUKPL_gUtbBsfePVHmcjjXtvjzMzcdHwo2M2MNka3zkF_r65flGkQbnLJ_AQDyp5vJTrZ/s1600/ByC-hmfIgAA2ru3.jpg" height="400" width="361" /></a></div>
<br />
At <a href="http://www.muse.it/">Trento side</a> there was a dildo-shaped lamp (yes, a dildo),
changing colors according to the data received from the glove by selectively turning RGB LEDs, using
force, acceleration, arousal and muscular response data... well, you know, leave it to the Italians to
sex-it up a Hackaton :)<br />
<br />
One of the main challenge of the event was actually to set up everything from each side while talking to each group, unfortunately the co-location resources went bad and we ended up talking over Skype, and emulating both input and outputs isolated, but at the end we were glad it worked out.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMiV0n-18rC4gfxROnofd8PsIDBjv9YwriwFC0YRneHg8N10KSGOB1wJcFmnxZ-I7cnpQxdTaeMwubpCGrr15jVp7-eiuEepwwv3pEjpeTh6zSMT7h14jm-nGI6CmV_bGZTqsELLXWz1ag/s1600/l%C3%B1%C3%B1sdlkksd.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMiV0n-18rC4gfxROnofd8PsIDBjv9YwriwFC0YRneHg8N10KSGOB1wJcFmnxZ-I7cnpQxdTaeMwubpCGrr15jVp7-eiuEepwwv3pEjpeTh6zSMT7h14jm-nGI6CmV_bGZTqsELLXWz1ag/s1600/l%C3%B1%C3%B1sdlkksd.PNG" height="292" width="400" /></a></div>
<br />
<br />
The official name of the project was "The LoveTotem", to be honest the <i>horny lamp</i> would be a better name, but regardeless the name of the actual use case, what was interesting about the project, and the event, was to put a bunch of people together, with the right tools and attitude, and create something, whatever, as long as it works, you cannot save the world with a killer app in 4 hours, but building "anything" is the first step to get more stuff rolling... who knows? everything can be reused and interpreted in many different ways, with a different angle this would also make a good physical rehabilitation tool, a social game to take introverts into social engaging with physycal interaction with others, nnevertheless, I loved the lamp challenge... it was so out of my field that it was cool to try to design a matching application to feed love to the Totem.<br />
<br />
This was the official description of the project:<br />
<blockquote class="tr_bq">
<i>"LoveTotem": Suppose you are too far from your sweetheart and you want to know how really he/she feels, or share emotions without talk! Your partner can wear the LoveSensors: when you'll turn on your LoveTotem, you'll see it take strong/hot color if your partner is excited, or soft blue light if is relaxed. Love Totem uses an open hardware platform (Arduno Yun) and human sensors like (Muscle sensor,Temperature/Humidity, GSR) in order to track the state of a person and transmits these data through dedicated API to a cloud platform (GlueThings). On the other side, another Love Totem will retrieve these data, representing them with a mix of some colored leds. Leds are placed in a lamp, which we have designed and made using a laser cutter and a 3d printer.</i></blockquote>
At the end our team was one of the two winning teams of the event, with a caveat: the team members posted at <a href="http://www.specifi.eu/news/successful-iotogether-remote-co-working-hackathon-coordinated-create-net">SPECIFI</a> site is wrong, Barcelona's team members are swapped with other team (Aitor is actually a colleague of work, but at a different group), the correct line-up is the following: <b>Andrés Hernández Casaus, Hector Esteller, Pablo Carbajal and yours truly</b>.<br />
<br />
We got plenty of goodies, including <a href="https://www.spark.io/">Spark Cores</a> for each of the members, sensors (I got a soil moisture sensor, the GSR and a couple of buzzers), along with a <a href="http://docs.spark.io/shields/">Shield-Shield</a>.<br />
<br />
Here is the full list of the developed projects:<br />
<ol>
<li>"SeeTy": a urban garden community that merges gardens around the world.</li>
<li>"LoveTotem": a lamp to express remote feelings for lovers.</li>
<li>"WineCheck": check wine bottles temperatures on your smartphone.</li>
<li>"Remote Interactive House Control": remote management of houses temperature & humidity.</li>
<li>"EmotionalBag": a bag monitoring and displaying its user's emotional status.</li>
<li>"SmartGlove": a glove that senses the heart beat and the level of stress.</li>
<li>"BluePresence": a smartwatch managing smartlights with power consumption profiling.</li>
<li>"CarFinder": cars tracking on the web with GPS sensor.</li>
</ol>
If you ever stumble upon a Hackaton organized by the same people behind IoTogether, be sure to attend, besides the good folks assisting the event, and the electronic goodies, the food was sincerely amazing, no cold pizzas and warm beers, a full-catered event with food coming and going at the pace of cold beer and hot coffee, just what a maker needs.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-59111271634020680042014-11-29T17:21:00.001-08:002014-11-29T17:21:24.360-08:00Clean-up unused Linux Kernels in UbuntuOriginal article by <a href="http://markmcb.com/2013/02/04/cleanup-unused-linux-kernels-in-ubuntu/">Mark McBride</a><br />
<br />
At development I tend to keep more than one Virtual Machine sandboxes, normally Unix-based running on a Windows host (because of reasons), so from time to time I have to clean-up the garbage and maintain the user-disk cuota as low as possible to avoid eating up the VM drive.<br />
<br />
The original author makes a pretty good explaination on the command sintaxis (basically list the kernels and strip-down recursively to usable name strings to uninstall them), so I'm just going to copy here the actual command:<br />
<pre class="prettyprint lang-bash">
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge
</pre>
<br />
Only one caveat: I removed the <i>-y</i> argument from the <i>apt-get purge</i> command to avoid eliminating automatically, instead you will get prompted to purge the listed kernels. To check the used disk space:<br />
<br />
<pre class="prettyprint lang-bash">$ du -h /boot --max-depth=0
</pre>
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-35421204222878864832014-11-29T16:44:00.001-08:002014-11-29T16:44:29.466-08:00Network Printer with CUPS in a Raspberry PiShort story: I was tired of having to skpe or mail files to the secretary for her to print it in my behalf, and working in a highly tech-oriented company, it was embarrasing, so the Raspberry Pi came to the rescue once again...<br />
<br />
Sources:<br />
<br />
<a href="http://www.bartbania.com/linux-2/cups-raspberry-printer/" target="_blank">Bartbania</a><br />
<a href="http://www.libregeek.org/2013/12/01/how-to-using-your-raspberry-pi-as-a-cups-print-server/">Libre Geek</a><br />
<br />
Install CUPS:<br />
<br />
<pre class="prettyprint lang-bash">sudo apt-get install avahi-daemon cups cups-pdf python-cups</pre>
Once installed (it will take a while) add our user to the lpadmin group, in this case I'm assuming the default user "pi".<br />
<br />
<pre class="prettyprint lang-bash">sudo usermod -a -G lpadmin pi
</pre>
<br />
Install Samba and dependencies to make the Printer accessible over the network:<br />
<br />
<pre class="prettyprint lang-bash">sudo apt-get install samba libncurses5-dev bridge-utils
</pre>
<br />
Then edit the configuration file to enable network printing and sharing the printer, below are the most interesting lines in my configuration file:<br />
<br />
<pre class="prettyprint lang-bash">pi@raspberrypi ~ $ sudo cat /etc/cups/cupsd.conf
# Allow remote access
Port 631
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols CUPS dnssd
BrowseAddress 192.168.1.255
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
WebInterface Yes
ServerName 192.168.1.28
<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.1.*
</Location>
<Location /admin>
Order allow,deny
Allow @Local
</Location>
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @Local
</Location>
</pre>
<br />
Then either reboot the Raspberry Pi or restart CUPS:<br />
<br />
<pre class="prettyprint lang-bash">sudo service cups restart
</pre>
<br />
And that should be all, next we need to add the printer connected to the Raspberry Pi over the USB port, the process should be straight-forward. The CUPS driver provides a webserver accessible over the socket specified by the RPi's IP and Port assigned in the cupsd.conf file.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHNEOWmeiRsTUiQFOF2B9CElzWFpTAaQ6Q3cHDwJ3nG0pVz_h-ohgxZmUWijNflyqsWc-O4mn2XkJ8cQ69UYgwQizhzs1MpS5GwozTodk7TjwucUGqILIDmD54xkItuMuI3-f2B1a1L6mk/s1600/blog+-+rpi+cups.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHNEOWmeiRsTUiQFOF2B9CElzWFpTAaQ6Q3cHDwJ3nG0pVz_h-ohgxZmUWijNflyqsWc-O4mn2XkJ8cQ69UYgwQizhzs1MpS5GwozTodk7TjwucUGqILIDmD54xkItuMuI3-f2B1a1L6mk/s1600/blog+-+rpi+cups.PNG" height="143" width="400" /></a></div>
<br />Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-50688416994186714172014-11-29T14:14:00.001-08:002014-11-29T15:15:59.656-08:00Install Java JDK in UbuntuI recently had to install Java to be able to run <a href="http://www.contiki-os.org/start.html#start-cooja" target="_blank">Cooja</a> properly, as surely I'm going to need this at any given moment when reinstalling, testing elsewhere, etc, I'm keeping the instructions here.<br />
<br />
<i>Taken from <a href="http://www.ubuntu-guia.com/2012/04/instalar-oracle-java-7-en-ubuntu-1204.html" target="_blank">Ubuntu Guia</a>.</i><br />
<br />
Install Java Oracle version 8:<br />
<br />
<pre class="prettyprint lang-bash">sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
</pre>
<br />
Check the current version<br />
<br />
<pre class="prettyprint lang-bash">$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) Server VM (build 25.25-b02, mixed mode)
</pre>
<br />
You can select between any installed Java version at any given time<br />
<br />
<pre class="prettyprint lang-bash">$ sudo /usr/sbin/update-alternatives --config java
<span style="font-size: x-small;">
There are 4 choices for the alternative java</span>
<span style="font-size: x-small;"> Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1063 auto mode
1 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 manual mode
* 2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1063 manual mode
3 /usr/lib/jvm/jdk1.8.0/bin/java 1 manual mode
4 /usr/lib/jvm/jre1.7.0/jre1.7.0_51/bin/java 0 manual mode
Press enter to keep the current choice[*], or type selection number:</span></pre>
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-21247543055473480292014-11-29T12:38:00.001-08:002014-11-30T04:34:37.660-08:00Senzations 2014 IoT school and City Karma<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</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/AVvXsEg68fvTcOho7B8qS6vIOsglcw0_PRT3Wg5ua1lppVlOMo9RQMbCGshisd4WoNP5Q2PvcMM2kJEkfo8Piai14BtiGFwyBmIEZFgnjeNPJBgDhDtYOCmeX73ids2IHg18iJJS-GUa6CoBrjwQ/s1600/cover.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg68fvTcOho7B8qS6vIOsglcw0_PRT3Wg5ua1lppVlOMo9RQMbCGshisd4WoNP5Q2PvcMM2kJEkfo8Piai14BtiGFwyBmIEZFgnjeNPJBgDhDtYOCmeX73ids2IHg18iJJS-GUa6CoBrjwQ/s1600/cover.jpg" height="121" width="400" /></a></div>
<br />
I recently was lucky enough to attend Technical track of Senzations 2014 Summer School hosted in <a href="http://www.biogradnamoru.hr/" target="_blank">Biograd na Moru, Croatia</a>. It was an incredible experience traveling to Croatia, without taking merits to the event itself, one of the things I enjoyed the most was the City experience, and of course the Boat trip to the <a href="http://en.wikipedia.org/wiki/Kornati" target="_blank">National Park Kornati</a>. <br />
<br />
The lecturers were great and gave plenty of insights on both Wireless Sensor Networks, M2M and IoT,and shared their current work on the field, most of the slides are available at the <a href="http://senzations.net/program/" target="_blank">Program website</a>, but I though about sharing some of the presentation links below:<br />
<br />
<ul>
<li><a href="http://senzations.net/wp-content/uploads/2014/09/Senzations2014_Doukas_course1.pdf" target="_blank">Building Internet of Things applications with COMPOSE and JavaScript - Charalampos Doukas from CREATE-NET</a></li>
<li><a href="http://senzations.net/wp-content/uploads/2014/09/Slides-Senzation2014-CongducPham.pdf" target="_blank">EAR-IT, Acoustic Sensing in Smart Environment: a case for audio streaming with low-resource IoT devices - Congduc Pham, LIUPPA lab</a></li>
<li><a href="http://senzations.net/wp-content/uploads/2014/09/Brandt-Hunting-investors-key-issues-for-funding-start-ups.pdf" target="_blank">Hunting investors - Richard Brandt, Lacocca Institute</a></li>
<li><a href="http://senzations.net/wp-content/uploads/2014/08/SenZations_Semantic_PB.pdf" target="_blank">Semantic Technologies for the Internet of Things - Payam Barnaghi, University of Surrey</a></li>
<li><a href="http://senzations.net/wp-content/uploads/2014/11/Senzations2014Arvind.pdf" target="_blank">Experiences in ‘Crowd Sensing’ for environmental monitoring - D K Arvind, Univ. of Edinburgh</a></li>
<li><a href="http://senzations.net/wp-content/uploads/2014/66/Senzations-14-Galileo-IoT.pdf" target="_blank">Tutorial Galileo and IoT - Alex Gluhak, Intel Labs, and Michele Nati, University of Surrey</a> </li>
</ul>
<br />
As Intel was supporting the event, there were plenty of <a href="https://communities.intel.com/community/makers/galileo" target="_blank">Intel Galileo</a> development kits to use to prototype our very own IoT-driven applications, the core of the event: divide into teams and create an IoT application from the prototype to the business plan. Here's mine with plenty of <a href="http://www.seeedstudio.com/depot/Grove-Starter-Kit-p-709.html" target="_blank">Grove sensors from SeeedStudio</a> attached in the prototype phase.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfd2I7vJDX7Mfnvu-LiC2MxY4jqqnxWKcArvzvsJSUK4FvI3Hia2pWrJlbsRqJDUnaxcS8_eW-hJHN5AJ89EN3T2nv6WG51WjNRl1ZaEJcdef-hJ_tgoPMIiwwGiiQH1kNLRuFxLcsfDAA/s1600/CAM00605.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfd2I7vJDX7Mfnvu-LiC2MxY4jqqnxWKcArvzvsJSUK4FvI3Hia2pWrJlbsRqJDUnaxcS8_eW-hJHN5AJ89EN3T2nv6WG51WjNRl1ZaEJcdef-hJ_tgoPMIiwwGiiQH1kNLRuFxLcsfDAA/s1600/CAM00605.jpg" height="237" width="320" /></a></div>
<br />
<br />
Our team, the DreamTeam, scored big time and was one of the winners of the 4-days Hackaton with our project: City Karma, which had its own dorky video as well! The main idea was to target the lack of social awareness in cities, and City Karma was born:<br />
<br />
<i>A big shout to the DreamTeam: Berta Jadro, Adela Sockovic, Bruno Dunaj, Nikola Paic, Ivan Jokic, Stevan Jokic</i> <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/Buy0EH28Nw4?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
The application was implemented using a Python script running in the Galileo Board, monitoring 3 types of events: loud scream for help, emergency button and assistance button, then posting a Twitter message indicating the location of the event, type and date, with a randomly generated Karma Code. A person following the #CityKarma hashtag or the CityKarma twitter account then could see the new event, and could reply the Twitter message to inform the person in distress that help its on its way.<br />
<br />
A mobile application would also allow to flash this alert to the screen, by monitoring the City Karma feed and using the user location to see if the user is nearby.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWLdF6NkRyL_D_maMYQLesp01fVgFX2yHQ8HX_EedpgCDIK5YtJdk_SDEJFD4KdNJHFS_m71zZWETAAYdM_u6_7__DYhALZSamlVRzvD8LxMeggaXCACDAEWb7dB16ZH38KvPp_k9WEa3j/s1600/Capture+5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWLdF6NkRyL_D_maMYQLesp01fVgFX2yHQ8HX_EedpgCDIK5YtJdk_SDEJFD4KdNJHFS_m71zZWETAAYdM_u6_7__DYhALZSamlVRzvD8LxMeggaXCACDAEWb7dB16ZH38KvPp_k9WEa3j/s1600/Capture+5.PNG" height="190" width="400" /></a></div>
<br />
Then the helping hand would get Karma Points, plenty useful to show off and maybe get a free expresso or a discount in affiliated partners, maybe a nice tax reduction? what would it take for you to go out of your way and help a stranger? Could you ignore a person nearby you asking for help? Let's hope the people frequenting this blog are natural Karma sponges, if not remember this:<br />
<blockquote class="tr_bq">
<i>When you carry out acts of kindness you get a wonderful feeling inside. It is as though something inside your body responds and says, yes, this is how I ought to feel</i>. - Harold Kushner</blockquote>
The application was powered by <a href="http://mqtt.org/" target="_blank">MQTT </a>over WiFI/GPRS, using a local <a href="http://nodered.org/" target="_blank">Node-RED</a> server to receive the help message, parse and post it to Twitter, and also to track the Twitter feed for responses, posting an update on the MQTT topic to notify the person in distress that his help request has been answered, by means of a LED notification.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw_eMx9ZngByVSg8eZv6nQZ0p5OgGGHZqSy0lD6dEKUDg6aaplGtlO5rT8lcXADpnH-QIMyLtf9NWO5l-xeDhQUkMdE69RPbLafaBLuVAJjkFFTMycJyervHb-XVSqgmYhbrvVWuHbRYbZ/s1600/Capture+2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw_eMx9ZngByVSg8eZv6nQZ0p5OgGGHZqSy0lD6dEKUDg6aaplGtlO5rT8lcXADpnH-QIMyLtf9NWO5l-xeDhQUkMdE69RPbLafaBLuVAJjkFFTMycJyervHb-XVSqgmYhbrvVWuHbRYbZ/s1600/Capture+2.PNG" height="215" width="400" /></a></div>
<br />
<br />
If you want to take a peep at the code it is uploaded in my <a href="https://github.com/alignan/senzations2014" target="_blank">Github</a>, keep in mind this is not production-ready code and was done only as a proof-of-concept.<br />
<br />
To wrap this up, I'm really looking forward to next year event, I hope I can assist as both a participant or a lecturer, it was an incredible gathering of talent and knowledge, and a fun crowd to hang out. A big thanks to <a href="https://www.linkedin.com/in/srdjankrco" target="_blank">Srdjan Krco</a> (DunavNET) for organizing the event, <a href="http://uk.linkedin.com/in/gluhak" target="_blank">Alex Gluhak</a> (Intel Labs) for rolling out the hackaton and providing the equipment and tech support, and <a href="http://it.linkedin.com/pub/charalampos-doukas/33/119/a77/es" target="_blank">Charalampos Doukas</a>/<a href="http://sk.linkedin.com/pub/jan-pernecky/1b/686/506/es" target="_blank">Jan Pernecky</a> for the memories.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnxwFLnk9Ah9cYdk5H47RSqVGd_M4RJLExCIYb6kY7JK5-1x3hLGY5gWRTQp0Zre49xOh7X1E1uYFeFM3ei08ivM4BuXzLBBvkrhddpTK3dUUFDvgBbxVNxB4W4VJzuR3pEvn4WQdWVnQg/s1600/CAM00580.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnxwFLnk9Ah9cYdk5H47RSqVGd_M4RJLExCIYb6kY7JK5-1x3hLGY5gWRTQp0Zre49xOh7X1E1uYFeFM3ei08ivM4BuXzLBBvkrhddpTK3dUUFDvgBbxVNxB4W4VJzuR3pEvn4WQdWVnQg/s1600/CAM00580.jpg" height="237" width="320" /></a></div>
<br />
The presentation videos are available at <a href="https://www.youtube.com/channel/UCsCRki37r9okVHsYZHbPaXQ" target="_blank">Senzations YouTube channel</a>Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-70750879630271245092014-11-29T10:23:00.000-08:002014-11-29T10:23:12.076-08:00Setting up CSS Uniflash to program the CC2538DK in ContikiWhen I first started trying-out setting <a href="http://www.ti.com/tool/uniflash" target="_blank">Uniflash</a> to work with the <a href="http://www.ti.com/tool/cc2538dk" target="_blank">CC2538DK</a> and <a href="http://www.contiki-os.org/" target="_blank">Contiki</a>, I stumbled upon this warning:<i> </i><br />
<br />
<i>I first tried Uniflash v3.1.0.00026 with no luck, so I downgraded to
version v2.2.00016, you might want to skip the next section as it mostly
describes the pain and futility of my first attempts with the latest
Uniflash version, mostly kept as a warning of the severed-head-on-a-pike
type for others encountering the same errors, and maybe lurking a kind
soul who has fought this monster and prevailed, willing to share the
solution.</i><br />
<br />
At the end the solution was to find the right combinations of magic ingredients:<br />
<br />
The right CCXML recipe:<br />
<br />
<pre class="prettyprint lang-xml"><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="configuration_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Emulator" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Emulator" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Emulator">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="4" id="The JTAG nTRST Boot-Mode"/>
<property Type="choicelist" Value="4" id="The Power-On-Reset Boot-Mode"/>
<property Type="choicelist" Value="2" id="The Converter Usage"/>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="CC2538SF53" href="devices/cc2538sf53.xml" id="CC2538SF53" xml="cc2538sf53.xml" xmlpath="devices"/>
</platform>
</connection>
</configuration>
</configurations>
</pre>
The right <a href="http://processors.wiki.ti.com/index.php/Category:CCS_UniFlash" target="_blank">CSS Uniflash</a> version (mine was 3.1.0.00026).<br />
<br />
And finally the right flashing command:<br />
<br />
<pre class="prettyprint lang-bash">contiki/examples/cc2538dk$ sudo /opt/ti/uniflash.sh -ccxml /opt/ti/CC2538SF53.ccxml -operation Erase -program cc2538-demo.elf</pre>
<br />
Then the magic starts:<br />
<br />
<pre class="prettyprint lang-bash">***** Texas Instruments Universal Flash Programmer *****
<START: 19:19:29 GMT+0100 (CET)>
> Configuring the Flash Programmer with the given configuration ...
> Flash Manager is configured for the following part: CC2538SF53
> Connecting to the target for Flash operations ...
> Connected.
> Performing operation: Erase
> Completed current operation.
> Loading Program: cc2538-demo.elf
> Finish Loading.
> Disconnecting from target.
Cortex_M3_0: GEL Output: CPU Reset.
<END: 19:19:56 GMT+0100 (CET)>
<Operation Time: 19.341s>
<Total Time: 27.662s>
</pre>
<br />
This is not my preferred way to flash the CC2538DK, as now with the <a href="https://github.com/contiki-os/contiki/blob/master/platform/cc2538dk/README.md#build-your-first-examples" target="_blank">bootloader backdoor unlocked </a>it is possible to program the devices over UART using the built-in bootloader <a href="https://github.com/JelmerT/cc2538-bsl" target="_blank">BSL script</a>, but there may be cases in which you accidentaly flash an image with the backdoor unlocked, and need to enable this again.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-37117812947122981112014-11-29T09:20:00.001-08:002014-11-29T09:20:28.970-08:00Create a GIT sandbox server for ad-hoc workSome months ago I was working out of the office at a client's location and I had to move my development environment there, but due to a tight and restrictive IT policy, me a some colleagues were unable to set up our current GIT repository and share our work (the proposed zip-share-meld was not tempting at all...). The easiest solution would be to host the repository on my laptop, but then again, setting up our GIT repo in a Raspberry Pi is more fun, specially when you have a <a href="http://en.wikipedia.org/wiki/Video_projector" target="_blank">video projector</a> available at the office, and a <a href="http://blog.petrockblock.com/retropie/" target="_blank">RetroPie</a> running with 2 extra game controllers.<br />
<br />
Create a fresh bare repository on the server:
<br />
<pre class="prettyprint lang-bsh">git init --bare newrepo.git</pre>
Add it as a remote in our local repo:
<br />
<pre class="prettyprint lang-bsh">git remote add newrepo <code>git://user@server.com/newrepo.git</code></pre>
Push all branches:
<br />
<pre class="prettyprint lang-bsh">git push --all newrepo</pre>
Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0tag:blogger.com,1999:blog-2708725600682581959.post-68754920148075193392014-07-23T13:23:00.000-07:002014-07-24T00:33:46.847-07:00Quick note: Raspberry Pi WiFI client configuration (tested with ralink RT5370)I recently purchased a WiFi dongle as the new addition for my Raspberry Pi, this cheap and amazing piece of work from <a href="http://www.ebay.com/itm/150M-USB-WiFi-Wireless-Adapter-LAN-w-Antenna-Raspberry-Pi-ralink-rt5370Chip-/251538585194?ssPageName=ADME:L:OU:ES:3160" target="_blank">ebay</a> is a 150M USB WiFi Wireless Adapter LAN, with a 2dBi de-attachable Antenna and the well-known ralink rt5370 Chip, for only 3€ (at the purchase time) what else could you ask for?<br />
<br />
<br />
OK, it took a while to arrive to Spain as it was sent from China, but the product was worth the wait!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_0cPpI1HwRkbDDotiweovx18zeS-NdXA2KEvgWfBF0wWRCusKgjHmC8RS29XRFeWhNk5Lhw5UFHPXj5-r_L6FzPJ_2RZezeckSpyhcH4E0yNuUakwAtIoQGn2Sh_VZLEUp95xALFvjHhn/s1600/CAM00415.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_0cPpI1HwRkbDDotiweovx18zeS-NdXA2KEvgWfBF0wWRCusKgjHmC8RS29XRFeWhNk5Lhw5UFHPXj5-r_L6FzPJ_2RZezeckSpyhcH4E0yNuUakwAtIoQGn2Sh_VZLEUp95xALFvjHhn/s1600/CAM00415.jpg" height="320" width="237" /></a></div>
<br />
<br />
Not only worked flawlessly with the Raspberry Pi (mine is mounted on the wall next to my desk, sometimes I put it behind my monitor as the enclosure is VESA-compatible, see <a href="http://techscrapbox.blogspot.com.es/2014/07/a-3d-printed-raspberry-pi-vesa-mount.html" target="_blank">previous post</a>), <strike>but also worked out-of-the-box for my <a href="http://www.lg.com/es/television/lg-47LA640s" target="_blank">LG 47LA640S Smart TV</a>, saving me from having to buy an "official" overpriced WiFI USB dongle (30€, 6 times the value!) or adding yet-another wireless router to connect my TV over ethernet.</strike><br />
<br />
To enable the Raspberry Pi to connect to an AP with a static IP address, just add this to your /etc/network/interface file:<br />
<br />
<pre class="prettyprint lang-bsh">allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.1.232
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameserver 8.8.8.8
wpa-ssid "SSID-example-replace-yours-here"
wpa-psk "replace-your-WPA-password"
</pre>
This will work as long as your AP has WPA/WPA2 security and is not hidden.Antonio Lignanhttp://www.blogger.com/profile/14548531127563342728noreply@blogger.com0