[Build Your Own Gesture-Based TV Remote with a Raspberry Pi]
LIFX
The LIFX light-bulbs connect easily with Raspberry PI using the HTTP API in the [developer zone].
Learn The Art Of Art Direction With James Clyne
The Smash the Code WorldCup contest
[The Smash the Code WorldCup contest starts tomorrow!]. The Smash the Code WorldCup Contest starts tomorrow, Saturday, April 30th at 12:00 pm EST and will end on Sunday, May 8th at 2pm EST.
Razer Blade Stealth Review
CHARACTER ART CONTEST – THE BEAST WINNERS
Allegorithmic announced the [CHARACTER ART CONTEST – THE BEAST WINNERS].
Nuke 10 is available!
The premium compositing tool, Nuke 10, is [free for non-commercial use].
Lumberyard Beginner Game Dev Tutorial
Raspberry PI Night Vision Camera
The PiHut is selling [Raspberry Pi NoIR Camera Module V2], a night-vision camera for the Raspberry PI.
Unity UI Tutorial – How to make a scrollable list
The Lycan Powerbox – Ready When You Aren’t!
How To Run A Successful Kickstarter
The insect photography of Levon Biss
[Levon Biss] blogs that [microsculpture.net] is now live to zoom in and explore each creature in minute detail.
UE4 Android Input Callback
I created another [pull request] to add a feature to UE4. This adds an Android input hook for UE4 plugins for a chance to remap controller input. I also added a UE4 plugin test project [UnrealEngine_AndroidInputRemap] to verify that the changes work as expected. [How to handle JAR files in UE4] is a topic that comes up on the community forums.
UE4 JNI_OnLoad Callback
I created a [pull request] to add a feature to UE4. This adds a hook for UE4 plugins for a chance to get the JNI_OnLoad event more easily. I also added a UE4 plugin test project [UnrealEngine_JNI_OnLoad] to verify that the changes work as expected. [How to handle JAR files in UE4] is a topic that comes up on the community forums.
Raspberry LEDs
There might be a way to [deactivate] the LEDS on the RPI2 and RPI3 that can show up as reflections in the camera.
Opsive Takes Over UFPS
Visionpunk, creator of UFPS, [tasked the Opsive team with taking over Ultimate FPS]. Ryan Buhr has this saying about making video games, “Do you want to make a game engine, or do you want to make a game? You can’t do both, you need to pick one to do it well!”.
Machine Learning comes to CodinGame
CodinGame has recently made the TensorFlow framework available for coding and designed a specific problem for it. It smartly enables Machine Learning beginners to practice the [TensorFlow tutorial]….
Build an Alexa Skill for Free Training
Inside Pascal: NVIDIA’s Newest Computing Platform
Learn how the Pascal architecture will benefit you as a developer. [read more]
MI Guitar by Magic Instruments
Unity New Input System
Unity is developing a [new input system].
Cordova Plugin config-file Element
In the [Cordova Plugin Reference], under `config-file Element`, the text reads “The config-file element only allows you to append new children to an XML document tree”. The Cordova NPM module installs globally into the following:
%USERPROFILE%\AppData\Roaming\npm\node_modules\cordova
It would be great to make existing `XML` content editable. The plugin code has logic to remove elements, but it hasn’t been exposed or documented.
RPI3 Camera Module
Originally, I wasn’t sure if the RPI3 used a different [camera module] [setup]. The documentation hasn’t been updated to include [RPI3 for the picamera]. It turns out I had a bad camera ribbon, and with a different camera it works just fine on the RPI3.
Raspberry PI Security Camera
To setup a Raspberry PI security camera.
I flash the SD with the latest [NOOBS] after formatting the SD card with the [SDCard Formatter].
Boot into the desktop and put the Raspberry PI on the wifi network.
Enable the [camera interface] and reboot.
Sudo edit the /boot/config.txt file. Disable the camera LED by adding the entry:
disable_camera_led=1
Install the [poster] module by running the command-line:
sudo pip install poster
Create the file: ~/superscript
cd ~/Documents/PythonScripts/Camera/ python capture_image.py
Add execute permissions to superscript.
chmod +x ~/superscript
Create a folder for the Camera Python scripts.
mkdir ~/Documents/PythonScripts mkdir ~/Documents/PythonScripts/Camera/
Create the ~/Documents/PythonScripts/Camera/capture_image.py script. Rotate the camera as necessary.
#get access to the camera from picamera import PiCamera #import so we can invoke another script import subprocess #get access to the clock import datetime # get access to sunrise and sunset from astral import Location #sleep so we can wait on the camera from time import sleep from fractions import Fraction # create a camera object camera = PiCamera() #set the image resolution camera.resolution = (640, 480) #rotate the camera if upside-down camera.rotation = 180 #flip the camera on the horizontal camera.hflip = True i = 0; #record defaults framerate = camera.framerate shutter_speed = camera.shutter_speed exposure_mode = camera.exposure_mode iso = camera.iso while True: # Get sunrise and sunset for Monroe, WA l = Location() l.latitude = 47.887059 l.longitude = -121.8792998 l.timezone = 'US/Pacific' sunrise = l.sun()['dawn'] sunriseHour = int(sunrise.strftime('%H')) sunriseMinute = int(sunrise.strftime('%M')) sunset = l.sun()['sunset'] sunsetHour = int(sunset.strftime('%H')) sunsetMinute = int(sunset.strftime('%M')) hours = int(datetime.datetime.now().strftime('%H')) minutes = int(datetime.datetime.now().strftime('%M')) seconds = int(datetime.datetime.now().strftime('%S')) if (hours >= sunriseHour and hours <= sunsetHour): #print 'work in the light' camera.framerate = framerate camera.shutter_speed = shutter_speed camera.exposure_mode = exposure_mode camera.iso = iso else: #print 'work in the dark' camera.framerate = Fraction(1,6) camera.shutter_speed = 6000000 camera.exposure_mode = 'off' camera.iso = 800 #show preview with some transparency #camera.start_preview(alpha=200) #wait two seconds for camera lighting #sleep(2) filename = 'image'+str(i)+'.jpg' #save image locally camera.capture(filename) #invoke the script to upload the image subprocess.call('python save_image.py '+filename, shell=True) #stop the preview #camera.stop_preview() sleep(3) i = (i + 1) % 12
Create the save_image.py script. Alter the domain and path to ~/Documents/PythonScripts/Camera/save_image.py.
#!/usr/bin/env python import urllib, urllib2, os, os.path, sys from poster.encode import multipart_encode from poster.streaminghttp import register_openers command = os.popen('ifconfig | grep -A1 wlan0') client_ip = command.read() #print client_ip register_openers() if (len(sys.argv) > 1): filename = sys.argv[1]; else: filename = 'image.jpg'; query = { 'filename' : filename, 'client_ip' : client_ip } url = "http://domain/path/save_image.php?"+urllib.urlencode(query) print 'Saved: '+filename; if (os.path.isfile(filename)) : values = {'image':open(filename)} data, headers = multipart_encode(values) headers['User-Agent'] = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers['filename'] = filename req = urllib2.Request(url, data, headers) req.unverifiable = True content = urllib2.urlopen(req).read() #print (content) else: print 'No image file found to upload\r\n';
On your PHP server somewhere, make a new folder and create the page save_image.php.
<?php $filename = "image.jpg"; if ($_GET['filename'] != null) { $filename = $_GET['filename']; } if ($_GET['client_ip'] != null) { $clientip = $_GET['client_ip']; file_put_contents('client_ip.txt', $clientip); } $image = $_FILES["image"]; if ($image == null) { echo "Missing image to save as: "; echo $filename; } else { echo "Saved image!"; $tmp_name = $_FILES["image"]["tmp_name"]; move_uploaded_file($tmp_name, $filename); } ?>
On your PHP server somewhere, save the page images.php near your server image paths.
<html> <?php function displayFirstImage($path) { $files = glob($path); usort($files, function($a, $b) { return filemtime($a) < filemtime($b); }); foreach($files as $file){ printf('<img src="%1$s"/>', $file); break; } } displayFirstImage('path/to/camera1/*.jpg'); displayFirstImage('path/to/camera2/*.jpg'); displayFirstImage('path/to/camera3/*.jpg'); displayFirstImage('path/to/camera4/*.jpg'); ?> <script> setTimeout("window.location.reload()", 30000); </script> </html>
Edit ~/.bashrc and add the following to the end of the file.
~/superscript &
Reboot the Raspberry PI and the security camera is ready to go!