Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Tuesday, March 14, 2017

Getting ready for Winter Storm Stella

I've setup a webcam for folks to watch Winter Storm Stella from my house in Merrimack, NH.

Click on the live stream on here: https://www.youtube.com/user/MarcNo

There is a Raspberry Pi 3 with a picamera pointing out my front window. It is running this script:

raspivid -o - -t 0 -fps 30 -b 6000000  | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -
f flv rtmp://a.rtmp.youtube.com/live2/AAAA-BBBB-CCCC-DDDD

Where AAAA-BBBB-CCCC-DDDD is my secret YouTube key.

Essentially raspivid is sending the video to ffmpeg which add a silent audio loop and then forwards the flv stream to YouTube's ingestion server.

The info came primarily from:

Thursday, March 21, 2013

HOWTO get your Raspberry Pi running owncloud, tt-rss and thinkup

Today a case for my Raspberry Pi arrived from Adafruit arrived and it is time for some spring cleaning.

I was running the XBMC distro on the pi, but found it cumbersome to listen to music in the home office that way. So time to start with a fresh Raspbian install.

Here are my notes:


  • Get the current Raspbian release from Raspbian.org and install it on a
    4GB flash disk.

  • Boot the new disk and make the following configurations using
    raspi-config which is run the first time it starts up.

    - Use only 16M for GPU since I'm not running an X desktop
    - set appropriate timezone
    - set appropriate locale
    - expand fs to use entire 4GB disk
    - change pi passwd
    - enable ssh access
    - update
    - reboot

  • Now some miscellaneous setup to make life easier later on. Both tt-rss and thinkup require MySQL, but I'll also want to use it for
    owncloud too. So install MySQL server:

    sudo apt-get install mysql-server

    Avahi (aka bonjour) is a very nice network tool that is a DNS-less way
    to announcing your hostname on the local network. Most (all) linux
    tools support it, but you'll need Apple's Bonjour kit for Windows.
    That means you can just 'ssh raspberrypi.local' or browse to
    http://raspberrypi.local/

    sudo apt-get install avahi-utils

    I like emacs and screen is useful.

    sudo apt-get install emacs23-nox screen

    At this point I stop using the keyboard/monitor connected to the Raspberry Pi and use an ssh session from my laptop to do the rest.


  • First install ownCloud by taking a look here: http://software.opensuse.org/download/package?project=isv:ownCloud:community&package=owncloud. Then connect to your Raspberry Pi:

    ssh pi@raspberrypi.local
    sudo -i


    Now run this script which I slightly modified from their page:

    wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/Release.key
    apt-key add - < Release.key

    echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/ /' >> /etc/apt/sources.list.d/owncloud.list
    apt-get update
    apt-get install owncloud


    At this point you'll have all the required packages are installed. Now point a browser to http://raspberrypi.local/owncloud

    You will need to create an owncloud admin account and will want to then expand the Advanced tab and to use a MySQL server instead of SQLite. Fill in root, mysql root password (I didn't bother to set an mysql admin password, so null in my case). For the database, use owncloud and database host localhost. It may take a couple minutes to be complete, so be patient.


  • Now install tt-rss doing the following steps:

    cd /var/www/

    wget -c https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.4.tar.gz

    And follow the instructions here http://tt-rss.org/redmine/projects/tt-rss/wiki/InstallationNotes which are essentially:

    tar zxvf 1.7.4.tar.gz
    mv Tiny-Tiny-RSS-1.7.4 tt-rss


    chown -R www-data:www-data tt-rss

    You will have to manually create a mysql database and import the schema

    mysql -u root
    mysql> create database ttrss;
    mysql> quit

    Now import the database schema (a fancy way to say the database tables and some initial data)

    cd tt-rss/schema
    mysql -u root ttrss < ttrss_schema_mysql.sql


    And a little editing the configuration file...

    cd /var/www/tt-rss

    cp config.php-dist config.php


    emacs config.php (or use vi, nano, etc)

    I made the following edits:

    define('DB_TYPE', "mysql");
    define('DB_HOST', "localhost");
    define('DB_USER', "root");
    define('DB_NAME', "ttrss");
    define('DB_PASS', "");

    define('SELF_URL_PATH', 'http://raspberrypi.local/tt-rss/');
    define('SINGLE_USER_MODE', true);


    Point a browser to http://raspberrypi.local/tt-rss

    From there login with default login/password of admin/password and you are done.


  • Finally install http://www.thinkupapp.com/docs/install/quickstart.html

    The one package you'll need that isn't already installed at this point is php5-curl.

    apt-get install php5-curl

    Now get the kit. I used wget and the site provided the kit, but with an unusual name.


    cd /var/www
    wget -c http://thinkupapp.com/download/
    mv index.html thinkup-1.3.1.zip
    unzip thinkup-1.3.1
    chown -R www-data:www-data thinkup


    Almost done. Point a browser to http://raspberrypi.local/thinkup and complete the configuration.

    database host: localhost

    database name: thinkup

    user: root

    password: blank, in my case or whatever you set the mysql root password to.

    I (and probably you) don't have a smtp server configured, so in order to activate your account, you'll need to do this: http://www.thinkupapp.com/docs/troubleshoot/common/advanced/directdb.html

    # mysql -u root thinkup

    mysql> select id,full_name,is_activated from tu_owners;
    +----+-------------+--------------+
    | id | full_name | is_activated |
    +----+-------------+--------------+
    | 1 | Marc Nozell | 0 |
    +----+-------------+--------------+
    1 row in set (0.00 sec)

    mysql> update tu_owners set is_activated=1 where id=1;
    mysql> quit

    Done! Now go back to http://raspberrypi.local/thinkup and configure the plugins to your favorite social media sites.

Thursday, January 17, 2013

Installing owncloud on a Raspberry Pi

Spoiler: Just follow the official installation guide and you'll be fine. Although you'll probably want to put owncloud data on external storage. Surprised? It is just another linux server!

Below are the commands I used. Those in bold are where I did something slightly different in order to change the location where files are stored. In my case I have a powered USB disk mounted on /mnt.


$ sudo -i
[sudo] password for marc:
# apt-get install apache2 php5 php5-gd php-xml-parser \
php5-intl php5-sqlite php5-mysql smbclient curl \
libcurl3 php5-curl
...a bunch of packages installed...
# cd /var/www/
# tar jxf ~marc/owncloud-4.5.5.tar.bz2
# chown -R www-data:www-data owncloud/apps
# chown -R www-data:www-data owncloud/config
# mkdir /mnt/owncloud-data
# chown www-data:www-data /mnt/owncloud-data
# ln -s /mnt/owncloud-data/ /var/www/owncloud/data



Then point a browser to http://raspberrypi.local/owncloud and take all the defaults. That is leave the file location as /var/www/owncloud/data

Finally go download the sync clients from http://owncloud.org/sync-clients/ and drag-n-drop files in your ~/owncloud.

For testing I had ~180M of files in my ~/owncloud directory and the apache2 process hammered the RPi cpu for a while for the first sync from my desktop.

Thursday, September 6, 2012

Working powered hub for the Raspberry Pi

A cheap 7 port Staples-branded powered hub gives my RPi problems, but a new 4 port Staples-branded powered hub works just fine.


root@raspberrypi:~# lsusb|grep -i Port
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
root@raspberrypi:~#


Just a random data point for people to find via google ;-)

Monday, June 11, 2012

ThinkUp on Raspberry Pi

Tonight I installed the cool social networking monitoring tool ThikUp on my new Raspberry Pi with the lastest debian code drop.


  1. Downloaded the new (11-Jun-2012) test Debian/Wheezy image as announced on http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8071

  2. Since I'm using a new 4GB MMC card and the image was built for 2GB, ran "sudo rasp_config" to resize the disk and bias memory toward SoC instead of the video card. Rebooted. Realized it didn't reboot, pull power and boot




  3. 3) I run a a local apt-proxy to save bandwidth, so created /etc/apt/apt.conf that contains:

    Acquire::http::Proxy "http://192.168.2.109:3142";




  4. 4) Update the apt-cache:

    sudo apt-get update



  5. Install useful bits:

    sudo apt-get install emacs screen mysql-server php5 php5-curl php5-gd php5-mysql

    This installs ~61M of new packages and pulls in a suitable apache server.


  6. Now time to install thinkup:

    sudo -i
    cd /var/www/
    unzip ~pi/thinkup_1.0.7.zip
    chown -R www-data /var/www/thinkup/data/
    sudo touch /var/www/thinkup/config.inc.php
    sudo chown www-data /var/www/thinkup/config.inc.php




  7. point a browser to http://192.168.2.120/thinkup/install


  8. Since I didn't bother to setup outbound email, need to manually
    update the thinkup table. See
    http://thinkupapp.com/docs/troubleshoot/common/advanced/directdb.html

    mysql -u root -p
    mysql> use thinkup;
    mysql> select id,full_name, is_activated from tu_owners;
    +----+-------------+--------------+
    | id | full_name | is_activated |
    +----+-------------+--------------+
    | 1 | Marc Nozell | 0 |
    +----+-------------+--------------+

    1 row in set (0.00 sec)

    mysql> update tu_owners set is_activated=1 where id=1;
    mysql> commit;
    mysql> exit;




  9. Point a browser to http://192.168.2.120/thinkup and setup
    connections to your favorite social media sites.