Wednesday, April 15, 2015

SIM-Module. Python library for SIM900 (GSM/GPRS) modules. MIT licensed

sim-module

Python library for SIM900 (GSM/GPRS) modules. MIT licensed



Yahoo! I have published to the github.com my Python library for SIM900 GSM/GPRS modules - sim-module. It's MIT licensed and you can use it freely for commercial and non-commercial use.

You can find it here: https://github.com/JFF-Bohdan/sim-module

It can be used everywhere where you can find Python:
  • PC (Windows, Linux, Mac);
  • ARM computers with Linux: Raspberry Pi for example.

Now it supports HTTP POST and GET requests.

Enjoy!


Saturday, February 21, 2015

Energia library for MSP430 internal temp sensor

Energia library for MSP430 internal temp sensor



I added little library for MSP430 internal temperature sensor usage.This sensor is not very precise but can be used if necessary.

You can access source code and see example file here:
https://github.com/JFF-Bohdan/msp430intertempsensor

Also, you can find post on 43oh:
http://forum.43oh.com/topic/6415-energia-library-for-msp430-internal-temp-sensor/

Notice, that you can use float values for temperature or int16 (also with decimal part of temperature value). When using int16 temperature will be returned in this way:
  • 23.5 C will be returned as 235 (0xEB) integer value;
  • 54.3 C will be returned as 543 (0x21F) integer value
When using float values (on my MSP430G2553) memory usage will be like this:
binary sketch size: 7 625 bytes (of a 16 384 byte maximum)

When using int16 memory usage will be:
binary sketch size: 3 359 bytes (of a 16 384 byte maximum)

Tuesday, February 3, 2015

Cool commands for your Raspberry Pi

Cool commands for your Raspberry Pi


Here some cool commands for your everyday usage of RPi.
# Check CPU temperature
/opt/vc/bin/vcgencmd measure_temp

# Check RAM
free -m

# Check RAM every 3 seconds
free -m -s 3

# Check CPU load
top

# Check system information
uname -a

# Check any failed login
sudo lastb

# Check uptime
uptime

Enjoy!

Monday, February 2, 2015

Problem with I2C on Raspberry Pi after Raspbian update

Problem with I2C on Raspberry Pi after Raspbian update 

 Problem

My DS3231 does not work on Raspberry Pi after update for Linux 3.18.5+ :(

Solution

The latest firmware implements device tree support. That will have broken things like I2C, SPI, and 1-wire bus.

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!

Sunday, November 24, 2013

CGI Python: serving binary file from web server to client

CGI Python: serving binary file from web server to client

1. Problem.

I want to send binary data (image or packed zip file) to the client from our CGI Python script. If you will work under *nix system it will not be complicated.

Wednesday, November 13, 2013

Qt 5.1 zlib compression compatible with Python zlib.decompress. Uploading files to the server.

Qt 5.1 zlib compression compatible with Python zlib.decompress. Uploading files to the server.


Task

I want transfer file from Qt 5.1 application to the server. File must be packed before transmission (in Qt application), then must be unpacked in server's (in Python script). We will use zlib compression in both sides.

Sunday, November 3, 2013

Перцы

Мои перцы

1. История


Кто-то знает, а для кого-то это будет новостью, но я люблю острые блюда и мне нравится выращивать перец. Многие из вас замечали, что некоторые перцы кажутся острее чем другие, но как это измерить? Оказывается есть такая замечательная штука как Scoville scale (аналогичную статью можно найти в Википедии под названием острый вкус). Проанализировав предлагаемую информацию мы можем увидеть, что острота перцев может отличаться в десятки раз. Когда я был маленьким, меня пугали что есть де такой перец как кайенский и что он такой острый, что уж дальше некуда. Как оказалось, всё же бывает и поострее... :)

Если кому интересно - добро пожаловать под кат.