Sunday, October 5, 2014

Installing OpenCV 2.4 in Ubuntu 14.04.1

Ubuntu 14.04.1
OpenCV 2.4
Python 2.7.6


Status:
  • 20141005  OpenCV Python samples is working.
  • 20141006  Installing MySql, Apache, PHP and PhpMyAdmin. (Apache=ok, PhpMyAdmin=no)
  • 20141007  Try to fix apache (or php, or phpmyadmin) problem (don't start phpmyadmin configuration popup at instalation time)
  • 20141008  Installing MySql managers (MySQL Workbench, Emma) and restoring "robot" database (manual creation of a new database and import sql file exported by the hp_centauro notebook.
  • 20141009  robot_wsr_face_recognition app is working without any modification :)
Install:
  • sudo apt-get update
  • sudo apt-get install libcv2.4 libcv-dev libhighgui2.4 libhighgui-dev opencv-doc opencv-data libopencv-dev
  • Installing Python Libraries:
  • sudo apt-get install python-opencv  python-dev python-webpy
  • Download OpenCV Library and Extract to "home" folder.
  • Copy OpenCV "data" folder into "samples" folder (otherwise python samples don't work)
Testing OpenCV Python samples:
  • cd ~/opencv-2.4.9/samples/python
  • copiar pasta "OpenCV"/data para "OpenCV"/samples
  • python ./facedetect.py 0
  • python ./motempl.py (contorno e movimento)
  • python ./laplace.py (contorno)
 Installing PyFaces:
  • sudo apt-get install tix python-imaging-tk
  • Download pyfaces
  • Unzip to ~/pyfaces
  • cd ~/pyfaces
  • python pyfacescontroller.py (not working)
Installing som4r repository:
  • sudo apt-get install subversion
Installing Apache, MySql and PhP:

Saturday, September 27, 2014

Raspberry Pi - Pidora

Windows 7
SDFormatter 4.0
Win32DiskImager
PuTTY 0.63


Status:

  • 2014 09 27 - Wi-Fi working.
Install:
  • Download Pidora Operating System image (http://downloads.raspberrypi.org/pidora_latest)
  • Unzip downloaded file.
  • Use Win32DiskImager to write the image to SD card.
  • Connect a keyboard (USB) and monitor (HDMI) to the Raspberry Pi board.
  • Boot Raspberry Pi board with SD card.
Configure:
  • Configure keyboard, timezone, create user "pi", set root password, enable SSH service and DVI adapter. Reboot.
  • Login with default user and password (pi  raspberry).
Configure Wi-Fi:
  • su -     (use root password)
  • Installing ifconfig package:
  • yum provides ifconfig
  • yum install net-tools wpa_supplicant dhclient
  • chkconfig wpa_supplicant on
  • service wpa_supplicant start
  • chkconfig NetworkManager on
  • service NetworkManager start
  • reboot
  • Login as root and configure Wi-Fi Network:
  • nmcli dev wifi con "myssid" password "myssidpassword"
Checking Network:
  • iwconfig
  • iwlist scan
  • pifconfig
  • ifconfig
Update:
  • Login as root.
  • yum update      (zzz)
References:

Saturday, September 13, 2014

Installing Arduino IDE and Libs on Ubuntu 10.10 and Windows 7

Ubuntu 10.10
Windows 7 (64bits)
Arduino IDE 1.0.5 for Linux (32bits)
Arduino IDE 1.5.7 for Windows



Status:
  • 2014.09.14  It's working. 
Installing on Ubuntu:
  • sudo apt-get update
  • sudo apt-get install arduino openjdk-6-jre gcc-avr avr-libc
  • Plug and Check if Arduino device was detected (ttyACM0: USB ACM device):
  • lsusb
  • dmesg | grep tty

Setting the Permission on ttyACM0 (Linux only - All distro):
  • Check the owner group of the serial port:
  • ls -l /dev/ttyACM0
  • You will get something like "dialout" or "uucp".
  • Add our user (pi) to that group:
  • usermod -a -G dialout pi
  • Add our user (pi) to "lock" group (if you have filesystem-2012.6-2 or newer):
  • usermod -a -G lock pi
Installing on Windows:
Testing - Linux and Windows:
  • Double click on /~/arduino-1.0.5/arduino and choose "Run" (arduino.exe on Windows).
  • Select a serial port (menu: Tools->Serial Port->dev/ttyACM0) (COM4 on Windows).
  • If there is no serial port available then try one of those options.
  • Select a board (menu: Tools->Board->Arduino Uno).
  • See examples (menu: File->Sketchbook).
  • Open file serial_echo.ino with Arduino IDE and Upload.



Testing with Python:
  • We don't need any privileges, like when working with Arduino IDE (chmod 777 /dev/ttyACM0).
  • python
  • import serial
  • On Linux:
  • ser=serial.Serial(port='/dev/ttyACM0', baudrate=500000, timeout=1)
  • On Windows:
  • ser=serial.Serial(port='COM4', baudrate=500000, timeout=1)
  • ser.write('Testing...\n')
  • print ser.readline()
  • ser.close()
References:

Sunday, September 7, 2014

Raspberry Pi - Raspbian - 2015

Windows 7
SDFormatter 4.0
Win32DiskImager
PuTTY 0.63
Raspbian 2015-02-16


Status:

  • 05/04/2015 - Configuring Wi-Fi network
  • 07/09/2014 - Access allowed (SSH through Raspberry Pi ethernet adapter). 

Install:


Configure:
  • Configure keyboard, timezone, ssh service and camera-support (raspi-config).
  • Login with default user and password (pi  raspberry).
  • Configuring Wi-Fi:
  • sudo cp /etc/wpa_supplicant/wpa_supplicant.conf  /etc/wpa_supplicant/wpa_supplicant.conf.orig
  • sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
  • Go to the bottom of the file and add the code bellow.

  • sudo cp /etc/network/interfaces /etc/network/interfaces.orig
  • Allow hotplug and dhcp client to wlan0 network interface:

  • Save the file and reboot system.
  • Check network status:
  • sudo ifconfig wlan0

  • Tip for ubuntu 16.04 Server:
  • Do not need wpa_supplicant.conf file, just config ssid and psk in /etc/network/interfaces file. 
  • auto wlp3s0
  • iface wlp3s0 inet dhcp
  •        wpa-ssid network-name
  •        wpa-psk pre-shared-key
  • Configuring Ethernet cable network:
  • Allow hotplug to eth0 network interface:
  • sudo nano /etc/network/interfaces


  • Connect Ethernet cable to Raspberry Pi board.
  • sudo ifdown eth0
  • sudo ifup eth0
  • Check network status:
  • sudo ifconfig

  • sudo reboot
  • Connect the Raspbian OS through the network using ssh client (Putty for Windows).



  • Update packages:
  • sudo apt-get update
Troubleshoot:

  • With this interfaces file above, cannot use Realtek Wlan Adapter and keyboard at same time ("IRQ32 disabled after an error").
  • see file /var/log/syslog



References:

Sunday, August 31, 2014

Raspberry Pi - Python Libraries - Raspbian or Adafruit

Windows 7
Linux 3.1.9adafruit+ armv6l
PuTTY 0.63
WinSCP 5.5.5


Status:
  • 20140830 Working both examples.
ToDo:
  • Choose the " best"  Python API:
    • RPIO?
    • Arduino Nampy? - This library allows you to communicate with your Arduino connected via USB using classes and methods really similar to those in the Arduino framework. Behind the scenes , Nanpy communicates via USB with the server part running as Arduino firmware. 
    • WiringPi?
  • OR use Serial Communication and pass commands to Arduino connected.
Install RPIO lib:
  • cd ~/
  • sudo apt-get install python-setuptools
  • sudo easy_install -U RPIO
  • git clone https://github.com/metachris/RPIO.git
  • cd RPIO
  • sudo python setup.py install
Testing RPIO lib:
  • cd ~/RPIO/examples
  • PWM Servo example:
  • python example3_pwm_servo.py

  • PWM LowLevel example:
  • python example4_pwm_lowlevel.py



Connect Raspberry Pi and Arduino:




  • sudo apt-get install python-serial
  • Call Python console:
  • python
  • >>>import serial
  • >>>ser = serial.Serial('/dev/ttyACM0', 500000)
  • >>>ser.readline()
  • >>>print ser
  • >>>ser.write('3')

Install Arduino lib:

  • sudo apt-get install arduino (see links 4 and 5 below)
References:

Saturday, August 30, 2014

Raspberry Pi - Remote Access - Raspbian or Adafruit

Windows 7
Linux 3.1.9adafruit+ armv6l
PuTTY 0.63
WinSCP 5.5.5


Status:
  • 20140906 OS Crashed. Building from scratch.
  • 20140830 Working Wi-Fi, SSH and VNC (manual start).
ToDo:
  • Autostart of VNCServer it's not working.
Install - Wi-Fi:
  • Login using a keyboard (USB) and monitor (HDMI) connected to the raspberry board: 
  • Default user and password:   pi   raspberry
  • Edit the file /etc/network/interfaces  and change SSID and password of Wi-Fi network. See on the References links (below) how to encrypt the password.

  • sudo reboot
Install SSH Server:
  • Already installed by default.
  • To configure:
  • sudo raspi-config
  • Interfacing Options  -> SSH
  • To access: Putty for Windows.


  • To transfer files: WinSCP (for Windows).


Install VNC Server:
  • sudo apt-get update
  • sudo apt-get install tightvncserver
  • tightvncserver
  • vncserver :0 -geometry 1920x1080 -depth 24
  • Configuring Autostart:
  • Create a file (~/vnc.sh):

  • cd ~/
  • chmod +x vnc.sh
  • ./vnc.sh
  • Connect to Raspberry Desktop using VNC Viewer.

  • Configuring Autostart:
  • cd /etc/init.d/
  • Create a file (/etc/init.d/vncboot.sh)

  • chmod 755 vncboot
  • update-rc.d ./vncboot defaults (or update-rc.d /etc/init.d/vncboot defaults)
  • reboot

References:

Sunday, June 10, 2012

Flash Players - Clientes web para RTMP

Ubuntu 11.04
Red5 Streaming


Code:




  • https://github.com/som4r/som4r/tree/master/robot
Status:
  • 20120610 Funcionando o cliente do streaming da webcam do usuário usando aplicacão camera_usuario.swf (flashbuilder) no joomla através do módulo e plugin denvideo (ver pasta /var/www/portal/images/denvideo).
  • 20120609 Funcionando o cliente do streaming do red5 (local e remoto) usando jwplayer no joomla (wrapper para /camerarobo/index.php).
Todo:
  • Criar módulo para o streaming de vídeo da câmera do usuário (swfobject?).
  • Criar módulo para o streaming de vídeo da câmera do robô.
Players Info:
Flash Links:
Install:
  • Download JW Player (jwplayer.swf, jwplayer.js)
Links: