Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



36 Commits

Repository files navigation


Twooris is a simple python script for the raspberry pi plattform to post the attraktors door open or closed status on twitter.


You need a raspberry pi board, two gpio's and some software packages explained in the following.

Debian or Ubuntu

sudo aptitude update
sudo aptitude install git-core python-simplejson python-httplib2 python-oauth2

CentOS or RedHat

sudo rpm -Uvh
sudo yum install git python-simplejson python-httplib2 python-oauth2

Install the python-twitter library

tar xzf python-twitter-0.8.2.tar.gz
cd python-twitter-0.8.2
python build
sudo python install

Create Group and User

sudo groupadd twooris
sudo useradd -s /bin/bash -r -m -G sudo,twooris twooris

twitter registration

Register your new read- and writable application at twitter and keep the tokens for the configuration.


cd /opt
sudo git clone
sudo chown -R twooris:twooris /opt/twooris


Now switch the user context and change to the application directory.

sudo su - twooris
cd /opt/twooris

Now create the config file, change the twitter tokens you just created, maybe your gpios and the text messeges.

IMPORTANT: Please note that i used the BCM pin layout for the gpio numbers. For more Informations please read .

cat > twooris.cfg << 'EOF'
led                 = 18
switch              = 25

consumer_key        = A1r2xxgbObRUd5eEFi5TXp4e
consumer_secret     = sqK5wwXkBKAlLBuP93fu6rDuv6Dt3NtpZWhTUFzU89kxVyMAUp3as9zRjDYCNrok
access_token_key    = 3nAuU+NvoF3ymMjSaPLgQzQMQbiGRfK39L1wHA1DhjYbMDTx
access_token_secret = GXFKePckfUvagiAfNxu2cqAjT+ZCFSm6dNh7gXtKkQFbW8M4K7ZBtPbG6duFDG6m

open                = Die Eingangstür wurde geöffnet.
closed              = Die Eingangstür wurde geschlossen.

Please change permissions of the config file to prevent unauthorized access.

chmod 0600 twooris.cfg


You can start the script or add it to a users crontab like the following:

crontab -e
*/5 * * * * sudo /opt/twooris/

IMPORTANT: Please note that the script needs root permissions to access '/dev/mem' to manage the raspberry pi gpios.

ToDos and Issues

Have a lock at the github issues section. There's still some work to do, patches are welcome.

License and Author

Author: Sebastian Wendel, ( Copyright: 2012, Attraktor e.V. Hamburg

Licensed under the GNU GENERAL PUBLIC LICENSE (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Tracking Pixel


Twooris is a simple python script for the raspberry pi plattform to post the attraktors door open or closed status on twitter.






No releases published


No packages published