bouni's blog

Sending and Receiving 9-bit Frames with Arduino

| Comments

My MateDealer project was entirely written in C because the Arduino IDE or more detailed the HardwareSerial part lacks the 9-bit support. It is easy to send a 8 bit data frame, but nearly impossible to do that with 9 bit frames. I worked for a while on implementing 9-bit support for the Arduino IDE and recently i finished my work!

locale-gen fails on raspberry Pi

| Comments

I’ve tried to generate the locales on my Raspberry Pi, but i ran into a problem that i was not able to solve for a few hours.

1
2
3
4
5
root@rpi: ~$ locale-gen
Generating locales...
  en_US.UTF-8.../usr/bin/locale-gen: line 41:   303 Killed
localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias
$locale

locale gave me another error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@rpi: ~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=C
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

But finally i found the solution in an inconsiderable forum post. The reason for the locale-gen error is simply not enough RAM!

The solution is easy, just create a swapfile:

1
2
3
4
fallocate -l 512M /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

Then run locale-gen again and it works :–)

Good bye Arduino IDE

| Comments

I’ve worked with the Java based Arduino IDE for a long time now, and always thought that i miss the comfort of vim. But for soom reason i never searched for an alternative, but yesterday i had enough of that shit piece of software!

Ino

So i googled a bit to find an alternative and stumbled upon ino. After a few test i must say that ino is exactly what i was looking for :–) Take a look at the quickstart to see how easy it is.

HTML5 ajax file upload with flask

| Comments

Making web uploads less painfull

For one of my current Flask projects i want to have a nice looking and easy to use file upload form. That means no <input type="file"> form field where i have to select each file and the upload it on at a time. I came across this nice tutorial for a HTML5/jquery file uploader, but the backend is written in PHP. So I decided to try to get this working with Flask and it was easier as I supposed :–)

Comments activated

| Comments

I finally activated the Disqus comment system for my blog. I wanted to do this for a while now but was to lazy to do it :–)