## Ilyass's books

Ilyass's favorite books »

Last September, the jessie update for the Raspbian OS got out. It included a few updates that changes the way you have to set up your network. A clear method to setup a Raspberry Pi with a static IP on wifi is given here. The goal is to have a headless Raspberry Pi that automatically connects to one or several known WiFi networks.

In the previous version, most of the changes to the network configuration had to be done in the interfaces file, you can check its content:

pi@raspberrypi:~ $cd /etc/network pi@raspberrypi:~$ cat interfaces


Which shows you the content:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


You do not need to modify this file anymore. In order to get Wifi on your Raspberry Pi, you need a wireless USB adapter. Once you have one, just plug it and reboot your RPi. (I use this one)

You still need to provide the system with the SSID of your network and the password. You can do that here:

pi@raspberrypi:~ $cd /etc/wpa_supplicant pi@raspberrypi:~$ sudo nano wpa_supplicant.conf


You need to add the following lines:

network={
ssid="ESSID"
key_mgmt=WPA-PSK
}


The real novelty is the use of dhcpcd to manage static connection. To set up a static IP for your Raspberry Pi, you need to modify the following file:

pi@raspberrypi:~ $sudo nano /etc/dhcpcd.conf  Add the following lines, after adapting them to your network: interface wlan0 static ip_address=192.168.0.XXX static routers=192.168.0.1 static domain_name_servers=192.168.0.1  If you do not have the information about your network, you can always check an already connected device’s settings (smartphone or laptop). You can now reboot your Raspberry Pi. It should automatically connect to the configured network, and reconnect (as soons as it is available again) if the connection is lost for any reason. The next thing you should do is enable the SSH server in the Advanced settings of sudo raspi-config and you’re good to go ! If you liked this post, you can share it with your followers or follow me on Twitter! A small dogbone specimen containing one unique fiber is prepared in such a way that its surface provides a good enough level of grey in order to do Digital Image Correlation without the need of an additional speckle pattern. The purpose of the experiment is to evaluate the deformation field and observed damage mechanisms around the fiber ($$100 \mu m$$ diameter) while the specimen is experiencing quasi-static tensile load. The specimen is loaded in a microtraction machine adapted to perform the test under the microscope’s lens. The test is stopped 8 times in order to take pictures using the amazing Olympus OLS4100 laser confocal microscope, it provides us with height information for each pixel and sweeps through a range of the z-height to provide a crisp clear definition at every corner of the picture.  First image Final image On the first image, it is possible to distinguish the fiber but quite hard. We used the laser instead of white light to maximize pixels’ intensity. The white areas are actually reflecting the laser and will make the image correlation analysis impossible around those defects (glue? contamination? the specimen was cleaned though. EDIT: those are actually bubbles, voids, in the epoxy that are partially revealed by the polishing.). On the final image, it is clearly possible to see that the fiber completely detached from the matrix. The material also seems to have shifted along the $$45^o$$ line passing through the fiber. The white areas’ shapes and colors also changed erathically, which is why they cannot be considered in the region of interest during the analysis. These experiments were possible with the help of Damien Texier and were done at École de Technologie Supérieur, Montréal. If you liked this post, you can share it with your followers or follow me on Twitter! At the USNCCM13, we discussed the fact that (currently) Peridigm only accepts Exodus II mesh files. The only software that generates Exodus II mesh files is the powerful Cubeit. Cubeit’s license can also be expensive, especially for someone who only wants to use the conversion to Exodus II feature to import geometries in PeridigmPatrick discussed the possibility of writing our own conversion script that converts a widely used free meshing format to Exodus II. We eventually decided to use Gmsh as an input for our script, which then converts Gmsh meshes to Exodus II. The code is available here, everything is written in python so the only requirement is VTK >=5.8 with the python wrapper (sudo apt-get install python-vtk). We currently support triangles and quadrangles for 2D elements and tetrahedrons for 3D elements. ## Examples #### 2D  Mesh generated with gmsh Exodus geometry visualized with paraview #### 3D  Mesh generated with gmsh Exodus geometry visualized with paraview ## Get started It was great working with Patrick on this project, I learned a lot about meshes and VTK. #notscaredofmeshesanymore If you liked this post, you can share it with your followers or follow me on Twitter! A 3D-printed mold was designed to hold 6 steel fibers (basically steel wire of 900$$\mu m$$ arranged in two parallel lines of 3 fibers. The drawings show the side and front view of the mold, the red line represents one unique fiber. It is attached to the bottom of the mold using hooks that are directly 3D-printed in the mold. Epoxy is then poured in the mold and cures around the fibers. The mold is then horizontally cut (following the scissor lines on the drawing) to provide several dogbone specimen, containing transversally embedded steel fibers. Click on the picture and move your mouse around to change the focus point and perspective. One of the specimens was polished, then covered with light polarizing film on the front and back to reveal the photoelastic properties of Epoxy. If you ever need polarizing film, you can either buy some but it is quite hard to find large sheets. You can also get high quality filters by taking an old LCD computer monitor apart (that is what I did here), it is an easy operation that still needs you to be slightly careful (a tutorial to do so). Other surfaces were covered with black ink (Sharpy) to avoid non-polarized light diminushing the contrast of polarized light. It is then possible to qualitatively see the residual stresses in the specimen due to cooling after curing and the mismatch of coefficient of thermal expansion between the fibers and the matrix. The density of fringes (isolines of same colours) qualitatively shows the stress concentration. The more colours there are in an area, the higher the stress concentration is. It is possible to distinguish the residual stresses due to the interaction with the mold and the residual stress around each fiber. If you liked this post, you can share it with your followers or follow me on Twitter! A transparent photoelastic polymer containing a single hole of $$500\mu m$$ is loaded under tensile stress. The same experiment is done again using Digital Image Correlation (DIC) as an analysis method this time. The contour plot shown in the DIC experiment are percentiles of $$\epsilon_1$$ - $$\epsilon_2$$, where $$\epsilon_{1}$$ is the deformation in the first principal direction and $$\epsilon_2$$ the deformation in the second principal direction. The number of photoelastic fringes passing through a material point on the specimen’s surface is also proportional to $$\epsilon_1- \epsilon_2$$, allowing a qualitative comparison of both methods by looking at: • The fringes concentration • The number of fringes passing through a single material point and their direciton This video compares both methods. Both specimens’ dimensions were chosen according to the ASTM D632 Type V. Test speed: $$0.1mm/min$$ It is possible to see that the photoelastic specimen firstly reveals large fringes going through the whole specimen from left to right, that is probably because the specimen is experimenting torsion, due to the fact it was not perfectly straight between the grips. Once the whole specimen emits an almost uniform color (second 40), 6 petal fringes (circular) are cricling the hole. Experiments done in collaboration with Rolland Delorme, at Ecole Polytechnique Montreal during November 2015. If you liked this post, you can share it with your followers or follow me on Twitter! When capturing images from a lab camera, you might find yourself with a bunch of .tiff images. The first thing you will need is the ImageMagick package for Ubuntu. You can get it using: sudo apt-get install imagemagick  This package contains a very convenient convert function, it can be used to convert a .tiff image into a .png while keeping transparency using: convert inputfile.tiff -transparent white outputfile.png  You can then use this command to recursively treat any file in the folder with a simple grep and some batch scripting:  #!/bin/sh for file in ls | grep tif do convert "$file" -transparent white "${file}.png" echo "writing${file}.png"
done


To use it, you simply need to put a bunch of .tiff files in the same folder, and execute the script. If your files are recorded as .tif and not .tiff, you will need to change it in the second line of the script.

Final tip: If any other file in the folder (it can be the script itself) contains the letters T-I-F-F in this order, it will be transformed into a .png even if it is a text file.

Source, more details: http://ospublish.constantvzw.org/blog/tools/convert-tiff-to-transparent-png

If you liked this post, you can share it with your followers or follow me on Twitter!