Raspberry Pi – I2C stopped working?

Lately my BMP085 temperature sensor, connected to a Raspberry Pi through the i2c interface stopped working.

Turns out that all I needed to do was apt-get install raspi-config, and use that raspi-config tool to enable i2c.

Great.

Btw, if you have difficulties to keep the i2c device up at reboot, create this file:
/etc/udev/rules.d/99-i2c.rules
Add this line:
SUBSYSTEM==”i2c-dev”, MODE=”0666″

Posted in Uncategorized | Leave a comment

exFAT SD card Linux

apt-get install exfat-fuse exfat-utils

Posted in Uncategorized | Leave a comment

RPi – PiGPIOScope

An oscilloscope for the Pi, to check the states of the GPIO pins.

Install the daemon on the Pi:
http://abyz.co.uk/rpi/pigpio/download.html

wget abyz.co.uk/rpi/pigpio/pigpio.zip
unzip pigpio.zip
cd PIGPIO
make
make install

Install the “viewer”, the scope.. on your computer:
http://abyz.co.uk/rpi/pigpio/piscope.html

wget abyz.co.uk/rpi/pigpio/piscope.tar
tar xvf piscope.tar
cd PISCOPE
make hf
make install

Run the daemon on the Pi
pigpiod

Connect your viewer to the remote Pi:

remote_host ~ $ export PIGPIO_ADDR=PI_IPADDRESS
remote_host ~ $ piscope

Ain’t that GREAT.. 😀

Posted in Uncategorized | Leave a comment

RPi – RGB LED strip WS2812B

I got a 30 RGB Led strip with WS2812B:
http://www.tweaking4all.com/wp-content/uploads/2014/01/WS2812.pdf

Its digital, it operates on 5V.  Each led draws approximately 50 mA at 5 V with red, green, and blue at full brightness
-> 1.5A

5v 2A power supply will do it.

There is an issue, the signal voltage should be same. So either I get a step-up module 3.3->5v, or I run everything at 3.3, which is not recommended, so it should be temporary solution.

According to this:
https://learn.adafruit.com/neopixels-on-raspberry-pi/wiring

I should use 1N4001 diods.. but I’ll be using 1N4148, they should be similar choice

Connecting the data line to GPIO 18

apt-get install build-essential python-dev git scons swig

git clone https://github.com/tdicola/rpi_ws281x.git

cd rpi_ws281x/

# scons
scons: Reading SConscript files …
scons: done reading SConscript files.
scons: Building targets …
CC main.o
CC ws2811.o
AR libws2811.a
RANLIB libws2811.a
LINK test
scons: done building targets.

cd python

python setup.py install

see the examples

 

Posted in Uncategorized | Leave a comment

433MHz radio module with Raspberry

Using these instructions:
http://shop.ninjablocks.com/blogs/how-to/7506204-adding-433-to-your-raspberry-pi

Interesting comment:
I follow this guide and use RPi_utils to receive and send RF code to my RF devices, but it didn’t work.
Then adding this line to the codesend.cpp did the trick:
mySwitch.setPulseLength(207);

For Arduino:
http://www.buildcircuit.com/how-to-use-rf-module-with-arduino/

Works great but is very limited is distance.. I attach a 17cm cable antenna, use condensator to filter noise, but still over 2m is difficult to reach.. dont really know why, but its probably related to power and especially proper antenna. fun to see the signal going through anyway and being able to send numbers from RPi with “sendcode” and receive them with the arduino.

Posted in Uncategorized | Leave a comment

Raspberry Pi – 433MHz radio

This:
http://shop.ninjablocks.com/blogs/how-to/7506204-adding-433-to-your-raspberry-pi

and:
http://www.disk91.com/2013/technology/hardware/raspberry-pi-receive-433mhz-radio-signal/

if the receiver needs 5v, remember the nice 5v->3.3v circuit:
http://www.disk91.com/2013/technology/hardware/oregon-scientific-sensors-with-raspberry-pi/
photo(2)

 

Basically just install wiringPi, then the 433utils:

root@rpi02:~# git clone git://github.com/ninjablocks/433Utils.git
Cloning into ‘433Utils’…
remote: Counting objects: 129, done.
remote: Total 129 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (129/129), 28.02 KiB, done.
Resolving deltas: 100% (55/55), done.
root@rpi02:~# cd 433Utils/RPi_utils
root@rpi02:~/433Utils/RPi_utils# make
g++    -c -o RCSwitch.o RCSwitch.cpp
g++    -c -o send.o send.cpp
g++   RCSwitch.o send.o -o send -lwiringPi
g++    -c -o codesend.o codesend.cpp
g++   RCSwitch.o codesend.o -o codesend -lwiringPi
g++    -c -o RFSniffer.o RFSniffer.cpp
g++   RCSwitch.o RFSniffer.o -o RFSniffer -lwiringPi
root@rpi02:~/433Utils/RPi_utils#

Then transmit something over 433MHz (car key,  electric socket remote control..)

And run the thing:

root@rpi02:~/433Utils/RPi_utils# ./RFSniffer

Try also with the transmitter.

I can see lights blinking, but RFSniffer doesnt show anything.

Trying to see what is happening on the pins at lower level with this:
http://abyz.co.uk/rpi/pigpio/piscope.html

pigpiod should be installed first.

piscope is GREAT!

 

 

Posted in Uncategorized | Leave a comment

Audio – pulseaudio equalizer – Debian

To get a system wide sound equalizer in Debian:

http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/p/pulseaudio-equalizer/

For my system I get this one:
pulseaudio-equalizer_2.7.0.2-3~webupd8~trusty1_all.deb

It will need this package:
# apt-get install ladspa-sdk

Then just manually install the .deb
# dpkg -i pulseaudio-equalizer_2.7.0.2-3~webupd8~trusty1_all.deb

In my menu I can now find: PulseAudio Equalizer

 

Posted in Uncategorized | Leave a comment

Led matrix long display – daisy chain

I want to make a long display with scrolling text, with multiple of these MAX7219 led matrix modules.

I need this:
https://github.com/JonA1961/MAX7219array
->
git clone https://github.com/JonA1961/MAX7219array

test the demo: ImportError: No module named spidev

Ah.
http://www.100randomtasks.com/simple-spi-on-raspberry-pi

Make sure you have python-dev package and do:

mkdir python-spi
cd python-spi
wget https://raw.github.com/doceme/py-spidev/master/setup.py
wget https://raw.github.com/doceme/py-spidev/master/spidev_module.c
sudo python setup.py install

test the demo.

Voilà.

The last connected module on the chain is the first one of the display (most left)

By default the code is set for 8 modules, to change that edit the config in MAX7219array.py
NUM_MATRICES

Note that in the demo code there is also hardcoded stuff assuming 8 matrixes.

Posted in Uncategorized | Leave a comment

OwnCloud 7 – Lazy loading / limit scroll / ajax list…

The real name for this is “Lazy loading”:

In OwnCloud 7 came that new feature. When you browse your files, the full list does not appear immediately, but when you scroll down.

This was implemented in order to make OC faster.

I think that for files listing/management, “lazy loading” is totally insane.

When you upload files in your cloud, you make directories, try to get them organized, but of course you can have directories with tens of files which produce long listings in OC.
I find myself in need of using the browser search often, because some directories have tens of text files, and I name them nicely to be able to find what I need later on.

Isn’t it easy (and fast!) to hit ctrl-f and start typing and f3 till you find the file you are looking for?

However with that lazy loading, one cannot actually be lazy: I first need to scroll down the whole page (hitting multiple ajax loadings) and only then, when the whole list is there, I can use the browser search. When the file is found, I click it, and when I’m done, the madness starts over, I need to do the same thing again if I need to find another file.

A setting “disable lazy scrolling” would have been great. Not to mention it would have been more user caring, because forcing users to switch to a feature by force is.. (grr..) questionable.

OK, lets modify that straight from the source, at least that’s great that we can. Open this file:
owncloud/apps/files/js/filelist.js

On line 53 you find:

pageSize: 20,

Now 20151112, this is on line  79, I do this:

return 2000;// return Math.ceil(this.$container.height() / 50);

Just modify that value to the highest guess you have of the amount of files in one of your directory. As the name says it will set the amount of files listed at once in OC files app.

Hope that helps,
-Alain-

Posted in Uncategorized | Leave a comment

RPi – LED Matrix 8×8

Yeah, that was easy,  I just gather resources here as reference…

Next I want to daisy chain a few of these, and then I’ll get into the real stuff: Getting my 8×8 RGB led array connected and working, this time no ready module.

http://raspi.tv/2013/8-x-8-led-array-driven-by-max7219-on-the-raspberry-pi-via-python
http://www.plingboot.com/2013/01/driving-the-max7219-with-the-raspberry-pi

module includes:
1. 1 PCB boards
2. 5P caliber single row 2
3. 24P IC socket 1
4 line MAX7219 chip 1
5 Electrolytic capacitor 10uF 1
6. 0.1uF ceramic capacitor 1
7. 10K resistance 1
8. 8P hole seat 2 (2.54mm pitch)
9. 3mm 8*8 Yin red dot matrix 1

Connect:
VCC: 5V
GND
DIN: MOSI (GPIO10)
CS: SPI CS0 (GPIO8)
CLK: SPI CLK (GPIO11)

Get Python libs and check out test.py:
git clone https://github.com/rm-hull/max7219.git
cd max7219/
sudo python setup.py install
sudo python examples/test.py

Ref; Ascii table:
http://www.jimprice.com/ascii-0-127.jpg

 

Posted in Uncategorized | Leave a comment