Sunday, October 25, 2015

PolaPi - Instant-Printing-Point-and-Shoot camera using Raspberry Pi


A kind of a Polaroid camera, based on Raspberry Pi 2.
Details : https://hackaday.io/project/7176-polapi
- Raspberry Pi 2
- Raspberry Camera Module
- 4mm F1.0 CCTV lens
- Adafruit Thermal 57mm Printer, hacked for smooth printing
- Adafruit 320x280 TFT screen
- 3A 5v voltage regulator
- 7.4v 3.6Ah Li-po battery
- Buttons and hand made case
- Java programming.

Sunday, October 18, 2015

Raspberry Pi + Python + mxgxw/MFRC522-python - Dump RFID Tag data one-by-one, and detect tag remove

Last post about RFID Tag "Raspberry Pi 2 + MFRC522-python - Dump RFID Tag data using mxgxw/MFRC522-python" demo the Dump.py from mxgxw/MFRC522-python. It loop to read and display RFID Tag data, not easy for checking. So I modify it to dump RFID Tag data one-by-one, and detect card remove.

pyDump1.py, exit once tag data dump finished.
#!/usr/bin/env python
# -*- coding: utf8 -*-

import RPi.GPIO as GPIO
import MFRC522
import signal

continue_reading = True

# Capture SIGINT for cleanup when the script is aborted
def end_read(signal,frame):
    global continue_reading
    print "Ctrl+C captured, ending read."
    continue_reading = False
    GPIO.cleanup()

# Hook the SIGINT
signal.signal(signal.SIGINT, end_read)

print "Place card please..."

# Create an object of the class MFRC522
MIFAREReader = MFRC522.MFRC522()

# This loop keeps checking for chips. If one is near it will get the UID and authenticate
while continue_reading:
    
    # Scan for cards    
    (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)

    # If a card is found
    if status == MIFAREReader.MI_OK:
        print "Card detected"
    
    # Get the UID of the card
    (status,uid) = MIFAREReader.MFRC522_Anticoll()

    # If we have the UID, continue
    if status == MIFAREReader.MI_OK:

        # Print UID
        print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3])
    
        # This is the default key for authentication
        key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
        
        # Select the scanned tag
        MIFAREReader.MFRC522_SelectTag(uid)

        # Dump the data
        MIFAREReader.MFRC522_DumpClassic1K(key, uid)

        # Stop
        MIFAREReader.MFRC522_StopCrypto1()
        
        print "--- Finished ---"
        continue_reading = False
        
GPIO.cleanup()



pyDump2.py, wait tag remove after data dump. I assume tag removed if 5 times of MIFAREReader.MFRC522_Request() not OK.
#!/usr/bin/env python
# -*- coding: utf8 -*-

import RPi.GPIO as GPIO
import MFRC522
import signal

continue_reading = True

# Capture SIGINT for cleanup when the script is aborted
def end_read(signal,frame):
    global continue_reading
    print "Ctrl+C captured, ending read."
    continue_reading = False
    GPIO.cleanup()

# Hook the SIGINT
signal.signal(signal.SIGINT, end_read)

print "Place card please..."

# Create an object of the class MFRC522
MIFAREReader = MFRC522.MFRC522()

# This loop keeps checking for chips. If one is near it will get the UID and authenticate
while continue_reading:
    
    # Scan for cards    
    (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)

    # If a card is found
    if status == MIFAREReader.MI_OK:
        print "Card detected"
    
    # Get the UID of the card
    (status,uid) = MIFAREReader.MFRC522_Anticoll()

    # If we have the UID, continue
    if status == MIFAREReader.MI_OK:

        # Print UID
        print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3])
    
        # This is the default key for authentication
        key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
        
        # Select the scanned tag
        MIFAREReader.MFRC522_SelectTag(uid)

        # Dump the data
        MIFAREReader.MFRC522_DumpClassic1K(key, uid)

        # Stop
        MIFAREReader.MFRC522_StopCrypto1()
        
        # wait card removed 
        print "--- Remove Card ---"
        card_removed = False
        card_removed_counter = 5

        while not card_removed:
            (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
            if status != MIFAREReader.MI_OK:
                card_removed_counter = card_removed_counter-1
                if card_removed_counter==0:
                    card_removed = True
            else:
                card_removed_counter = 5
                
        print "--- Card removed---"
        print "Place card again please..."





- For setup of RFID Reader, refer "Raspberry Pi 2 + MFRC522-python, to read RFID tag".
- For mxgxw/MFRC522-python, refer "Raspberry Pi 2 + MFRC522-python - Dump RFID Tag data using mxgxw/MFRC522-python".

Saturday, October 17, 2015

"Unboxing" the Intel Compute Stick

Check out what comes in the box with the Intel® Compute Stick (model: STCK1A32WFC), Intel’s tiny Windows-based computer. While the Intel® Compute Stick can fit in the palm of your hand, it's what we fit inside of it that is truly remarkable. The Intel® Compute Stick has 2GB of RAM, 32GB of storage, built-in WiFi, Bluetooth 4.0, and comes pre-loaded with Windows® 10. Included in the box is a Quick Start Guide, HDMI extension cable, power adapter with USB cable, and international plug adapters.

Connect. Compute. It’s that simple.


Learn more: http://www.intel.com/computestick

Remote develop C/C++ program from Windows 10, run on Raspberry Pi, using NetBeans IDE

This post show how to develop C/C++ program on Netbeans IDE run on Windows 10, set up remote host on raspberry Pi. Such that you can run the program on Raspberry Pi remotely.




Local client host (the PC you used to develop):
Windows 10
Netbeans IDE 8.0.2 with C/C++ plugins (https://netbeans.org/community/releases/80/cpp-setup-instructions.html#downloading)
C/C++ compiler: 32-bit MinGW(https://netbeans.org/community/releases/80/cpp-setup-instructions.html#mingw)

Remote host (The target remote platform to run the program):
Raspberry Pi 2
Raspbian Jessie (2015-09-24)

Follow the steps in the video:



Test code, C++:
#include <iostream>

using namespace std;

int main(int argc, char** argv) {

    std::cout << "Hello World!\n";
    
#ifdef __linux__
    std::cout << "__linux__\n";
#elif defined(__unix__)
    std::cout << "__unix__\n";
#elif defined(_WIN64)
    std::cout << "Windows 64\n";
#elif defined(_WIN32)
    std::cout << "Windows 32\n";
#endif

#if __WORDSIZE == 64
    std::cout << "64 bit\n";
#else
    std::cout << "32 bit\n";
#endif

    return 0;
}

Reference:
https://netbeans.org/kb/docs/cnd/remote-modes.html
https://netbeans.org/kb/docs/cnd/remotedev-tutorial.html#setup

Related:
Remote run JavaFX on Raspbian Jessie, from Netbeans/Windows 10


Friday, October 16, 2015

Python + OpenCV: generate Histograms of images


Python + OpenCv example run on Raspberry Pi 2 to generate Histograms of images, pyHist.py
from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
import cv2

img = Image.open('photo.jpg')
#img = Image.open('b.png')
imgArr = np.asarray(img)

plt.subplot(221), plt.imshow(img)

color = ('r','g','b')
for i,col in enumerate(color):
    histr = cv2.calcHist([imgArr],[i],None,[256],[0,256])
    plt.subplot(222), plt.plot(histr,color = col)
    plt.xlim([0,256])

plt.xlim([0,256])

plt.show()



Reference: http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_begins/py_histogram_begins.html

Python + OpenCV: convert RGB to HSV and reverse


Python + OpenCV example run on Raspberry Pi 2 to convert RGB to HSV and reverse from HSV to RGB, pyCV_cvtImage.py.
import sys
import cv2

print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)

#img1 and img2 must be in same size
img1 = cv2.imread('Raspberry_Pi_Logo.png', 1)
hsv1 = cv2.cvtColor(img1, cv2.COLOR_RGB2HSV)
h,s,v = cv2.split(hsv1)
hsv2 = cv2.merge((h,s,v))
img2 = cv2.cvtColor(hsv2, cv2.COLOR_HSV2RGB)

cv2.imshow('img1',img1)
cv2.imshow('hsv1',hsv1)
cv2.imshow('h', h)
cv2.imshow('s', s)
cv2.imshow('v', v)
cv2.imshow('hsv2',hsv2)
cv2.imshow('img2',img2)

cv2.waitKey(0)
cv2.destroyAllWindow()


Thursday, October 15, 2015

GPIO Zero - a simple interface to GPIO for Raspberry Pi

GPIO Zero is a simple interface to everyday GPIO components used with Raspberry Pi, with very little code, you can quickly get going connecting your physical components together.

This video show my first try of GPIO Zero on raspberry Pi 2/Raspbian Jessie.


Connection (LED and Button):
Run IDLE with sudo, enter the simple code to test:
Python 2.7.9 (default, Mar  8 2015, 00:52:26) 
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> from gpiozero import LED, Button
>>> led=LED(2)
>>> button=Button(3)
>>> button.when_pressed=led.on
>>> button.when_released=led.off
>>> 


Monday, October 12, 2015

Raspberry Pi 2 + MFRC522-python - Dump RFID Tag data using mxgxw/MFRC522-python


Last post "Raspberry Pi 2 + MFRC522-python, to read RFID tag" show how to setup SPI on Raspberry Pi 2/Raspbian Jessia, and git clone rasplay/MFRC522-python to read id of RFID tag. It provide a example read.py only.

Here is another GitHub project mxgxw/MFRC522-python (A small class to interface with the NFC reader Module MFRC522), it provide examples of Dump.py, Read.py and Write.py also.

To set up SPI on Raspberry Pi 2/Raspbian Jessia, refer to last post.

This video show how to "git clone https://github.com/mxgxw/MFRC522-python" and run Dump.py to dump data of a brand new RFID key.



You can download APK of my Android exercise in my another blog, Android NFC: readBlock() for MifareClassic, to dump data in RFID tag; to compare the dumped data. Tested on brand new 1K MifareClassic RFID Tag only.


Next:
- The example of Dump.py repeat to display the tag data, not easy for checking. I modify it to display once, and also detect card removed. Read "Raspberry Pi + Python + mxgxw/MFRC522-python - Dump RFID Tag data one-by-one, and detect tag remove".


Raspberry Pi Sense HAT - AstroPi

Raspberry Pi Sense HAT - AstroPi

Possibilities include: Determining orientation
Detecting speed
Measure environmental conditions (temperature and humidity.)
The bright 8 x 8 RGB LED display can be used to display sensor data or games. An on-board directional joystick provides a human interface for navigation and input.
Compatible with Raspberry Pi B+, A+, and Pi 2

Product Description
The Raspberry Pi Sense HAT attaches via the Pi's 40pin GPIO port to read and display sensor data from a host of built-in sensors. Based on the same hardware that is currently in orbit on the International Space Station, the Sense HAT lets you create applications, experiments, and games.

Technical Specifications:
Gyroscope - angular rate sensor: +/-245/500/2000dps
Accelerometer - Linear acceleration sensor: +/-2/4/8/16 g
Magnetometer - Magnetic Sensor: +/- 4/8/12/16
Gauss Barometer: 260 - 1260 hPa absolute range (accuracy depends on the temperature and pressure, +/- 0.1 hPa under normal conditions)
Temperature sensor (Temperature accurate to +/- 2 degC in the 0-65 degC range)
Relative Humidity sensor (accurate to +/- 4.5% in the 20-80%rH range, accurate to +/- 0.5 degC in 15-40 degC range)
8x8 RGB LED matrix display
Small 5 button joystick
Compatible with Raspberry Pi B+, A+, and Pi 2

ASTRO PI The Raspberry Pi Sense HAT is being used in conjunction with the Raspberry Pi Foundation to perform science experiments aboard the International Space Station (ISS).

Raspberry Pi 2 + MFRC522-python, to read RFID tag

CAUTION@2016-08-19:
Somebody comment no need set device tree, check the comments (in the comments below and in the video: https://www.youtube.com/watch?v=0aVtZvkuHTA) first, before you try.



This post show the steps I install MFRC522-python (https://github.com/rasplay/MFRC522-python) on Raspberry Pi 2/Raspbian Jessie (2015-09-24), to read RFID tags (key and card) using RFID Reader, RFID-RC522.



Connection between RFID-RC522 Reader and Raspberry Pi 2:
RFID-RC522 pin NamePin #Raspberry Pi 2 Pin name
SDA24GPIO8
SCK23GPIO11
MOSI19GPIO10
MISO21GPIO9
IRQ-no connection
GNDGNDGND
RST22GPIO25
3.3V13V3

Steps:
1 - Enable SPI using Raspberry Pi Configuration


2 - Install python-dev and SPI-Py
$ sudo apt-get install python-dev
$ git clone https://github.com/lthiery/SPI-Py.git
$ cd SPI-Py
$ sudo python setup.py install


3 - Download MFRC522-python, MFRC522 Python Library for Raspberry Pi
(https://github.com/rasplay/MFRC522-python)
$ git clone https://github.com/rasplay/MFRC522-python.git


Unfortunately it is still not work!

Then I follow dzasa steps in this thread https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=106313 to solve the problem.

4 - Enable device tree
Edit /boot/config.txt to add the line:
device_tree=on


5 - Install latest version of bcm2835, C library for Broadcom BCM 2835 as used in Raspberry Pi; version 1.46 currently.
(http://www.airspayce.com/mikem/bcm2835/)
# download the latest version of the library, say bcm2835-1.xx.tar.gz, then:
$ tar zxvf bcm2835-1.xx.tar.gz
$ cd bcm2835-1.xx
$ ./configure
$ make
$ sudo make check
$ sudo make install


Then reboot.

6 - Test it:
$ cd MFRC522-python
$ sudo python read.py



Updated@2016-01-30:
when we using MFRC522 it will set GPIO port mode to GPIO.BOARD. So simply you can't access using GPIO ports when it is in this mode using GPIO pins numbers. But you can access any GPIO ports according to GPIO.BOARD representation.  ~ refer to Unknown comment below.


Next:
Raspberry Pi 2 + MFRC522-python - Dump RFID Tag data using mxgxw/MFRC522-python

Related:
- Arduino Uno + RFID-RC522, MFRC522 library example DumpInfo
- Android NFC: readBlock() for MifareClassic, to dump data in RFID tag

Sunday, October 11, 2015

Python + OpenCV: create negative image

Example to generate negative image:


import sys
import cv2

print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)

#img1 and img2 must be in same size
img1 = cv2.imread('Raspberry_Pi_Logo.png', 1)
img2 = (255-img1)

cv2.imshow('img1',img1)
cv2.imshow('img2',img2)

cv2.waitKey(0)
cv2.destroyAllWindow()




Edit the example "Capture Raspberry Pi Camera image, display on OpenCV, Matplotlib PyPlot and Tkinter GUI" to generate negative image from the picamera captured image.

import picamera
import picamera.array
import time
import cv2
from matplotlib import pyplot as plt
import Tkinter 
import Image, ImageTk
import sys

def capturePiCam():
    with picamera.PiCamera() as camera:
        cap=picamera.array.PiRGBArray(camera)
        camera.resolution = (640, 480)
        camera.start_preview()
        time.sleep(3)
        camera.capture(cap,format="bgr")
        global img
        img =cap.array
        img = (255-img)

#- display on OpenCV window -
def displayAtOpenCV():
    cv2.namedWindow('imageWindow', cv2.WINDOW_AUTOSIZE)
    cv2.imshow('imageWindow',img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

#- display with matplotlib -
def displayAtPyplot():
    plt.figure().canvas.set_window_title("Hello Raspberry Pi")
    plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
    plt.xticks([]), plt.yticks([])  # to hide tick values on X and Y axis
    plt.show()
    
#- display on Tkinter -
def displayAtThinter():
    root = Tkinter.Tk() 
    b,g,r = cv2.split(img) 
    img2 = cv2.merge((r,g,b))
    img2FromArray = Image.fromarray(img2)
    imgtk = ImageTk.PhotoImage(image=img2FromArray) 
    Tkinter.Label(root, image=imgtk).pack() 
    root.mainloop()

def displayUsage():
    print("usage: ")
    print("python pyCV_picam.py 1 - display wiyh OpenCV window")
    print("python pyCV_picam.py 2 - display with matplotlib")
    print("python pyCV_picam.py 3 - display with Tkinter")

if len(sys.argv) != 2:
    displayUsage()
    sys.exit()
    
opt = sys.argv[1]

if opt=="1":
    print("display wiyh OpenCV window")
    capturePiCam()
    displayAtOpenCV()
elif opt=="2":
    print("display with matplotlib")
    capturePiCam()
    displayAtPyplot()
elif opt=="3":
    print("display with Tkinter")
    capturePiCam()
    displayAtThinter()
else:
    displayUsage()


Python + OpenCV: split and merge - to exchange color channel

Example to use OpenCV split() and merge() to separate color channel, and re-construct image with red and blue color channel exchanged.


import sys
import cv2

print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)

#img1 and img2 must be in same size
img1 = cv2.imread('Raspberry_Pi_Logo.png', 1)
b,g,r = cv2.split(img1)
img2 = cv2.merge((r,g,b))

cv2.imshow('img1',img1)
cv2.imshow('img2',img2)
cv2.imshow('r', r)
cv2.imshow('g', g)
cv2.imshow('b', b)
cv2.waitKey(0)
cv2.destroyAllWindow()


Python + OpenCV: Arithmetic Operations on Images - add(), addWeighted() and subtract()



import sys
import cv2
import numpy
import urllib

print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)
print("numpy version: " + numpy.__version__)
print("urllib version: " + urllib.__version__)

#img1 and img2 must be in same size
img1 = cv2.imread('Raspberry_Pi_Logo.png', 1)
img2 = cv2.imread('opencv-logo-white.png', 1)
imgAdd = cv2.add(img1, img2)
imgAddWeighted = cv2.addWeighted(img1, 0.7, img2, 0.3, 0)
imgSub = cv2.subtract(img1, img2)

cv2.imshow('img1',img1)
cv2.imshow('img2',img2)
cv2.imshow('imgAdd',imgAdd)
cv2.imshow('imgAddWeighted',imgAddWeighted)
cv2.imshow('imgSub',imgSub)
cv2.waitKey(0)
cv2.destroyAllWindow()



Reference: http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_core/py_image_arithmetics/py_image_arithmetics.html

Saturday, October 10, 2015

Remote control Raspberry Pi from Windows 10 using Remote Desktop App

Updated@2016-06-15:
No longer work after Microsoft update Remote Desktop for Windows 10 recently.

Fortunately, Remote Desktop Connection to Raspberery Pi is still work:)

~ read "Microsoft Remote Desktop for Windows 10 updated, cannot connect RPi again ...!".

With Microsoft Remote Desktop app, you can remote control Raspberry Pi from Windows 10 PC.


In Raspberry Pi, install xrdp
$ sudo apt-get install xrdp

In Windows 10 Store, install Remote Desktop app by Microsoft Corporation.


Host:
Raspberry Pi 2 running Raspbian Jessie (2015-09-24) with XRDP installed
Client:
Windows 10, with Microsoft Remote Desktop App

Related:
- Remote Desktop Connection from Windows 10 to Raspberry Pi xrdp

Thursday, October 8, 2015

Python/OpenCV, get image properties - number of row, column, color channel


import sys
import cv2
import numpy
import urllib

print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)
print("numpy version: " + numpy.__version__)
print("urllib version: " + urllib.__version__)

url = 'http://goo.gl/41cgQr'
data = urllib.urlopen(url)
img = numpy.asarray(bytearray(data.read()), dtype='uint8')
img = cv2.imdecode(img, cv2.IMREAD_COLOR)

print("")
print "image info"
print "#row #column #channel"
print img.shape
print "#row * #column * #channel"
print img.size

cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyWindow('image')



Monday, October 5, 2015

Install python-gphoto2 on Raspberry Pi/Raspbian Wheezy - success



Refer to the previous post "Install and test python-gphoto2 (Python interface to libgphoto2) on Raspberry Pi 2/Raspbian Jessie", success to install but fail to run. In order to verify the steps, I redo it on Raspberry Pi (1st generation, NOT 2)/Raspbian Wheezy.

Install gphoto2 and libgphoto using gphoto2-updater script. Both gphoto2 and libgphoto2 installed are version 2.5.8.


Then install python-gphoto2:
$ sudo apt-get install python-pip
$ sudo apt-get install python-dev
$ sudo pip install gphoto2

It seem much better.

Sunday, October 4, 2015

Install PyQt4 on Raspberry Pi

o install PyQt4 for Python 2 on Raspberry Pi
$ sudo apt-get install python-qt4

for Python 3
$ sudo apt-get install python3-pyqt4



Example: hello.py
import sys
from PyQt4.QtGui import *

from PyQt4.QtCore import QT_VERSION_STR
from PyQt4.Qt import PYQT_VERSION_STR
from sip import SIP_VERSION_STR

a = QApplication(sys.argv)       

w = QWidget()
w.resize(320, 240)
w.setWindowTitle("Hello World!") 

label = QLabel()
info = "Qt version:" + QT_VERSION_STR + \
       "\nSIP version:" + SIP_VERSION_STR + \
       "\nPyQt version:" + PYQT_VERSION_STR
label.setText(info)

hbox = QHBoxLayout()
hbox.addWidget(label)
w.setLayout(hbox)

w.show() 
 
sys.exit(a.exec_())


PyQt4 hello.py run on Python 2

PyQt4 hello.py run on Python 3

Install and test python-gphoto2 (Python interface to libgphoto2) on Raspberry Pi 2/Raspbian Jessie - fail

python-gphoto2 is a comprehensive Python interface (or binding) to libgphoto2.

Before install python-gphoto2, we have to install libgphoto2, I run the gphoto2-updater script to install gphoto2 and libgphoto2 on Raspberry Pi 2/Raspbian Jessie. After finished, gphoto2 2.5.8 and libgphoto2 2.5.4 will be installed.


- Install python-dev
sudo apt-get install python-dev

- install python-gphoto2 with pip
sudo pip install gphoto2

If you installed with pip the example files should be in /usr/share/python-gphoto2/examples or /usr/local/share/python-gphoto2/examples or somewhere similar. Otherwise they are in the examples sub-directory of your working directory. In Raspbian Jessie, it should be in /usr/local/share/python-gphoto2/examples.

Connect a digital camera to your Raspberry Pi, switch it on, and unmount it before access with Python, and try one of the example programs:

$ python camera-summary.py


In my first test, I can run example of camera-summary.py to list details of the connected camera, but fail to capture image, with Segmentation fault!



In order to verify the steps, I redo it on Raspberry Pi (1st generation, NOT 2)/Raspbian Wheezy. Read "Install python-gphoto2 on Raspberry Pi/Raspbian Wheezy - success".


Updated@2015-12-03:
After install both gphoto and libgphoto2 of the same version 2.5.9, we can install python-gphoto2 and capture image successful.


Saturday, October 3, 2015

Python on Raspberry Pi to control DSLR with python-piggyphoto and libgphoto2


This post show how to control DSLR (Nikon D7000) with Raspberry Pi 2 (running Raspbian Jessie), using Python 2, with libgphoto2 and piggyphoto. The camera connect to Raspberry Pi via USB.


piggyphoto is a Python bindings for libgphoto2. You have to install libgphoto2.

To install piggyphoto for Python 2, enter the command:
$ sudo apt-get install python-piggyphoto

Try in Python 2:
import piggyphoto

C = piggyphoto.camera()
print C.abilities
C.capture_preview('prev.jpg')
C.capture_image('image.jpg')


Reference: https://github.com/alexdu/piggyphoto

Remote run JavaFX on Raspbian Jessie, from Netbeans/Windows 10


This video show how to setup Remote Java SE Platform in Netbeans IDE running on Windows 10, deploy JavaFX application running on Raspberry Pi 2/Raspbian Jessie. Actually, it's same as in Raspbian Wheezy.




Related:
- Remote develop C/C++ program from Windows 10, run on Raspberry Pi, using NetBeans IDE

Friday, October 2, 2015

Official Raspberry Pi Foundation Case For Model B+ & Raspberry Pi 2 Model B

Official Raspberry Pi Foundation Case For Model B+ & Raspberry Pi 2 Model B

Official case of the the Raspberry Pi Foundation
Preassembled 5 part enclosure--Removable Lid for easy access to the camera and display ports--Removable Top Frame--Removable Side Panels with easy access to the GPIO port
Designed with Pi HAT's in mind
Dimensions: 96mm x 70mm x 25mm
Compatible with the Raspberry Pi 2 Model B and Raspberry Pi Model B+