Showing posts with label touchscreen. Show all posts
Showing posts with label touchscreen. Show all posts

Raspberry PI CarPC January 2015 updates

online engineering degree/engineering degree online/online engineering courses/engineering technology online/engineering courses online/engineering technician degree online/online engineering technology/electronic engineering online

Hi,
Here are the updates I have recently worked on:
 - migration to KODI stable 14.0
 - Raspbian OS from 24 december 2013
 - linux kernel 3.18.1 with touchscreen drivers
 - updates to Radio and Navigation addons

You can install the build using the tutorial link on the right side of the blog. Please don't forget about the forum for any comments.

Enjoy the screenshots and Happy new Year!







OpenCarPC

online engineering degree/engineering degree online/online engineering courses/engineering technology online/engineering courses online/engineering technician degree online/online engineering technology/electronic engineering online
Hi!

I have worked on some new features for my CarPC. Here are the changes:
First, some videos:

The latest image can be downloaded from the Downloads link on the right of this blog(username:pi, password:a).
Note!
If you do not have any rotary encoder connected or any buttons with a resistor you need to disable the carpc-controller application. You can do this by editing the file /home/pi/StartCarPC and commenting the line which contains carpc-controller.

Hardware updates:
- added ViewHd HDMI to HDMI+audio board
- added SI4703 FM Radio module
- created an expansion board with fm radio module and three connectors(one for GPS receiver and two for rotary encoders)
- added a very cheap board to mix two output channels(RPI and radio) into a single output(which goes to the amplifier, in my case AUX input of the car player)

Software updates:
- added loading movie(created by Doru Ignat)
- added a python server responsible for controlling the radio module via i2c
- added new XBMC plugin for controlling the FM Radio(including storing up to 5 radio stations in a file)
- improved carpc-controller to support sending multiple commands for a single button press or encoder turn(e.g. turning right one rotary encoder can increase the volume in XBMC and the volume of radio at the same time)
- improved the speed in Navit clicking
- improved the Navit OSD for both day and night setup(Navit switches automatically teh setup based on the time of the system).
- added time synchronization mechanism based on GPS readings(RPI does not have a real time clock)

The expansion board.

RE1 and RE2 are rotary encoders.

The FM Radio driver and Python server.
The FM Radio module is connected using i2c communication interface(GPIO0-SDA and GPIO1-SCL of the PI).
The radio driver is contained in the si4703 python class. The Radio server is implemented in the file radio_server.py(which is automatically started at boot time). This server simply opens a socket and waits for data. After any data is received, a couple of if-else statements different radio functions are called base on the incoming data.
The available commands are:
seek_right - search for a new station in the right of the current frequency
seek_left - search for a new station in the left of the current frequency
tune_xx.x - set the current frequency to xx.x MHz
volume_xx - set the volume of the radio module to xx. xx should be between 0 and 15
toggle_mute - toggle mute
get_frequency - get the current frequency
The server reply with the current frequency for each command.

Simple test.
To understand how this radio server-client works you can make the folowing experiment:
1. Plug the gpio expansion board(or wire the radio module to the PI as in the above schematic)
2. [Server] Connect using one ssh window(I use Putty) to the PI and enter the folowing commands:
cd radio
sudo python radio_server.py
The radio server should initialize the  radio module and start the server.
3. [Client] go to the radio folder and use radio_client.py to send commands o the radio server, like in the folowing picture:
The file radio_client.py simply opens an UDP socket, puts an '_' character between arguments and send the obtained string to the server socket.

The radioFM XBMC plugin.
In order to simplify user interaction I have created a new XBMC plugin(radioFM). Its purpose is to allow interacting with the Radio Server(and with the Radio Module) using the touch screen. In order to be able to use this plugin you need to have the radio_server.py started and the FM module plugged in.
Features:
  • The current frequency is displayed at the top.
  • The left and right arrow buttons are for seeking to the next channel(left or right).
  • The bottom 5 buttons are preset channels(these are kept in a file so they are available after reboot).
  • The Set/Tune Channels button is used for changing the mode in which the bottom buttons are operating. By default they are in the 'Tune' mode, so if you presss them the radio will tune to that frequency. If you press the Set/Tune Channels button once you will enter the Set mode, which will allow you to store the current channel in which preset button you like(or in all of them... if you want) by pressing it once. You will see that the frequency will be changed.
Connecting two audio sources(RPI and Radio) to one amplifier.
In order to correctly hook up two audio sources together(putting them in parallel) for a single output you have to use one schematic from this document. I have used the last schematic. Don't forget to use at least 1% tolerance for the resistors.

The new GPIO controller.
The GPIO controller is now using the official XBMC client code from xbmcclient.h.
Now, you can call a lot more XBMC functions for any button pressed or encoder movement.

TODO List:
- update to the latest Raspberry PI firmware(today it is possible but then Navit won't be visible)
- remove the calibration file for XBMC(/usr/share/eGalax/touchscreen_axes_calib) and use the values from the Debian calibration file(/usr/share/X11/xorg.conf.d/01-input.conf)
- create an XBMC addon to allow calibrating the touch screen for both XBMC and X11 windows and also for calibrating the external encoders and button
- create a configuration page(XBMC addon) for the carpc-controller settings
- create a better audio mixer unit
- create a new page for launching different X11 applications

OpenElec with support for eGalax touch screen

online engineering degree/engineering degree online/online engineering courses/engineering technology online/engineering courses online/engineering technician degree online/online engineering technology/electronic engineering online
Hi!

Lately I have tested OpenElec for Raspberry PI and found out that it is very very fast, very very small and also it has some great addons(wifi, bluetooth and more).
Speed/size features on an 512MB RaspberryPI:
  - a complete boot is less than 25 seconds
  - cpu is around 30% load
  - memory used is 32%
  - total system size is less than 300MB

Edit. You can download my build from here(contains eGalax module and XBMC patches).
Username is root and password is openelec. The touch screen calibration file should be put in /storage/touchscreen_axes_calib.

Next, I will guide you through the instructions for building(cross compile) latest OpenElec  for Raspberry PI with touch screen support.
For this tutorial let's assume that you have a Linux machine where you will work.

1. Get the latest OpenElec.
git clone git://github.com/OpenELEC/OpenELEC.tv.git

2. Add kernel touch screen module support.
Open the file OpenELEC.tv/projects/RPI/linux/linux.arm.conf and search for "CONFIG_INPUT_TOUCHSCREEN". Replace the whole text line with the following lines:
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
3. Fix ppl version in OpenElec.
Open the file OpenELEC.tv/packages/toolchain/math/ppl/meta and change PKG_VERSION from "1.1pre9" to "1.1pre10"

4. Put touch screen calibration file into the system.
Navigate to folder OpenELEC.tv/projects/RPI/ and create the file usr/share/eGalaxCalibration/touchscreen_axes_calib. This file should have the following contents:
calib_x_d=-21;calib_x_fact=0.658097686;calib_y_d=-50;calib_y_fact=0.408626561;swap_axes=0;click_confines=8
To set up these values please visit this post(at section 4).
This step is not needed any more, because you can use the calibration addon to calibrate your screen.
Get the calibration addon from my Downloads folder and put it in /storage/.xbmc/addons/

5. Put XBMC 12.3 patch.
Get my latest patches from here and put them in the folder OpenELEC.tv/packages/mediacenter/xbmc/patches/

6. Build OpenElec.
Navigate to OpenElec folder and type:
PROJECT=RPi ARCH=arm make -j3
-j3 option is to use parallel build(if you have more than one cpu's set this number as nb_cpus+1). This option will speed up the build process.
The build process will take couple of hours, but you have to come back once(in the first 10 minutes) and press ENTER for the kernel touch screen modifications to be approved.

7. Install or Update your OpenElec card.
Go to OpenElec build instructions page for RPI and follow the "Install instructions" chapter.

Have fun!

Car PC project(August 2013 update)

online engineering degree/engineering degree online/online engineering courses/engineering technology online/engineering courses online/engineering technician degree online/online engineering technology/electronic engineering online
This is an update for my CarPC project.
You can download the latest image from the link on the top right corner of this blog(username:'pi', password:'a').