OLED display to Raspberry Pi

Today I played with an OLED Display. I bought it from Amazon for $14 which is 0.96 Inch I2C and SPI Serial 128 x 64. It needs only 4 wires to connect to Raspberry Pi. This display is a monochrome (blue) – hence the price.

 i2cdetect -y 1

Showed the display detected on the I2C bus

Couple of lines of code from GitHUB – show IP address and the time. Graphics also can be drawn – lines, circles, rectangles, ellipses etc. even displaying .png files.


#!/usr/bin/env python # # !!! Needs psutil (+ dependencies) installing: # $ sudo apt-get install python-dev # $ sudo pip install psutil # import os import sys if os.name != 'posix': sys.exit('platform not supported') import psutil from datetime import datetime from oled.device import ssd1306, sh1106 from oled.render import canvas from PIL import ImageDraw, ImageFont f = os.popen('/sbin/ifconfig wlan0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1') your_ip=f.read() from time import gmtime,localtime, strftime t = strftime("%Y-%m-%d %H:%M:%S", localtime()) def stats(oled): font = ImageFont.load_default() font3 = ImageFont.truetype('/root/oled/fonts/C&C Red Alert [INET].ttf', 18) font4 = ImageFont.truetype('/root/oled/fonts/C&C Red Alert [INET].ttf', 22) with canvas(oled) as draw: draw.text((0, 26), your_ip, font=font4, fill=255) draw.text((0, 48), t, font=font3, fill=255) def main(): oled = ssd1306(port=1, address=0x3C) stats(oled) if __name__ == "__main__": main() read more

Добавих твърдотелен диск към уеб сървъра

Купих си един твърдотелен диск (Solid State Disk SSD) ADATA 120GB за $45 и го добавих към сървъра с надеждата да се подобри производителността.

Кореновата файлова система я оставих на оригиналната SD карта,просто преместих /var директорията и swap файла върху новият диск. Да напомня, че MySQL, Apache, логовете и др. са във /var директорията. read more

Added Solid State Disk to the web server

Today I bought a Solid State Disk (SSD) ADATA 120GB for $45 and added it to the server in hope the performance will improve.

Root file system is still on the original SD card, I just moved /var directory and the swap file onto the new disk. Mind you that MySQL server, Apache web server, log files etc. are in /var directory.

First I created partition table and partitions with cfdisk. Next I formatted the partition with EXT4 file system, mounted the partition, added an entry in fstab.

Next I switched Linux to single user mode – server was connected to HDMI cable to the TV and USB keyboard (this can’t be done via ssh). Then I moved var folder onto the new partition and created symlink to the original place var should be. Rebooted and everything was back to normal. read more

Всеки българин ще получи от държавата електронна поща.

” … Всеки българин ще получи от държавата електронна поща. Това е предвидено в проекта за развитие на електронната идентификация, който е един от най-важните за внедряване на е-правителството. Имейлът ще се издава служебно при подновяването на личната карта с такава, в която има електронен идентификатор, предвижда пътната карта на правителството за изпълнение на стратегията за електронно управление..” read more

Time-Lapse Video with Raspberry PI

I created time-lapse video with my Raspberry Pi. I used the Raspberry PI 5MP Camera Board Module (mine is NoIR version without IR filter). OS of choice is Raspbian. To avoid limits with SD card size, I mounted a share on my NFS server and generated the pictures there.
First testing the camera in single shot mode:

raspistill -o testimage.jpg

All was good, Then next step was to get picture every 16 seconds for 3hrs period and auto name them. read more

Парламентът прие електронното гласуване, ами сега…

Със 136 гласа “за”, 56 “против” и без въздържали се, Народното събрание е приело въвеждането на електронно гласуване при всички видове избори.

Сега да видим как ще бъде имплементирано. При съвременното ниво на комуникациите свързаността не е проблем. При нивото на производителност и цени на хардуера, това няма да е проблем. Теоретично обработката на изборните резултати ще е моментална, както и ще има много прецизни справки и разрези. Могат да се проследяват и анализират лесно и бързо логове и журнали. Могат бързо и евтино да се организират избори и референдуми. Но както винаги опираме до организацията и преполагам, че за пореден път това ще е препъни камъка. read more

Windows Nagware Gets Nasty

I have an old laptop running Windows 7. Everything was fine till last week. The moment I run Microsoft updates, CPU utilization jumps to 100% and stays there. Machine is completely unusable. After a while it fills up my hard drive as well.

I scanned for viruses and trojans, but nothing was detected. Only svchost.exe jumps to 100% CPU usage, so that was my first suspicion. Next I cleared Event Viewer as Microsoft suggests in such cases – no luck.

I don’t use this Windows much (the next partition hosts a Linux distribution), so I didn’t alocate too much free space, but so far was ok. Now Microsoft keeps downloading the new Windows 10 without asking for permition, but is stupid enough to check for the free disk space. read more

How I Met Linux

It was 1998, I was working in a large corporation using Novell Netware, mostly DOS, Windows 3.11 for Workgroups, some Windows 95. A co-worker brought in his laptop with nice desktop – turned out was RedHat Linux 5. He showed me our file server mounted nicely as part of the laptop’s file system, transferring files back and forth in couple of terminal windows, was reading a PDF document in another window and desktop was very responsive even while formatting a floppy disk (at that time Windows was unusable during formatting even till Windows XP era). He was checking his email, browsing internet, FTP files from his home computer. He telnet to our Solaris server. read more

50 Things I Can Do With Linux, But Cannot in Windows

I read about lots of complains/ rants that Linux is not good or is not ready for desktop usage. For me it does the job and even beyond. At my work place I work under Windows, at home I am using Linux. On a daily base I see the differences and similarities. Here is my take on this.

1. Install Linux and start using it immediately.

Why: Because almost all “drivers” are in the kernel.

Why not in W.: You always need 3rd party drivers installed to use your PC: chipset, video card, touch-pad, audio controller, CD/DVD drive, Wifi adapter, Ethernet controller. Many times you finish installation and unable to access internet because of missing LAN adapter driver which needs to be downloaded in first place. read more

"Двигателят" на сайта

Инсталирах си този сайт на малко компютърче A20-OLinuXino-LIME (с размер на кредитна карта, също като Raspberry Pi).

Въпросния компютър спечелих като награда за новинарска статия на сайта  “Линукс за българи” И реших да го оползотворя. Хардуера е open source, базиран на A20 ARM dual core Cortex-A7 processor на 1GHz с 512MB RAM. Работи под 32bit Debian Linux 7.9 директно от microSD картата клас 10. read more