A casing 4 M for Rail DIN with OLED display and keyboard


I’ve already introduced equipment designed for the Raspberry Pi by SNOC (national company of connected objects). First a SIGFOX map for the raspberry, then a power supply for DIN rail intended to feed the Raspberry Pi.
This time it’s a housing DIN 4 M equipped a keyboard and an OLED display that caught my attention.



click for information about the levels.




this box 4 M (width equivalent to 4 modules DIN) is designed to accommodate the Raspberry Pi. It has on the base two slots intended to receive map fixing screws (supplied in the kit). There is also a lock for secure fastening on DIN rail. It does not appear on the article photos.


the housing is fitted with a SSD1306 OLED display 0.96-inch (2.4 cm) diagonal. The definition is 128 x 64 pixels of white color. The low definition is offset by the strong contrast of the screen that allows its reading in full sun. The cat that is displayed on the screen of the photo above is one that is to the left of this paragraph, grayscale and full size. The screen is located behind a transparent façade that protects without disturbing my reading.



four push buttons form a keyboard. Control rods protrude from the transparent cover plate and are easy to handle. According to the program, they are used to scroll through a menu, validate, change the type of view etc… In the photo above a menu on the left to view 2 images of cats, the logos of SNOC, Yadom, and Framboise314 (apparent on the screen). The up and down buttons scroll the highlight on the menu items, the right button validates the choice.


you can imagine all the applications of these buttons in your programs…


display the IP address of the Raspberry Pi


display the time


the time and date (in french if you want 🙂)


or… anything else as these various forms, insofar as we’re in the presence of a graphic display… One can imagine curves, bars to display power consumption, an evolution of temperature, level in a tank, pressure or can you imagine 🙂 we can without the display of an instant value to history by pressing a button Choose the display etc.


come on a little demo in pictures…


software


for installation I made a mix between the SNOC doc and of Adafruit .


start by putting the system up-to-date and turn on the bus SPI or in raspi-config If you are on Raspbian Jessie Lite or in graphical mode configuration window.



 sudo apt - get update sudo apt - get install build-essential python-dev python-pip sudo apt - get install python-imaging python-smbus 


you can now download and install the Python library for the SSD1306 and the examples offered by Adafruit management:



 sudo apt - get install git git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git cd Adafruit_Python_SSD1306 sudo python setup.py install 


now you are ready to use examples. Actually not quite as Adafruit examples do not use the same ports, GPIO. You’re going to have to modify them to fit the SNOC map. He will also declare the type of screen used so that the display is correct. There are several screens with different definitions that use the same library.


make you in the samples directory:


 cd Adafruit_Python_SSD1306 cd examples 

Let’s start by changing the program image.py :


you must make some changes to make the program work with the SNOC card that does not use the same ports of the GPIO.


 sudo nano image.py 

find and change the following lines:


 # Raspberry Pi pin configuration: RST = 25 # Note the following are only used with SPI: DC = 24 

must then indicate which screen is used:


comment out the line disp…


 # 128 x 32 display with hardware I2C: # disp = Adafruit_SSD1306.SSD1306_128_32 (rst = RST)... 

and uncomment the one corresponding to the screen 128 × 64


 # 128 x 64 display with hardware SPI: disp = Adafruit_SSD1306.SSD1306_128_64 (rst = RST, dc = DC = SPI spi. SpiDev (SPI_... 

do not leave a space at the beginning of line!


you can now run the program


python image.py



you can do the same manipulation to animate.py and shapes.py



programs SNOC


programs are available on page of the Yadom site with explanations for the implementation.


you can download the file archive by clicking on the link if you are in graphical mode. Unzip the archive to access the demo programs.


If you are in text mode:


[$19459046]pi@raspberrypi:~ mkdir yadom pi@raspberrypi:~ $ cd yadom pi@raspberrypi:~/yadom $ wget https://yadom.fr/downloadable/download/sample/sample_id/159/rpidisp01_exemple_code.zip – 2017-01-13 08:37:44 – https://yadom.fr/downloadable/download/sample/sample_id/159/rpidisp01_exemple_code.zip Resolving yadom.fr (yadom.fr)…] Connecting to yadom.fr (yadom.fr) 37.187.12.110 | 37.187.12.110 |: 443… connected.

HTTP request sent, awaiting response… 200 OK Length: 43666 (43K) [application/zip] Saving to: ‘rpidisp01_exemple_code.zip’ rpidisp01_exemple 100% [===============>] 42.64 K-.-KB/s in 0.1 s 2017-01-13 08:37:45 (349 Kbps) – ‘rpidisp01_exemple_code.zip’ saved [43666/43666]

then unzip archive


[$19459046]pi@raspberrypi:~/yadom unzip rpidisp01_exemple_code.zip Archive: rpidisp01_exemple_code.zip extracting: extracting 1.png: 2.png extracting: extracting 3.png: 4.png extracting: 5.png inflating] : rpilcd2actions.py inflating: rpilcd2menu.py inflating: testio.py inflating: Xerox Serif Narrow.ttf

and you can use the example programs before you change them to suit your needs…


[$19459046]pi@raspberrypi:~/yadom python rpilcd2actions.py

get out with the keys CTRL + C


you will find here images site Yadom and ‘home’ photos.]


images in the site Yadom


the case with in view from below the screen/keyboard, the 10 cm water card and the card to the GPIO with its connector compatible with all generations of Raspberry Pi 26 points. Photo (c) Yadom



a Raspberry Pi mounted on the bottom of the DIN housing with the adapter connected to the GPIO. Need to connect the card in this way on your Raspberry Pi. Be careful not to shift the map! Photo (c) Yadom



images ‘House’


editing of the card on the Raspberry Pi



map link, view from above



the inside of the case. At the bottom of the screen/keyboard card. You can see the cutouts to allow access to the Raspberry Pi catches.



access to the USB and Ethernet connectors poses no problem… It falls in front of the holes! (this is not always the case with boxes). The hole in the lower part is planned for the lock on the DIN rail.



access to the connectors for power supply and audio/video


well: the micro SD card is well protected and does not exceed. Worse: it takes out the micro SD card to open the case and it requires a pincer. The hole to the left of the micro SD is planned for the LED of the Pi 2. The ft3 are… on the other side. All what we see here is the WiFi/Bluetooth antenna



to open the case once you close it and clipped, it starts on the side of micro SD card. Shut down the system, unplug the power supply. Take out the micro SD card: no problem with early versions of Raspberry Pi to Pi 2 which are equipped with a connector Push/push. Press locks the card, press the card is ejected. On the ft3 was a PUSH/PULL connector. Press to insert the card but to shoot it out. Oops there is not much room for fingers ( allow thin pliers ).


once the removed with a thin blade SD micro card unlock the casing side SD (on the other side connectors face and prevent the opening). When this side is switched, continue the opening side USB connectors.


as a gift a help – memory GPIO


on the site it is mentioned that the order is delivered with a GPIO memory aid.


This accessory is added to the command “within the limit of stocks available.


so it is possible that if you read this article in a few months, the reminder is no longer available (this article was published mid-January 2017).


the series of the pins of the connector nearest registration gives you the ‘official’ number of the GPIO ( way BCM ) while the nearest the edge of the map series corresponds to the name of these same pins in WiringPi . Go to further confuse beginners ( well it’s not me who gives these numbers, I don’t! []) ) ‘physical’ PIN number is from 1 ( at the top right of the GPIO on the picture above ) at 40 below on the left.


help memory found in the parcel is delivered on a business card.



a box of good quality if you integrate a Raspberry Pi in a cupboard equipped with DIN rail.


the SNOC is a French startup backed by initiative Anjou, whose products enjoy the label Made In France .


I had no difficulty in implementing this screen/keyboard set, the examples in Python provided by Adafruit and the SNOC facilitate the handling of the environment.


at first, the price may seem a bit high (nearly €44) but if we add the price of the screen, push buttons, case DIN, one quickly realizes that if such a set from zero that was needed would be too expensive, if not more and it would be less aesthetic.


there are two things that bother me a bit:


  • used an additional HAT card if she has GPIO pins to connect the link card.

  • the cut out for the micro SD card which comes in handy with a Raspberry Pi 2 a little complicated life with a Raspberry Pi 3 when you have to remove the card. On the other hand it is an operation that is especially during the development of a project, when the case is not yet closed. It minimizes a bit inconvenient.


No comments:

Powered by Blogger.