Monday, 31 August 2015

Building a Better Mousetrap With The Raspberry Pi

Build a better mousetrap, and the world will beat a path to your door, but what about a smarter mousetrap? [Alain] decided to find out by making a Raspberry Pi-powered, Internet-connected smart trap. The brains of the operation is a Pi running Arch Linux. Connected to that is a IR trigger, a servo to unlatch the sliding door, and a camera to see your new friend.

The housing of the trap is CNC cut foam PVC board, which is both easy to cut and to clean. Once the IR beam is broken the Pi turns the servo, which pulls a pin on the front door. Once your new friend is settled in a LED light turns on to illuminate the subject, a picture is taken and sent via email.

With automated alerts you don’t have to manually check the trap, and you also don’t have to worry about a trapped animal being inside for too long. Join us after the break for a demonstration video showing off all the features, and a real world example.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1IxW6km
via Hack a Day

Sunday, 30 August 2015

Voice Command with No Echo

[Naran] was intrigued with the Amazon Echo’s ability to control home electronics, but decided to roll his own. By using a Raspberry Pi with the beta Prota OS, he managed to control some Phillips Hue bulbs and a homebrew smart outlet.

Prota has a speech application, which made the job simpler. He does point out though, that his project doesn’t replace the Echo’s ability to answer questions by searching the Internet. The advantage, though, is it is easily tailored to your specific application. Also, if you have a Raspberry Pi hanging around, you can’t beat the price.

We couldn’t help but wonder if this was the easiest way to go though. We always have a couple of old Android phones with no service around. Connected to WiFi, they do a great job of answering questions with Google Now and have excellent speech recognition. A simple voice app could do wonders here, even it wound up still sending electronic control signals to the Pi. On the other hand, it is hard to write an  Android app that always listens and doesn’t require you to tap a button (or, at least, say “OK Google”) to make it start (or restart) listening.

If you wanted another way to make the Raspberry Pi listen, try Jasper. Or you could always just do it all with–what else–an Arduino and uSpeech.


Filed under: home hacks, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1UlueH7
via Hack a Day

Thursday, 27 August 2015

The FOSS Issue – out now!

The latest issue of Linux User & Developer – the FOSS issue – goes on sale today, available to buy online, on the high street, and via Android, Zinio and iOS.

We kick off with a look at the biggest contributions to open source from some of the biggest tech companies in the world, then take a look at the best free sofware for Linux, picking out the most useful packages across a range of categories, putting the biggest applications head-to-head.

The FOSS Issue – out now!

The tutorials section is packed with guides to programming drones, automating your audio playback, managing social media campaigns, tips and tricks for LibreOffice and more. Heading into the Pi section we have an interview with Dan Aldred about the students that became Astro Pi competition winners, and show you how you can re-create their project for yourself using the Sense HAT – which is now available to buy for $30.

The FOSS Issue – out now!

There’s plenty going on in the reviews section too, from our look at the best web browsers beyond Firefox and Chromium through to Korora 22 and OSMC. Gareth Halfacree also tests the Novena All-in-One Desktop, a new DIY, open hardware computer from Xbox hacker Bunnie Huang.

The FOSS Issue – out now!

Don’t forget that you can get your copy of the magazine delivered to your door each month, and save a third off the price too.



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1JnXutV
via IFTTT

Wednesday, 26 August 2015

Two-Axis Solar Tracker

Solar panels are an amazing piece of engineering, but without exactly the right conditions they can be pretty fickle. One of the most important conditions is that the panel be pointed at the sun, and precise aiming of the panel can be done with a solar tracker. Solar trackers can improve the energy harvesting ability of a solar panel by a substantial margin, and now [Jay] has a two-axis tracker that is also portable.

The core of the project is a Raspberry Pi, chosen after [Jay] found that an Arduino didn’t have enough memory for all of the functionality that he wanted. The Pi and the motor control electronics were stuffed into a Pelican case for weatherproofing. The actual solar tracking is done entirely in software, only requiring a latitude and longitude in order to know where the sun is. This is much easier (and cheaper) than relying on GPS or an optical system for information about the location of the sun.

Be sure to check out the video below of the solar tracker in action. Even without the panel (or the sun, for that matter) the tracker is able to precisely locate the panel for maximum energy efficiency. And, if you’d like to get even MORE power from your solar panel, you should check out a maximum power point tracking system as well.


Filed under: solar hacks

from Hackaday » raspberry pi http://ift.tt/1PxnmEY
via Hack a Day

Tuesday, 25 August 2015

Raspberry Pi Halt and Catch… Well, Halt

As far back as we can remember, there have always been hacks, exploits, and just curiosity about undocumented CPU instructions. The Z80 had them. Even the HP41C calculator had some undocumented codes. The HCF (Halt and Catch Fire) instruction was apocryphal, but we always heard the old video controller chips could be coaxed into blowing up certain monitors. You don’t hear too much about things like that lately, perhaps because fewer people are working in assembly language.

[Sergi Àlvarez i Capilla] not only works in assembly language, he was writing an ARM assembler when he noticed something funny. Instructions are built in a regular pattern and some of the patterns were missing. What to do? [Sergi] lost no time trying them out.

His result? He found at least one instruction that causes a Raspberry Pi to lock up dead. All by itself, that’s not a big deal, but the instruction isn’t protected so any user program could potentially lock up a Pi. A reset will set things right, of course. No combustion occurs. The newer models, by the way, seem to be immune and [Sergi] tested some phones and other devices with ARM processors to no effect.

The practical implications? Probably not much? But if you were putting a Pi in a critical system, you might find this result interesting. Maybe the best defense against this kind of hack is only having one instruction to start with. The 6502, by the way, was well known for having a large number of useful undocumented op codes. There’s some talk about that in the video below (the undocumented part starts around 6:00).


Filed under: ARM, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1NzKsgC
via Hack a Day

Saturday, 22 August 2015

Learn to code with FUZE BASIC

Spikey Pop

BASIC, prolific during the late Seventies and Eighties due to the popularity of the 8-bit BBC Micro, was the language that kickstarted much of the software industry we know today. Many programmers then moved on to more complex and powerful languages like C/+/++/Java etc, games consoles took over the home computer market and BASIC was all but forgotten. Fast-forward 30 years and it’s easy to see why the UK government is desperately trying to get kids coding again – resources are now very thin on the ground and we’re outsourcing our programming requirements like there’s no tomorrow.  There’s really never been a better time to become a programmer. You’ll find no better introduction than learning to program a game, so we’ll start with the classic bat-and-ball genre, but with a twist or two, of course.

This is a slightly extended version of the tutorial in issue 157, on sale Monday 24th August, including some metal balloons, an intro screen and a few other tweaks. To get started you will need to install FUZE BASIC V3 for Linux and download the graphics required for the game from http://ift.tt/1JnjrWD and http://ift.tt/1MJLaI1.

01 Get started

FUZE BASIC editorOnce you have installed FB3, you will have a directory on your desktop called fuze-basic – within is a programs folder. Unzip ‘spike.zip’ in here. Now start FUZE BASIC from your applications menu; if in Ubuntu then use the search tool and enter ‘fuze’. The first thing you’ll see is the retro C64 immediate mode – you can change this using Shift+Tab. There are only two skins right now but more will be added soon, so keep an eye on the FUZE Lair for updates. Right, let’s get started. Press F2 or type EDIT in immediate mode to get to the FB editor. Note: you can also get a list of immediate mode commands by entering HELP, and you can use the help icon at any time to view the help system. This is a great way explore the language and try out new commands.

Start typing in the code below, and remember to save your work regularly. Our first section calls the routines to set up the main graphics and variables. The initial CYCLE command starts the main loop, and this loop covers the gameplay to game over. The next CYCLE is for the level and the UNTIL hhLives check is to see if we have used up all our lives. Next, the procedures to display our character Spikey, the trampoline and the balloons are called. Finally, if we are out of lives then “GAME OVER” is displayed and it starts over.

REM Spikey POP
PROC setup
PROC sprites
CYCLE
PROC intro
level = 1
hhLives = 3
hhScore = 0
CYCLE
PROC newLevel
PROC getready
UNTIL hhLives <= 0 OR levComp CYCLE
PROC displayInfo
PROC hedgeHog
PROC balloon
plotSprite (tramp, MOUSEX, trampY, 0)
UPDATE
REPEAT
IF hhLives <= 0 THEN BREAK
level = level + 1
REPEAT
INK = Red
PROC hideSprites
CLS
text1$ = “GAME OVER!”
printAt (tWidth / 2 – LEN (text1$) / 2, tHeight / 2);  text1$;
UPDATE
WAIT (2)
CLS
REPEAT
END

02 Reset a new level

It’s worth pointing out that the program will only generate errors until you have finished typing the whole thing in. It is a fairly large program at 350 or so lines, and as such is going to take a while to type in. You’ll most likely need to debug it a bit afterwards, in case you make a few errors. Be patient and stick with it to the end and you’ll be glad you did, as once it is working you’ll understand every command within it.

Next are the variables that we need to reset at the start of each new level to make sure everything starts in the right place:

DEF PROC newLevel
bals = maxB
metalCt = level – 1
IF metalCt >= 5 THEN metalCt = 5
PROC newLifeVariables
PROC hideSprites
plotImage (back1, 0, -20)
levComp = 0
PROC setupBals
ENDPROC

03 Reset variables

Now enter the variables to reset every time a life is lost, or at the beginning of a new level:

DEF PROC newLifeVariables
hhX = gWidth / 2
hhY = gHeight / 2.8
hhYspd = .1
hhAngle = 0
hXdiff = 0
hXpow = 0
hYpow = .51
hhGrv = 0
hhXdirection = .1
hhYdir = 0
trampX = gWidth / 2
ENDPROC

04 Check the hedgehog

SpikeyThis section is where the hedgehog action is at. The first few lines check the position, the size and if Spikey has hit anything – spriteCollidePP(hhID,1). PP means pixel perfect, and the two variables are for the ID of the sprite we are checking and the accuracy from 1 (close) to 16 (boundary box).

DEF PROC hedgeHog
hhGrv = (((gHeight – hhY / hYpow) / 80))
hhW = getSpriteW (hhID)
hhH = getSpriteH (hhID)
hCol = spriteCollidePP (hhID, 1)
IF hCol >= b(0, 0) AND hCol <= b(maxB, 0) THEN
IF NOT b(hCol, bPop) THEN
IF ABS (b(hCol, bX) – hhX) > 20 THEN
hXpow = (b(hCol, bX) – hhX) / 100 * RND (10)
hXpow =  – hXpow
ENDIF

05 Check the balloons

PopNow we check to see which row of balloons has been popped – from the top row, we add 200 points, from the middle we add 100 and then the bottom is just 50. We also make a small speed adjustment so that each time a balloon is hit, the speed slowly increases. Next we check for a metal balloon and, if we hit one, then just reverse the direction as these cannot be popped.

hhYdir = NOT hhYdir
b(hCol, bPop) = 1
IF hCol >= 0 AND hCol <= 19 THEN
hhYspd = hhYspd + 0.03 + level / 100
hhScore = hhScore + 200
ENDIF
IF hCol >= 20 AND hCol <= 39 THEN
hhYspd = hhYspd + 0.01 + level / 200
hhScore = hhScore + 100
ENDIF
IF hCol >= 40 AND hCol <= 59 THEN
hhYspd = hhYspd + 0.005
hhScore = hhScore + 50
ENDIF
bals = bals – 1
IF bals <= 0 THEN levComp = 1
ENDIF
ENDIF
IF hCol >= mb(0, 0) AND hCol <= mb(metalCt, 0) THEN
hXpow = hXpow + RND (0) / 10
hXpow = – hXpow
hhYdir = NOT hhYdir
ENDIF

06 Calculate bounce angle

This section checks to see if we have hit the trampoline and adjusts our bounce (with hXdiff) accordingly. If Spikey goes below the bottom of the screen, that means he has missed the trampoline and so the lives are reduced. If the screen sides are hit, we reverse the bounce, adjust the sprite angle, then plot the sprite.

IF hhYdir = 0 THEN
hhY = hhY – hhGrv
IF hCol = tramp THEN
hhYdir = 1
hXdiff = (hhX – MOUSEX) / 3
IF ABS (hXdiff) > trampW / 6 THEN
hYpow = .51
hhYspd = .1
hXdiff = 0
hXpow = .1
ENDIF
hYpow = hYpow + .05
hXpow = hXpow + hXdiff / 20
hhAngle = hhAngle + hXdiff / 50
setSpriteAngle (hhID, hhAngle)
ENDIF
ENDIF
IF hhYdir = 1 THEN
hhY = hhY + hhGrv
IF hhGrv <= .5 OR hhY >= gHeight THEN hhYdir = 0
ENDIF
IF hhY <= 0 THEN
hhLives = hhLives – 1
IF hhLives > 0 THEN
PROC newLifeVariables
PROC getready
ELSE
gameOver = 1
ENDIF
ENDIF
IF hYpow >= 1.6 THEN hYpow = 1.6
hhAngle = hhAngle + hXdiff / 50
setSpriteAngle (hhID, hhAngle)
IF hhX <= hhW / 2 OR hhX >= gWidth – hhW / 2 THEN hXpow =  – hXpow
hhX = hhX + hXpow
plotSprite (hhID, hhX, hhY, 0)
ENDPROC

07 Wait for player to start

Now we enter the code that flashes Spikey and waits for a mouse click before dropping him to the floor, allowing the player to position the trampoline.

DEF PROC getready
CYCLE
getMouse (a, b, mousebutton)
hideSprite (hhID)
UPDATE
plotSprite (hhID, hhX, hhY, 0)
UPDATE
plotSprite (tramp, MOUSEX, trampY, 0)
REPEAT UNTIL mousebutton
ENDPROC

08 Move the balloons

The balloon procedure sets up an animation loop that increases the animation sequence every four frames (IF bAnCtr > 4 THEN). Our balloons will each be stored in an array, which we’ll look at in the next step. It then checks to see if a balloon is in pop mode, and if so we rotate it, decrease its size and drop its Y position so that it falls down the screen, shrinking and spinning. If it is not due to be popped, we move each balloon in its direction and then check to see if it goes off the side of the screen, and if so prepare it for display on the opposite side of the screen. Finally, we plot any metal balloons if they are active.

DEF PROC balloon
bAnCtr = bAnCtr + 1
IF bAnCtr > 4 THEN
bAnID = bAnID + bAnDir
bAnCtr = 0
ENDIF
IF bAnID >= 6 OR bAnID <= 0 THEN bAnDir =  – bAnDir
FOR I = 0 TO maxB CYCLE
IF b(I, bPop) = 1 THEN
b(I, bSize) = b(I, bSize) – .1
b(I, bY) = b(I, bY) – 2
b(I, bAngle) = b(I, bAngle) + 10
setSpriteSize (b(I, ID), b(I, bSize) * 16)
setSpriteAngle (b(I, ID), b(I, bAngle))
IF b(I, bSize) <= 0 THEN
hideSprite (b(I, ID))
b(I, bActive) = 0
ENDIF
ENDIF
IF b(I, bActive) THEN
plotSprite (b(I, ID), b(I, bX), b(I, bY), bAnID)
b(I, bX) = b(I, bX) + b(I, bSpd)
IF b(I, bSpd) < 0 THEN
IF b(I, bX) <= bMinX THEN b(I, bX) = bMaxX
ENDIF
IF b(I, bSpd) > 0 THEN
IF b(I, bX) >= bMaxX THEN b(I, bX) = bMinX
ENDIF
ENDIF
IF I <= metalCt THEN
IF mb(I, bActive) THEN plotSprite (mb(I, ID), mb(I, bX), mb(I, bY), bAnID)
REPEAT
ENDPROC

09 Display the score

This chunk of code will display the score, number of lives remaining and the level information:

DEF PROC displayInfo
INK = Yellow
printAt (0, 0); “Score “;
INK = Red
PRINT hhScore
INK = Yellow
printAt (tWidth – 10, 0); “Lives “;
INK = Red
PRINT hhLives
INK = Yellow
printAt (tWidth / 2 – 4, 0); “Level “;
INK = Red
PRINT level
ENDPROC

10 Set up the balloons

ArrayThe initial balloon data is essential to get things running smoothly. Here we set up an array to store all the information needed about each balloon. In this case, we have the sprite ID, X position, Y position, speed, score value, size and then active and pop mode states. Finally the same is setup for the metal balloon variables.

DEF PROC setupBals
bI = 20
bMinX = – bW * 2
bMaxX = gWidth + bW * 2
bStep = (bMaxX – bMinX) / 20
ctr = 0
FOR n = bMinX TO bMaxX – bW STEP bStep CYCLE
b(ctr, bY) = gHeight – bH
b(ctr + 20, bY) = gHeight – bH * 2.5
b(ctr + 40, bY) = gHeight – bH * 4
b(ctr, bX) = n
b(ctr + 20, bX) = n
b(ctr + 40, bX) = n
b(ctr, bSpd) = .5
b(ctr + 20, bSpd) = -.2
b(ctr + 40, bSpd) = .1
b(ctr, bScore) = 200
b(ctr + 20, bScore) = 100
b(ctr + 40, bScore) = 50
b(ctr, bSize) = 10
b(ctr + 20, bSize) = 10
b(ctr + 40, bSize) = 10
b(ctr, bActive) = 1
b(ctr + 20, bActive) = 1
b(ctr + 40, bActive) = 1
b(ctr, bPop) = 0
b(ctr + 20, bPop) = 0
b(ctr + 40, bPop) = 0
plotSprite (b(ctr, ID), b(ctr, bX), b(ctr, bY), 0)
plotSprite (b(ctr + 20, ID), b(ctr + 20, bX), b(ctr + 20, bY), 0)
plotSprite (b(ctr + 40, ID), b(ctr + 40, bX), b(ctr + 40, bY), 0)
ctr = ctr + 1
UPDATE
REPEAT
IF level < 6 THEN
mBgap = gWidth / level
ELSE
mBgap = gWidth / 6
ENDIF
IF level > 1 THEN
FOR num = 0 TO metalCt CYCLE
mb(num, bY) = gHeight / 2
mb(num, bX) = mBgap * num
mb(num, bSpd) = 0
mb(num, bScore) = 1000
mb(num, bSize) = 10
mb(num, bPop) = 0
IF num > 0 THEN mb(num, bActive) = 1
REPEAT
ENDIF
ENDPROC

11 Set up the game itself

The main setup section configures the screen and update settings, loads the background image and defines the main variables, including the balloon arrays and indexes that we have already seen in some of the previous steps. It is worth revisiting this section once you have finished putting Spikey Pop together, because you can test yourself by changing the size of the array and modifying the other code accordingly.

DEF PROC setup
setMode (1024, 600)
FULLSCREEN = 0
updateMode = 0
mouseOff
maxB = 60
back1 = loadImage (“back1.png”)
back = loadImage (“back.png”)
DIM b(maxB, 10)
DIM mb(6, 10)
ID = 0
bActive = 1
bX = 2
bY = 3
bSpd = 4
bAngle = 5
bSize = 6
bScore = 7
bPop = 8
balloon = 0
bAnID = 0
bAnDir = 1
bAnCtr = 0
ENDPROC

12 Draw the sprites

The order that sprites are created in is the order in which they will be displayed on the screen. Therefore if you want a sprite to always be on top of every other sprite, create it last. You must set a transparent colour using setSpriteTrans (pop, 255, 0, 255); this is the one colour that will not be displayed on-screen.  Setting the transparent colour means you can make sure that sprites don’t obscure others when they overlap. Understanding the setSpriteOrigin command is important. The default is bottom-left, so you need to use offsets if you want to control the sprite from its middle. Far more convenient is to set the origin using: setSpriteOrigin (pop, getSpriteW (pop) / 2 and then getSpriteH (pop) / 2), as this sets the origin at the absolute centre of the sprite. Other important sprite commands include setSpriteSize, setSpriteAngle and advanceSprite – more information can be found in the Programmer’s Reference Guide.

DEF PROC sprites
FOR n = 0 TO maxB CYCLE
b(n, ID) = newSprite (7)
FOR nn = 1 TO 7 CYCLE
num$ = STR$ (nn)
IF n >= 0 AND n <= 19 THEN loadSprite (“spe” + num$ + “.png”, b(n, ID), nn – 1)
IF n >= 20 AND n <= 39 THEN loadSprite (“spc” + num$ + “.png”, b(n, ID), nn – 1)
IF n >= 40 AND n <= 59 THEN loadSprite (“spd” + num$ + “.png”, b(n, ID), nn – 1)
REPEAT
setSpriteTrans (b(n, ID), 255, 0, 255)
setSpriteOrigin (b(n, ID), getSpriteW (b(n, ID)) / 2, getSpriteH (b(n, ID)) / 2)
REPEAT
FOR n = 0 TO 6 CYCLE
mb(n, ID) = newSprite (7)
FOR nn = 1 TO 7 CYCLE
num$ = STR$ (nn)
loadSprite (“spb” + num$ + “.png”, mb(n, ID), nn – 1)
REPEAT
setSpriteTrans (mb(n, ID), 255, 0, 255)
setSpriteOrigin (mb(n, ID), getSpriteW (mb(n, ID)) / 2, getSpriteH (mb(n, ID)) / 2)
REPEAT
bH = getSpriteH (b(0, 0))
bW = getSpriteH (b(0, 0))
tramp = newSprite (1)
loadSprite (“tramps.png”, tramp, 0)
setSpriteTrans (tramp, 255, 0, 255)
setSpriteOrigin (tramp, getSpriteW (tramp) / 2, 0)
trampY = -5
trampH = 20
trampW = getSpriteW (tramp)
trampL = trampW / 2
trampR = gWidth – trampW / 2
hhID = newSprite (1)
loadSprite (“hedge.png”, hhID, 0)
setSpriteTrans (hhID, 255, 0, 255)
setSpriteOrigin (hhID, getSpriteW (hhID) / 2, getSpriteH (hhID) / 2)
setSpriteSize (hhID, 110)
spikey = newSprite (3)
FOR n = 1 TO 3 CYCLE
num$ = STR$ (n)
loadSprite (“spikey” + num$ + “.png”, spikey, n – 1)
REPEAT
setSpriteTrans (spikey, 255, 0, 255)
setSpriteOrigin (spikey, getSpriteW (spikey) / 2, getSpriteH (spikey) / 2)
pop = newSprite (1)
loadSprite (“pop.png”, pop, 0)
setSpriteTrans (pop, 255, 0, 255)
setSpriteOrigin (pop, getSpriteW (pop) / 2, getSpriteH (pop) / 2)
ENDPROC

13 Clean up

This final routine clears and resets all the sprites, and is needed at the end of each level and at the start of a new life:

DEF PROC hideSprites
FOR n = 0 TO metalCt CYCLE
setSpriteSize (mb(n, ID), 100)
setSpriteAngle (mb(n, ID), 0)
hideSprite (mb(n, ID))
REPEAT
FOR n = 0 TO maxB CYCLE
setSpriteSize (b(n, ID), 100)
setSpriteAngle (b(n, ID), 0)
hideSprite (b(n, ID))
REPEAT
hideSprite (tramp)
hideSprite (hhID)
ENDPROC

14 Introduce the game

IntroFinally, the intro section displays our title sprites with a simple animation and waits for a mouse click to continue:

DEF PROC intro
angle = 0
anglestep = .2
sID = 0
scale = 100
scaleDir = .1
text1$ = “Click mouse to play – use mouse to control”
timecount = 0
plotImage (back, 0, 20)
CYCLE
IF timecount > 100 THEN END
getMouse (a, b, mousebutton)
setSpriteAngle (spikey, angle – 30)
plotSprite (spikey, gWidth / 2, gHeight / 2, sID)
plotSprite (pop, gWidth / 2 + getSpriteW (pop) / 2, gHeight / 2 – getSpriteH (pop), 0)
sID = sID + 1
IF sID > 2 THEN sID = 0
scale = scale + scaleDir
IF scale <= 96 OR scale >= 104 THEN scaleDir = – scaleDir
setSpriteSize (pop, scale)
INK = RND (16)
printAt (tWidth / 2 – LEN (text1$) / 2, tHeight – 1); text1$;
angle = angle + anglestep
IF angle < 0 OR angle > 10 THEN anglestep = – anglestep
UPDATE
REPEAT UNTIL mousebutton
CLS
hideSprite (spikey)
hideSprite (pop)
ENDPROC

FUZE BASIC

FUZE BASIC V3 for Linux and the Raspberry Pi, the Programmer’s Reference Guide and a Project Workbook are all freely available to download from www.fuze.co.uk.

 



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Kc1ZcW
via IFTTT

Follow Me: Making Servos Track Hand Motion with Leap

The Leap controller is one of those gadgets that is probably better for its cool factor rather than its practicality. The time of flight sensor reads gestures, but it is hardly a substitute for a mouse in many cases. It seems like the best uses for it we’ve seen are dedicated systems that need to know where your hands are. [Justin Platz] and [Kurt Clothier], for example, have an interesting demo that uses a Leap to control a Raspberry Pi. The Pi commands servo motors that move LED blocks to track your hand motion. Their code is available on GitHub.

The project is begging for a video, but they did provide an animated image:

pubnub_leapmotion_RaspberryPi_servo_iot_DIY

The demo shows off the low latency possible with PubNub which is yet another Internet of Things broker (everyone wants to be the one thing that rules them all, apparently).

One thing that really caught out eye is the use of these 8×8 RGB modules as the “eyes” of the robot. You have to admit this freshens up the paradigm of using cameras as the eyes of the bot!

This isn’t the first practical use for the Leap we’ve covered. Not to mention, if you have a 3D printer, you should check out the video below.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1NBu52d
via Hack a Day

Hackaday Prize Entry: Twitter Goes To The Dogs With Raspberry Pi Hack

Easy to Read Bicycle Computer

[David Schneider] had trouble seeing his bike computer in the sunlight and wanted a navigation solution that would be both readable and not require a smart phone. In good hacker fashion, [David] married a Raspberry Pi and a Kindle Touch (the kind with the E-ink display). The Kindle provides a large and easy-to-read display.

[David] was worried about violating the DCMA by modifying the Kindle. Turns out, he didn’t have to. He simply used the book reader’s Web browser and set the Pi up as a wireless access point. One clever wrinkle: Apparently, the Kindle tries to phone home to Amazon when it connects to a wireless network. If it can’t find Amazon, it assumes there’s no valid network and treats the network as invalid. To solve this issue, [David] causes the Pi to spoof the Kindle into thinking it gets a valid response from Amazon.

The other work around was to change how the Python application on the Pi updates the screen. [David] found that without that optimization, the constant redrawing on the E-ink display was annoying. The Pi-related hardware includes a GPS, some reed switches, and a WiFi dongle.

We’d love to adapt this idea for our motorcycles. Maybe a project for when it gets too cold to ride.


Filed under: Kindle hacks, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1TYRmjN
via Hack a Day

Wednesday, 19 August 2015

Astro Pi and the Space-Byrds

The Space-Byrds

Clever Year 7 students at Thirsk School have devised an amazing tracking system for the International Space Station and have become Astro Pi competition winners. We speak to their teacher, Dan Aldred, to find out more…

Can you tell us more about your students at Thirsk School who won the competition?

It was actually a code club that I’d set up at lunchtimes. The original reason for setting it up was to give students, who were perhaps what we call vulnerable learners, something to do at lunchtime – students who would struggle being in the playground; maybe their behaviour means they would get into difficulty, or they were just a bit more timid and so didn’t have anywhere to go. Also, I was keen on making sure that the coding and the Raspberry Pi wasn’t about bright kids – I wanted to make sure that low-ability kids and special needs kids had access to coding and all the benefits that it offers.

International Space StationSo I set up a coding club for lunchtimes, started with Minecraft, Sonic Pi, picamera photo hacking, and then this competition came along and I said, “Look, this is the opportunity we’ve got: a space rocket’s going to go up to the ISS with an astronaut and an Astro Pi. What do you think?” They were like, “Yeah! Let’s do it, let’s do it!” And it grew from there – we ended up with eight to ten students who stayed every lunchtime for seven weeks, creating their winning solution.

That’s amazing dedication!

It is! In the end it became quite social, and by about week four they could see the results of what they’d made and start to get excited, thinking that it could actually win. In the first week it was just a concept, an idea, and they had no idea how to build it, what they were going to do, they didn’t know what an Astro Pi looked like. All they knew was that there was the potential to win a competition at the end of the day. So to begin with it was just pitching it to them, the dream that they could win this and send something up into space, and I think that was the hook – here’s a computer in your hand that might go up into space. But yeah, the dedication from them was huge, really motivated.

It must have been great for building a sense of community too, particularly with the vulnerable learners.

It was very exciting and rewarding personally, too. We started off with a shared document, so all the students could access the code from home, and what I found was that as the weeks went on, the students were logging in more frequently to check their code, add their sections, and then they started editing each other’s code. It was so polite – they’d come in at lunchtimes, for example, saying, “I noticed an error in your code last night. I changed it – hope you don’t mind?” And then of course they had a common goal they could talk about, and they started talking about space and physics, different space films they’d seen, and of course as we were creating it they were talking about the different countries, whether they’d been to that country, what it’s like, what’s the capital – at work we call them learning conversations; they were learning just through talking around the subject.

Organic, peer-to-peer exchange.

Exactly – it wasn’t manufactured. It was completely natural, which was absolutely brilliant. But yeah, they’ve forged some quite good friendships. And confidence as well – these are students who perhaps at the beginning when they started school (they were Year 7 students, so they’re 11 years old now) wouldn’t really go into the playground, were perhaps fearful of the dining hall, were maybe bottom-set students struggling with maths and English, or had a behaviour issue, and suddenly they’ve got quite a good status now amongst Year 7. And obviously the press have gotten hold of it and various local papers have run pieces on it and printed pictures of them, and I think it’s given them a real boost. Rather than being labelled as an underachiever, a pupil premium child, having the potential to achieve, etc – well, they have all actually overachieved now!

It must have been amazing for their confidence and social skills, working in a collaborative environment like that.

Definitely. The program that they made was actually very simple in essence – it’s just the fact that it’s so big that took the time. In terms of the coding, it wasn’t particularly difficult; it was just a case of there being 96 countries filled with 96 different flags, and 96 different languages that you have to find out and create messages for. So once they’d mastered the skill they were learning, it was then a case of repetition and discovery. They all knew what the skill was – it wasn’t the case that they were working separately on 50 different parts; they were all working on the same skill. So, “this session we’re going to be doing five countries’ flags, five countries’ messages – you two work on that one. Who do you want to pick?” And they’ll go, “Ah, I’ll have Brazil”, “I’ll have Outer Mongolia”, “Oh I’ll have Russia”, “I’ll take Kazakhstan”. And they were all doing the same set of skills, they were all coding in the same style, so they could help each other out. The bit that was individual at that point was that the flag for Kazakhstan is different to the flag for the UK, and stuff like that. But creating each flag is a similar set of code – obviously the colours are slightly different, and the setup, but in essence the code was the same, so they could support each other, and say, “Oh, actually you’ve missed this bit out on the red, green and blue – you haven’t got a value for the blue, that’s why it’s this colour.” So yeah, they’ve learned a heck of a lot of skills and they’ve also learned a lot about the other countries as well, through supporting each other.

In terms of the logistics, how did the division of the work happen at the beginning and the end of the project?

Astro pi flight caseThere were two parts to the competition: the first was to pitch an idea, and you were then selected from that to go into the second stage. So the first couple of lunchtimes it was basically just brainstorming ideas, listening to what everybody wanted to come up with. We had some fantastic concepts, like, “Can we strap it to the astronaut, so that when he or she goes outside the ISS it can check for radiation?” Despite having the great ideas, we didn’t quite know how much of it was realistic! I contacted Raspberry Pi and asked for a breakdown of what we can and can’t do, and when we got the breakdown it said it was going to be stationary, it was going to be inside the station, it’s not going to be moving, there’s going to be no screen and the astronauts really need to have minimal interaction with it, other than maybe starting it up and pressing a couple of buttons. So then we could shrink down the list, and I suppose the final idea came out because one student said, “So they’re in space… how do they know where they are?” We talked about the different instruments and the fact they’ve got GPS or an equivalent tracking and co-ordinating system, but when they look over a country, how do they know which one they’re looking over? And that’s where the idea came out – why don’t we have our Astro Pi system show the astronauts the flag of the country and a message, so they could compare that with the instruments on-board the space station and see if it works?

ISS TrackerSo they all decided on that, we pitched it to Raspberry Pi, who said it was a great idea and sent us the kit, we got started, and picked out 96 major countries. For that, the students used the ISS trackers online and basically looked at the plot map of where it goes. It was quite a time-consuming process because they had to write down all the countries they were going to complete and put them into a shared Word document. I then put the example code at the top for England with the UK flag – from there they just had to work up the countries. What we found was that some of the students would come in and they wouldn’t do any coding for the session – what they’d do is eat their lunch and just go round each student, asking things like, “Have you done the Democratic Republic of Congo yet?” And they’d respond, “No, that one will need doing – can you do that one, please?” And some students would say, “I don’t know which one to do next,” and another student would say something like, “Okay, have you done Russia yet? I don’t think there’s a flag for Russia.” Towards the end of the project we had a couple of students who’d set up a spreadsheet with all the 96 countries, 96 flags, 96 messages, and they began ticking them off.

And we had a couple of Astro Pis – one to test the flags and then the other was running all the co-ordinate tracking, so some of the students began working on that. It was probably by week five that we started to integrate the two together, so that if the ISS positional data was within the boundaries of the country then the flag pops up. Towards the end we could start to refine the longitude and latitude so that you got an exact position for the country. One student was in charge of finding out all the longitudes and latitudes for the countries – an absolutely painstaking job because there were four points of origin for most countries, and there are some countries in L shapes so we had to do six or eight points. It’s not perfect – it’s quite a crude model and we’re looking at a way of making it more accurate – but for the purpose of saying we’re over Australia, for example, if you’re within these four points of longitude and latitude then you’re within the boundary. So one student was responsible for that.

So where exactly is the Raspberry Pi getting all of the longitude and latitude data from?

Here’s the official press release of it: “the program uses telemetry data provided by NORAD along with the real-time clock on the Astro Pi to computationally predict the location of the ISS so it doesn’t need to be online. It then works out which country’s territory the ISS is above and shows its flag on the LED matrix along with a short phrase in the local language”. So that’s the official blurb.

The coding bit for the flags etc was tricky, but the mathematically challenging bit was the TLE file, which was a two-line element file that looks at the time on the Raspberry Pi and makes a calculation of where the ISS should be. From that it returns the longitude and latitude position. The students wrote conditional statements – if it’s within this longitude and latitude then it must be over this country, and therefore return this flag; and if it’s not then it displays a little graphic and says ‘calculating current position’. The experiment is comparing that set of results off the Raspberry Pi with what the ISS tracking system actually says on-board. It makes 19 orbits a day and can go out of sync – sometimes they have to move out of the way of space debris and it’s not on the path, sometimes there’s an adjustment to make if there’s a drop-off or something, or if another spaceship docks they might move to another position of orbit that isn’t calculated. So the TLE file is updated 19 times a day, and you have to download those two lines of code, pop it into your Python program and then it calculates the new positions. One of the biggest challenges was getting the time correct because the Raspberry Pi wasn’t online when they were testing, so the Raspberry Pi was still at 10:30pm even though it was 1 o’ clock in the afternoon, and it was throwing out all these wrong countries and locations. We were scratching our heads for a little while and then we realised that the time had to be set correctly. But the Raspberry Pi Foundation has been great – they worked with us to ensure that it’s accurate when the Raspberry Pi boots up, that the Astro Pi and Raspberry Pi are in sync, and that it’s the correct time. On-board the Astro Pi there’s a Real Time Clock that runs off a battery and keeps the clock count ticking over, like CMOS in the regular computer, just to keep the clock ticking while the power’s off.

What’s the next step for the project, then – are you completely ready for launch day, just waiting for Tim Peake to go up?

Tim PeakeYep – Raspberry Pi has been in contact. Tim’s going up in December but on the 11th August he’s doing a test run in Germany, which basically involves him being in a simulation for a number of weeks, and within that simulation he will run a number of experiments, including our ISS tracker experiment. So the code at the moment, the project we’ve built, is staying as it is and it’s going to be used as a test run so Tim can check it works, that there’s no malfunctions, etc. And then in December he will fly up to the ISS and begin experiments there for six months, sending the data back to the UK.

So at that point, will you be running the experiment concurrently with an Astro Pi at Thirsk School?

Yep – as soon as we get confirmation he’s on board, we’re going to set up a copy of the ISS tracker and record the data from each day, and then with the two pieces of data that he returns – the ISS’ real position from their flight instruments and then our ISS Astro Pi tracker – we’ll compare all three.

In terms of September when we return to school, the maths department are on board now and they are going to build us a pixelated map of the world, where each element of the country boundary will be within a pixel grid reference, so what we can actually do is take the longitude and latitude of each country and break it down to a pixel position. At the moment, what we’ve had to do for ease of use for the students is basically draw rectangles or squares around the countries using four points of origin, or with countries like Columbia, which is L-shaped, we’ve drawn a rectangle at the top and a rectangle at the bottom to get six points. So it’s accurate, but with somewhere like Russia and Kazakhstan, as it goes over it actually undulates between the two different countries, so for two minutes it’s in Kazakhstan and then for two minutes it goes into Russia and back out again. So for that kind of thing, our measurements weren’t accurate enough to show that, but obviously a pixelated version of the atlas is going to be better.

Will this be a second branch off the main experiment or will you be updating the code to be sent up in the Astro Pi?

I was talking to Raspberry Pi and they said they’re more than keen for us to continue working on it. We’ve got September and October, and we’ve got the maths department on board, so it’s just a case of building a dictionary now – we’ve got all the co-ordinates, so once it’s been pixel-mapped then we can build the dictionary and pop them back in. So we’re hoping to have that ready in time – the experiment’s still the same, it’s just making it more accurate. It’s very exciting!

I bet you’ll have an awesome live-updating map going once you’ve got the pixel map sorted!

That’s a good idea… I’d also like to set up some kind of live web feed so that everyone can compare the live ISS data with what our live Astro Pi ISS tracker is saying. A lot of the parents have contacted me, saying, “This is great – my son/daughter is talking about this and they’re so excited.” I’m going to share some pictures on Facebook and Twitter because I think when people actually see it, they’ll understand it better. If I put a picture of some LEDs showing the Brazilian flag and say it’s tracking the ISS, it doesn’t really mean a lot. But if you can see there’s the ISS over Brazil, and here’s the Astro Pi with the Brazil flag, and now it’s going over Columbia you can see the flag change, and oh there’s the language…

That’s the other thing as well – all the kids were learning all the different languages, so they were going, “What do they speak in the Democratic Republic of Congo? Oh, it’s French. Sir, why do they speak French? It’s miles away!” The cross-curricular aspect was absolutely fantastic – you had physics, coding, maths, geography with the latitude and longitude, then you had the flags, the size of the country. So one of the best moments for me was when they were building the longitude and latitude comparisons, and they were saying, “This one is -23.7 and -24.7”, and then they went to another country and said, “this one is -16 and -65.7… wait a minute, that’s huge!” They were getting numerical comparisons for the countries – so the UK is very small, I think it’s two or three degrees, and somewhere like Russia, that’s nigh-on 45 degrees latitude and longitude difference – and they had a mathematical model of how big these countries were. And of course, students are used to looking at a map or atlas that has countries out of proportion – the UK is not as big as it’s shown on the atlas – so the students were saying, “Hang on, so if this is this big but the States are supposed to be this big, it doesn’t work!” So it challenged their perceptions and showed them that when you look at a map or an atlas, the countries aren’t in actual relational size. It challenged their conception that the UK is massive. So we had loads of geography, and a bit of astronomy as well, talking about planets and things.

What was really nice and couldn’t have been better timed was that when the announcement of the winners was made, it was the same day that the Pluto photograph was out in the UK as well. The conference where they announced the winners was the same conference where they were showing the photograph that had come back from Pluto, and it was great because there was so much press about that and then this was coming in as well – it was absolutely brilliant. It added a little bonus to it because the kids felt there was something bigger, rather than just the competition – this was a huge discovery, the first couple of photos of Pluto coming back from the new satellite.

It locates what they’re doing inside a live, active field of science, which is all about discovery and creativity. Must have been a great experience.

Going back to what you were saying about the students and building confidence, the other winning schools – if we’re to get political now – were all independent schools. So you’ve got Westminster School, one of the top London schools, you also have Magdalen College, Oxford, and there was another independent school as well. So in terms of the political education landscape, you’ve got privately funded schools who’ve got access to a wealth of resources and expertise, and then we had this rural school, which is state-funded – well, under-funded – with students in these 1950s buildings that are falling apart, and yet they’re up there with these independents. One of those schools even had access to a light aircraft! Someone actually wrote in on the Raspberry Pi website saying, “Hang on – how can you expect schools to compete with this? You’ve got a primary school and a secondary school state-funded, and then you’ve got a school that’s got access to a physics lab and a light aircraft for testing.”

It would have been a real shame if it was just privately-funded schools that had gone through. I’m glad that the selection of winners reflects that the idea is the most important thing – it’s not about the school with the most resources.

Definitely. The Raspberry Pi is there for education – I subscribe to their ethos that coding and computing can move students forward and it can open up new vistas to them. And it really has done this – I mean, these ten students when they arrived in September were standard students, a piece of data on a system that come in with predictions from primary school of how many As and Cs they’re going to achieve in five years time, and now they are going into Year 8 and they’re among the first set of 10 or 15 students who are going to be sending a piece of code to a space station, and suddenly that’s a huge springboard for them – and they’re also speaking to their friends, who are asking, “What’s this coding then?” And they say, “Well, why don’t you come along!” And it’s not just about the coding – it’s always about the output, it’s about what you’re creating, with the code being the language that allows you to do that.

Astro PiThe best thing about this was that it happened over seven weeks. There was a deadline to meet for the competition, but there wasn’t a deadline in terms of ‘you have to have achieved this by this week, otherwise you’re underachieving’. So the students had time to make mistakes, time to try different things, time to have those conversations with each other, whereas in a typical, traditional classroom setting, you’ve got 50 minutes, you’ve got to show that the students have progressed, and if one student hasn’t progressed then you give them extra support. Here, we didn’t need to do that – it was much more fluid. I’m a big believer in that if you’re writing code, you need the time to think it through, and I think we’ve all been in that position where you’ve spent 24 hours building something and it’s still not working, you go away for two days, then you can come back and you’ve suddenly got it. If it’s led in a traditional classroom setting – a 50-minute ‘you must code this, this and this’ – then it loses its power and its organicness. I think if it’s run as a club, or externally, or over time, then students have the time for all this. We had students coming in in the morning saying, “I looked up this flag last night – did you know that this one only has three colours? I thought it had four”, and asking about the red, green and blue values, wondering why 255 is the top value. So they were learning about these values and hexadecimal, and I didn’t want to stop and say, “Right, that’s off-class now – you don’t need to know that.” I had the time – I had seven weeks – and I could go in and spend time looking at converting binary to a value of colour, why it is 255 and not 256. One of the things that they loved is that there are 256 values but it only goes up to 255, so they got that the 0 is actually a value included in it, and it’s the first position or number when you’re coding. I could have made a lesson about that, but it never would have been as organic – natural self-learning, basically. You could never force those questions in a lesson without prompting them, and then it becomes a bit stilted and I don’t think they remember it as much.

When it started, the club was just running every Monday – now we’re up to every lunchtime, five days a week. And we’ve got a beginner’s club on Monday, so what happens is the students who’ve been doing it since November last year come along and they support the new kids, and they feel really good now because they know everything – sudo idle and all the different commands – they remember how they were when they first started. Tuesday is the dedicated one for Minecraft. Wednesday is the picamera. Then Thursday and Friday – I asked the students what they wanted to do when they start up again in September and they said motors: “We want to build a car – build something that we can control from the computer”. So I don’t know what we’re going to do yet or how we’re going to do it, but that’s going to be part of the learning. We’ll get some Pibrellas out, we’ll get some Raspberry Pis out, we’ll hook up some motors, control them, and I know that one or two of them will say, “Well I’ve got some LEGO at home. If I build a chassis can we put it in there?” And they’ll start to build the project up and introduce more people to it and new elements, which makes it exciting. They don’t go to the club saying, “I’m going to learn coding.” They go there saying, “I’m going to build a car. I’m going to build a tank. I’m going to hack Minecraft. I’m going to play the Mario theme tune in Sonic Pi.” When I was learning code at school, the emphasis was just on the code – it’d be like an English lesson, learning grammar. And of course, you need to know that – but if you read a book then you start talking about how it’s structured, the different chapters and characters, and you see through the words to the story and you get a feel for it. I think this is where the Raspberry Pi is so powerful – it strips away that “I’m learning to code” and what you’re actually doing is learning to control a motor, for example. The kids are coming in writing six or seven lines of code but not thinking of it as coding, they’re thinking that now they can build a trampoline or can make the water turn to ice in Minecraft just by walking on it. And that’s what inspires them to do it. Exciting, isn’t it?

Want to see the code for yourself? Check out the new issue when it hits the stores next week – Dan has written a great tutorial on creating the ISS tracking software.

Track the ISS



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1E36rK5
via IFTTT

Sunday, 16 August 2015

Liked on YouTube: DefCon 23 Video Demo: Rogue DHCP/DNS server gaining root access to target

DefCon 23 Video Demo: Rogue DHCP/DNS server gaining root access to target
Narrated version of Defcon 23 demo video: "Rogue DHCP/DNS server using Shellshock exploit to gain root access to target system."
via YouTube http://youtu.be/ZdL_6XF1w3o

New Version of Raspberry Pi Thin Client

It is funny how many times you use your full-blown PC as a terminal to another computer (which is quite often not as capable as the terminal computer). If all you need is a remote display and keyboard, a Raspberry PI would be enough. One of the newer Pi 2 boards would be even better.

You could roll your own set of remote access software, but you don’t have to. [Gibbio] has already created a thin client image called RPiTC and recently released version 1.4. The build supports diverse remote protocols including Microsoft Remote Desktop, Citrix, VMWare, and even X3270.

It supports WiFi and VPN. We were a little disappointed that it didn’t seem to have any serial communication programs (in case we wanted to build one into an old TeleType case). Of course, it is just a Linux system so you can install anything you want or need.

If you don’t think it is much of a trick to turn a computer into a thin client, we’ve covered going in the other direction before, too.


Filed under: Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1hFMH55
Taken From http://www.hackaday.com

Commodore C16 Resurrection with a Raspberry Pi

[lactobacillusprime] had a non-working Commodore C16 and too many Raspberry Pi computers, so he decided to bring the C16 back to life by emulating it on the Pi. At the heart of the project is the Pi, along with a small board that converts the old style Commodore keyboards (and joysticks) to a USB port.

Once you have the keyboard as a USB port, the rest of the project is more or less mechanics and software. [lactobacillusprime] did a nice job of getting everything in the new case, along with all the I/O wires routed through the existing ports. For software, Emulation Station does the job of launching the Commodore emulation on the Pi.

Of course, there’s no reason to limit yourself to just the Commodore emulator. Emulation Station along with the right back end emulators will allow this machine to play games that no real Commodore C16 could.

Of course, we were happiest to see him boot up Commodore 64 BASIC. Perhaps we should complete all those half finished C64 BASIC projects we started back in the 1980’s. In general, we hate to see old computers gutted instead of repaired, but at least this one will continue running its software. If you are upset about seeing a machine gutted,  you can always switch over to our previous coverage of putting Commodore guts in a new box.


Filed under: classic hacks, computer hacks, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1IT7iLY
via Hack a Day

Commodore C16 Resurrection with a Raspberry Pi

[lactobacillusprime] had a non-working Commodore C16 and too many Raspberry Pi computers, so he decided to bring the C16 back to life by emulating it on the Pi. At the heart of the project is the Pi, along with a small board that converts the old style Commodore keyboards (and joysticks) to a USB port.

Once you have the keyboard as a USB port, the rest of the project is more or less mechanics and software. [lactobacillusprime] did a nice job of getting everything in the new case, along with all the I/O wires routed through the existing ports. For software, Emulation Station does the job of launching the Commodore emulation on the Pi.

Of course, there’s no reason to limit yourself to just the Commodore emulator. Emulation Station along with the right back end emulators will allow this machine to play games that no real Commodore C16 could.

Of course, we were happiest to see him boot up Commodore 64 BASIC. Perhaps we should complete all those half finished C64 BASIC projects we started back in the 1980’s. In general, we hate to see old computers gutted instead of repaired, but at least this one will continue running its software. If you are upset about seeing a machine gutted,  you can always switch over to our previous coverage of putting Commodore guts in a new box.


Filed under: classic hacks, computer hacks, Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1IT7iLY
Taken From http://www.hackaday.com

Saturday, 15 August 2015

Covert Cricket Score Tracker Gets Around Office Rules

[Rohit Gupta] was looking for a stealthy way to keep up with the scores for his favorite game: cricket. Unfortunately, his office blocked access to most sites where he could watch the game, so he came up with a covert way to track the score on a small LCD screen. Using a Raspberry Pi and the web scraping program BeautifulSoup, he wrote a program that grabbed the score once a minute, and displayed it on a screen salvaged from a Nokia 5510 cell phone, driven through the Adafruit 5510 Python display library. Web scraping is a technique where a program grabs a web page, scrapes all of the content off it and processes it so only the data that is needed remains.

[Rohit] doesn’t name the web site that he scraped the score from, but there are two good reasons for that. Firstly, this hack relies on his office not blocking it, and secondly, many web sites frown on web scraping like this, as doing it too often can overload their servers, and you obviously don’t see the ads that the site is running. So, it is a technique that should be used with some caution. That aside, this is  a great example of a stealthy way to display information that you want to track, but without obnoxious (and obvious) alerts popping up on screen. And, given that cricket games can often go on for several days, that’s a good way to keep track of the game you love and keep your job.

Need a little primer on web scraping? Check out this guide.


Filed under: news, Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1WtTDlT
Taken From http://www.hackaday.com

Friday, 14 August 2015

Practical Raspberry Pi Projects out now!

The Raspberry Pi is a very powerful device that you can do a lot with, but a lot of people just use it for media centres. Upgrade your Raspberry Pi with an entire book filled to the brim with amazing projects you can do with your Raspberry Pi.

With around 50 projects to try out, including building robots, making a Minecraft console, timelapse photography, making a synthesizer and many many more, there’s bound to be something you’ll want to do with your Raspberry Pi.

You can grab Practical Raspberry Pi Projects in stores and online at the Imagine Shop. Improve your relationship with your Raspberry Pi today!



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1MrHnyV
via IFTTT

Junked Inspection Camera Given 15-Year Face-lift with Raspberry Pi

The nice thing with having a hacker cred is that family and friends are always on the lookout for stuff they think might be useful to you. [Craig Hollabaugh]’s son-in-law found an inspection camera and thought it would be handy for his hobby work. The MagniSight Explorer was first introduced in 2001. It is good for surface mount board work and inspection, except that its analog 480p video is quite dated by today’s standards. So [Craig] upgraded it for crystal clear 1080P/30 video and 5 megapixel images using a $35 Raspberry Pi 2 and a $26 Raspberry Pi Camera Module. After the upgrade, the unit is now a great tool for SMT rework.

There’s not a lot to the upgrade, but [Craig] gives a nice rundown in the 15 minute video of the MagniSight’s internals. He shows us the original analog camera module and its video card, which is able to do some additional processing like black and white output and reverse video (negative). As he mentions, it would be easy for him to do the same via software on the Raspberry Pi. A video camera lens takes care of magnification and two shafts coupled to it via flat belts (rubber bands?) take care of zoom and focus. A front coated mirror angled 45 degrees in front of the lens turns the optical path 90 degrees to allow the lens/camera to “look down”. After experimenting a bit to find the correct focal spot behind the lens unit for the Raspberry Pi camera, he covered the camera module with insulation tape and then just glued it to the old camera mount. After hooking it up to an HDMI monitor, the results are quite nice and he reckons he can easily work with components down to 0402 in size.

He’s got a couple of more upgrades in mind to make the system even better. He plans to replace the existing compact fluorescent lamps with a string of LED’s which will provide more uniform illumination. Plus, he can control their brightness, and selectively turn them on or off to get the optimum lighting. The other interesting upgrade would be to add stepper motors to the X-Y translation stage and automate their movement. After looking up a board file and its BoM, he may even be able to search for a part designator and move the stage to bring the part into focus.


Filed under: Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1DRCjRt
Taken From http://www.hackaday.com

Thursday, 13 August 2015

Tutorial – Install Apache and PHP on a Raspberry Pi 2

I’ve been running LAMP setups on Raspberry Pi’s for years, so am excited to use the little pocket-sized powerhouse that is the Raspberry Pi 2 as a web server. This is the first in...

from RaspiPress » Tutorials http://ift.tt/1MqzBW8
via http://ift.tt/1MqzBW8

Raspberry Pi and Windows 10 IoT Core: A Huge Letdown

Raspberry Pi and Windows 10 IoT Core: A Huge Letdown

Raspberry Pi Field Unit (RPFU)

Raspberry Pis are great for tons of projects, but if you want to use them outside, you’re going to need a waterproof enclosure. Not happy with what was available, [Jay Doscher] went all out and created the Raspberry Pi Field Unit — a piece of tech that looks straight out of the Call of Duty franchise.

Wanting it to be extra durable, [Jay] started with a Pelican Case 1300 — the standard in electronics protection. These come with a Pelican panel mount, so he had some plastic laser cut specifically to fit the panel mount, and attach all of his components. Speaking of components, he got only the best — inside is:

  • A Raspberry Pi 2 with a few PIHATs (permanent prototyping shield)
  • A 10.1″ IPS display
  • A high power wireless USB dongle
  • Weather proof USB and LAN connectors
  • An RTC for when it’s off the network
  • A 12V power supply for running off solar panels
  • DC-to-DC adapters to bring it down to 5V
  • A whole bunch of hardware from McMaster-Carr

He has a great write-up over on his blog, and a fantastic section on lesson’s learned during the build. If you’re looking to do anything even remotely similar, it’s worth a read.

Rugged Raspberry Pi

For a smaller outdoor case idea, SnoTunes is the perfect way to use a Raspberry Pi for an outdoor snowboarding music setup!


Filed under: Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1N5644o
Taken From http://www.hackaday.com

Raspberry Pi Field Unit (RPFU)

Raspberry Pis are great for tons of projects, but if you want to use them outside, you’re going to need a waterproof enclosure. Not happy with what was available, [Jay Doscher] went all out and created the Raspberry Pi Field Unit — a piece of tech that looks straight out of the Call of Duty franchise.

Wanting it to be extra durable, [Jay] started with a Pelican Case 1300 — the standard in electronics protection. These come with a Pelican panel mount, so he had some plastic laser cut specifically to fit the panel mount, and attach all of his components. Speaking of components, he got only the best — inside is:

  • A Raspberry Pi 2 with a few PIHATs (permanent prototyping shield)
  • A 10.1″ IPS display
  • A high power wireless USB dongle
  • Weather proof USB and LAN connectors
  • An RTC for when it’s off the network
  • A 12V power supply for running off solar panels
  • DC-to-DC adapters to bring it down to 5V
  • A whole bunch of hardware from McMaster-Carr

He has a great write-up over on his blog, and a fantastic section on lesson’s learned during the build. If you’re looking to do anything even remotely similar, it’s worth a read.

Rugged Raspberry Pi

For a smaller outdoor case idea, SnoTunes is the perfect way to use a Raspberry Pi for an outdoor snowboarding music setup!


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1N5644o
via Hack a Day

Wednesday, 12 August 2015

Join Linux User & Developer as our new Staff Writer!

We’ve done some amazing things in our magazine over the last few years, even if we do say so ourselves. We were the first magazine to start extensively covering and bringing you Raspberry Pi content. We’ve reported on new goings on at IBM, SUSE, Canonical and much more with one-to-one interviews with the best and brightest members in the industry.

Now we’re opening these exciting doors to you. We have an opening for a Staff Writer at Linux User & Developer, and we’re looking for you to fill it. Yes you!

We’re looking for someone who is both a great writer and knows their way around a Linux distro, along with the ability to write a bit of code and use a Raspberry Pi. Not only will you be tasked with writing articles for the magazine and website, you’ll also be able to pitch your own features for every part of the magazine that could make it to the cover.

If you think that’s you, and it very well may be, you can find out more details and apply for a job over on the Staff Writer job page. We look forward to hearing from you!



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Wi1pz8
via IFTTT

Emulating a Hard Drive With The Raspberry Pi

[Chris] recently moved a vintage IBM 5150 – the original PC – into his living room. While this might sound odd to people who are not part of the Hackaday readership, it actually makes a lot of sense; this PC is a great distraction-free writing workstation, vintage gaming machine, and looks really, really cool. It sat unused for a while, simply because [Chris] didn’t want to swap out piles of floppies, and he doesn’t have a hard drive or controller card for this machine. After reviewing what other retrocomputer fans have done in this situation, he emulated a hard drive with a Raspberry Pi.

The traditional solution to the ‘old PC without a hard drive’ problem is the XTIDE project. XTIDE is a controller card that translates relatively new IDE cards (or an emulated drive on another computer) as a hard drive on the vintage PC, just like a controller card would. Since a drive can be emulated by another computer, [Chris] grabbed the closest single board computer he had on hand, in this case a Raspberry Pi.

After burning an EPROM with XTIDE to drive an old network card, [Chris] set to work making the XTIDE software function on the Raspberry Pi side of things. The hardware on the modern side of the is just a Pi and a USB to RS232 adapter, set to a very low bitrate. Although the emulated drive is slow, it is relatively huge for computer of this era: 500 Megabytes of free space. It makes your head spin to think of how many vintage games and apps you can fit on that thing!


Filed under: classic hacks

from Hackaday » raspberry pi http://ift.tt/1N1T93a
via Hack a Day

Thursday, 6 August 2015

Hackaday Prize Entry: Detecting New Meteor Showers

Go out to a field on a dark night, far away from city lights, and you might just see a shooting star. A single meteor is just a tiny fraction of all the space dust that hits out atmosphere every day; most of it goes completely unnoticed. To get a better idea of where these meteoroids come from, [Dario] and [Denis] have come up with a network of meteor-detecting ground stations to search for these extraterrestrial visitors and make it possible to retrieve the largest of these fallen stars.

This project started at the Croatian Meteor Network, a team with about two dozen surveillance cameras pointed skyward as a unblinking eye, looking for meteoroids entering the Earth’s atmosphere over the Balkans and the Adriatic sea. When two cameras detect a meteor, the path it came from – and its orbit around the Sun – can be computed. The team has already found a possible new meteor shower (PDF) that is active from late August to the middle of September.

With hundreds of cameras scattered around the globe, it’s possible to triangulate the position of these meteors and their orbit around the Sun, just like what was done with the innumerable Russian dash cams after the Chelyabinsk meteor. It’s a great project, and also one that requires a lot of computer image processing – a favorite around these parts.

The 2015 Hackaday Prize is sponsored by:


Filed under: The Hackaday Prize

from Hackaday » raspberry pi http://ift.tt/1NbmV2k
via Hack a Day

Amazon

Donate

Donate Towards More Raspberry PI's for Projects