Friday 25 March 2016

BlockComPi (A Block of a Computer of a Raspberry Pi phone)

Thought of what to do with your Raspberry Pi? During Mid 2015, I decided to use a Raspberry Pi 2, and mainly some other components to build a Raspberry Pi Phone, mainly because i had an Adafruit FONA 2G that is going to be outdated in 2017. This design is partially based on the PiPhone, because i also conveniently had a PiTFT 2.8 , so I couldn't use this TyPhone Design.

Components needed to build:

  •  Raspberry Pi 2
  •  Raspberry Pi Camera Module
  •  Adafruit PiTFT 2.8 resistive
  •  Adafruit FONA 2G (could use 3G but have to modify the design a bit)
  •  Earphones with Mic
  •  5V boost converter
  •  2000mah or so battery from phone
  •  Buttons,  Female Headers, Diode
  •  Wires and a PCB to connect everything together
  •  White Acrylic Case with PLA filament from 3Doodler to connect the pieces together 
  •  Wooden Back Plate
  •  Black Stylus (Nintendo DS)
  • Buzzer (For Notifications) (connects through expansion port)

Software:

  • Based on Raspbian Jessie
  • Crappily Coded in Python
  • Uses PyGame, with PiTFT Rotated 180
  • garthvh's menu_8button.py is under no license, and has been adapted into PitftGraphicLib.py for easier use with PyGame in my code
  • No Bitmaps or images used
  • Note that virtual keyboard, licensed under the GNU GPL, is included, used, and has not been modified.
  • The Main Menu, Notifcentral.py, has a Notifications  and Service system and an App drawer which layout apps as in App.py
  • Can actually Receive and send Phone Calls and SMS through Notifications and Service System
  • The Apps included are, Phone, Messages (just something that sends Messages), Contacts, Camera, X11 and Tab Mode.
  • The ones coded my me are Phone (just a dialer ), Messages (just something that sends Messages), Contacts (stores contacts in config file
  • The Camera app actually adafruit pi cam software , which is included under BSD license
  • X11 shows the X Server with Matchbox Desktop Environment on PiTFT, while Tab Mode actually shows the full Raspbian Desktop through the main TV Output, HDMI or Composite
What it can do:

  • Modular (Anything Major like the PiTFT, Camera, Pi, FONA etc. can be removed and replaced)(Small components like the buttons can be easily desoldered)
  • Expandable (All unused GPIO can be used through the female header connectors, I2C is also available)(4 Full USB ports)
  • Can be used in other projects (eg. Upcoming Home Automation System)
  • Full power of Command Line and X11 Linux (Programming)
  • Portable use (But battery is not that good and would be best used as a UPS)
  • Can Receive and send Phone Calls and SMS through embedded Earpiece
Why build This: Why not?

Too Lazy to create a setup guide and video.

Code and Pictures here

That's all. Thanks for reading. Have Fun!

Friday 11 December 2015

PiTFT Touchscreen, Pygame, Raspbian Jessie issues

Anybody had problems with Pygame on PiTFT on Raspbian Jessie? No? Well on Raspbian Jessie Pygame apparently works normally, except that the PiTFT touchscreen mouse doesnt work properly on Pygame. If you touch the touchscreen in the same spot a few times, you would find that the cursor just moves around randomly. That may have only been for my code, but apparently others are also having the same problems. Like in https://forums.adafruit.com/viewtopic.php?f=47&t=76169.

How do we fix the problem? If you are a Linux noob like me, I found some commands that will help

Works as of 11/12/2015:

sudo apt-get install libsmpeg0
cd /tmp
wget http://archive.raspbian.org/raspbian/pool/main/libs/libsdl1.2/libsdl1.2debian_1.2.15-5_armhf.deb
sudo dpkg -i libsdl1.2debian_1.2.15-5_armhf.deb
wget http://archive.raspbian.org/raspbian/pool/main/p/pygame/python-pygame_1.9.1release+dfsg-10_armhf.deb
sudo dpkg -i python-pygame_1.9.1release+dfsg-10_armhf.deb

I'm not very sure whether some of these downgrading commands are redundant, so it would be nice if  you can comment if you think so.

Basically, There have been some problems with SDL or Pygame, so I downgraded these packages.

That's all. Thanks for reading.

Saturday 27 June 2015

Rotate Pitft Display without rebooting

PiTFTs are awesome! But, to rotate the display you still need to modify the configuration files and reboot. I searched on the Internet for a while and I could not find a way to rotate the display on the fly without rebooting, until now.

Works as of 25/6/15
Just type these commands to rotate the display:

sudo rmmod  fb_ili9340
sudo rmmod fbtft_device
sudo modprobe fbtft_device name=pitft rotate=90 #replace 90 with the rotation angles 0, 90, 180, 270

To recalibrate the touchscreen according to the rotation, just type this:

 sudo adafruit-pitft-touch-cal -f

 That's all. Thanks for reading.

Tuesday 11 November 2014

How to install xmonad on a Raspberry Pi with Arch Linux ARM (Quickly)


I got a Raspberry Pi and loved it, but i still could not figure out a quick and easy way to properly install Xmonad on Arch Linux ARM, until now. No, this does not require to cross compile xmonad on another computer, installing unneeded software and wasting storage space and time. Unfortunately, I was too lazy to install Xorg in the code below so install it manually yourself first.
So here is how i did it.

Copy the code below into your terminal.

pacman -S gmp libxinerama packer base-devel
packer -S dpkg
wget http://archive.raspbian.org/raspbian/pool/main/x/xmonad/xmonad_0.11-9_armhf.deb
dpkg --force-depends -i xmonad_0.11-9_armhf.deb
rm xmonad_0.11-9_armhf.deb

This should work. That is all. Have Fun.