Wednesday, December 24, 2014

Одиночный поход в Остёр

Одиночный поход в Остёр


Преамбула.

Одним из моих увлечений является каякинг. Когда-то давно я только смотрел на байдарки, на суровых людей, куда-то увлечённо гребущих. На лодки, самых разных форм, размеров и с самым необычным окрасом. В то же самое время, мне всегда нравилась вода и время от времени я арендовал вёсельную лодку на которой катался. Потом мне представился шанс попробовать непосредственно то, что так любопытно смотрелось со стороны - пластиковые каяки. 



Tuesday, December 23, 2014

Installing hardware RTC (DS3231) to Raspberry Pi



Installing hardware RTC (DS3231) to Raspberry Pi

 Problem

As we know, Raspberry Pi does not have RTC. We can use w: ntpd for date and time synchronizing with NTP servers. But what we can do if we do not want to use NTP? What we can do if we want to use our RPi standalone?
Also, Raspbian OS (which based on Debian) uses "fake hwclock" module:

Some machines don't have a working realtime clock (RTC) unit, or no driver for the hardware that does exist. fake-hwclock is a simple set of scripts to save the kernel's current clock periodically (including at shutdown) and restore it at boot so that the system clock keeps at least close to realtime. This will stop some of the problems that may be caused by a system believing it has travelled in time back to 1970, such as needing to perform filesystem checks at every boot.

But we need to have real hwdclock and abilities for standalone work! :) Let's do it!

Solution

Looking for hardware

First, we need find and buy hardware. We can use many solutions (based on DS1307, DS3231, NXP PCF2127AT, NXP PCF2127T, NXP PCF2129AT, NXP PCF2129T) but in this case we will use DS3231.


Then, we need buy this RTC. If we will try to search by "Raspberry Pi RTC module buy" request we will found very expensive solutions - 10-15 USD or more. It's very expensive and we can make bargain deal. What we need to do - look for DIY DS3231 modules. We can use modules for Arduino. They have much lower cost. For example, we can buy DS3231 from aliexpress.com only for 1-2 USD. The main difference - connectors. We must connect all pins from DS3231 to the our Raspberry Pi.

DS3231 DIY module

Thursday, December 11, 2014

9 bit UART (8M1, 8S1 modes) in Linux (hack)

Problem

As we know 9 bit UART (8M1, 8S1) mode in Linux (like in any POSIX systems) is not supported. So we can't communicate with devices which uses 9 bit.

Now we can fix it!