Saturday, November 29, 2014

Better than Arduino How-to : Arduino++ - Why-Not?

Some people see things as they are and ask why. I see things as they might be and ask "why not?". Some things in the Arduino ecosystem that might benefit from some why-not-ism : You plug your Arduino into the PC and launch arduino software. WTH can't it automatically find out what board it is and which port you're connected to? One I've already ranted on : WTH can't the authors of the example code specify which boards the code will run fine without mods and (in the comments) what mods need be made for other boards. Better yet, why not some freaking pre-processor directives that make the whole thing a breeze?

Thursday, November 27, 2014

Arduino Duemilanove Sainsmart LCD Panel

Why they can't put comments in the example code to tell you what adjustments you need on a per-board-flavour basis, I don't know. Thou gets what thou payest fur.

In this case, it's teh LiquidCrystal lcd(... thingie )..
(And please grow up blogger.. I actually had to hack HTMl to get this to display correctly. I think you know which part needed the <)
#include <Wire.h>
#include <liquidcrystal.h>

LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

void setup()
{
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop()
{
    // your main loop code here...
}

Wednesday, September 24, 2014

Keeping Your WAN SSH Session Alive

Your ISP might kill an idle SSH session (why?). So, if you're using Putty, here's what you can do :

(yes, it's that simple)

Just set this number to 10 - every 10 seconds, it'll send a keep-alive packet..


Handy for Raspberry Pi hacking - so says the Right Honourable Harry Perkins, steelworker from Sheffield.

Sunday, September 21, 2014

Cheezy Surveillance System with Better UI

Would you like to set up a $5 (Fry's) webcam in your home and be able to look at it from anywhere on your phone?

If yes, then...

(assumes fswebcam is installed on your Raspberry Pi and you have a cron job (see older post:)  to take a photo ever so often and that pic is being saved at ~/Desktop/snapshot.jpg)

Last year, I had an Airbnb guest stay at my place when I left town. I only cared about the garage being secure. So, I set up a pi-connected-webcam there. I had to use an SFTP client on my phone to pull the pic each time. We (my smarter buddy who helped me with the setup) couldn't get HTTP to do it..

Today, we figure out that it's just that Cox is blocking port 80 (HTTP). (My buddy ran nmap to reach the conclusion)

So, pick another port - maybe 1025 and, in your (assuming you've installed lighttpd as your webserver :) ) /etc/lighttpd/lighttpd.conf, change to see :

server.port      = 1025

Now, in your /var/www, you need a link to the snapshot.jpg, so do :

(after you cd to /var/www)

(might have to do sudo)

ln -s ~pi/Desktop/snapshot.jpg

Then, you can, in a browser, even on your phone,

whatever.wherever.org:1025/snapshot.jpg

See older post on how you can get the whatever.wherever stuff done right - using freedns.afraid.org.

I recently installed inadyn to update my IP address on that host automatically...

Happy securing :)

Here's an alternative to freedns.afraid.org :

http://www.instructables.com/id/Host-your-website-on-Raspberry-pi/step5/have-your-domain-name/

Wednesday, September 17, 2014

WPA Mode Not Immune Either

With WEP, I was losing my WLAN link every few hours. WPA is only an upgrade to a "few days". I had to reboot my Pi today just to be able to get back in from my PC through Putty..

Tuesday, September 2, 2014

The Trouble with Mr. Motion

I thought this one was a dream come true..

http://www.projects.privateeyepi.com/home/webcam-surveillance-project/webcam-surveillance-monitor

I guess not, unless one's a PhD in computer science. How the hell is one supposed to fix stuff when it doesn't behave as expected? Yuck!

...

A thousand apologies! It works!! And the picture quality in the movie isn't bad!! I could recognize myself on this crappy camera! Just use winSCP to port the swf file over to windows and look at it with Chrome!! Phew! Now, where can we go with this?

I did update the _port to 8081 (original) instead of 8085, but that shouldn't be necessary..

I thought I should give it some credit and half-heartedly went in the living room and turned on the light and thought that should qualify as motion - since the successive frames differ considerably and - yes! There's a tiny .swf file there and that's exactly what it shows! Looks like christmas light lighting up the room - a 0.5 second movie - on/off/on/off..

Excellent work by Kenneth Lavrsen.

Sunday, August 31, 2014

Sir Eben Upton

Please help out Jake Beningo :

Here's some stuff from his latest course :

Script Automation

•Login Automatically
–sudo nano /etc/initab
– comment out
•1:2345:respawn:/sbin/getty 115200 tty1
–Add
•1:2345:respawn:/bin/login -f pi tty1
/dev/tty1 2>&1
•Script start on login
–nano ~/.bashrc

–At the bottom add “sudo python /path/pws.py”

So, what's my problem? How the hell are you supposed to find out such stuff on your own? Is this teaching or spoonfeeding? Do you want to give a man a fish or teach him how to fish? A good teacher makes himself unnecessary. You need to motivate finding out such information and teach how to go find it!!