msgbartop
Adam Palmer MBCS CITP, Linux, PHP Programmer, MySQL Developer, Embedded Hardware, Security Consultant
Did my blog help you? Please link to me!
  dns test
 
RSS Feed
msgbarbottom

31 Jan 10 Linux Controlled Door Entry

Having recently moved to a new apartment, one of the first things that I decided to do was build an RC entry system ;-)

Here’s some pictures:

Door Door

The black box at the top is a simple Velleman RC control kit and the black box below is a 240VAC->12VDC regulated converter.  The Velleman RC receiver has two relays, one connected to an electric strike lock and the other connected over the button input in the entryphone which unlocks the main door.

On the RC transmitter there are two buttons, and as they are currently connected, one opens the main door and one unlocks the electric strike on the apartment door, with a 5 second timer on each.

This works well so far and I have paired the transmitters with the receiver so that default unpaired transmitters will not activate the relays. A few weeks on, having already locked myself out once, the next step is to extend this project.

I intend to have the RC transmitter connected separately to some embedded linux board, probably the spare Alix and Phidgets boards I have from the robot I built a while ago. The linux board will signal over a separate frequency to this door entry system. The linux board will perform a variety of functions from logging entries to automated surveillance.  Additionally the linux board will have net access and possibly run asterisk. I can either SMS my way in or alternatively call in to asterisk and do some voice authentication. More to follow when I actually have time to get this done..

Tags: , , , , , ,

19 Sep 09 Installing Linux on the Embedded PPC50 Touchscreen

I personally really like this touch screen PC! I’ve installed Debian (of course), graphical interface, and configured the HUAWEI data card along with the TSCOM touchscreen drivers.

I also modified the boot up to log in and start the graphical interface automatically. Using xvkbd for a virtual keyboard works really well, and I might just have to carry this around in the car along with the datacard for those emergency situations.

It’s a simple x86 with 1GB diskspace and 1GB RAM. The device takes a simple 12V/6A input and therefore wiring it up to a car, battery, or other portable power supply shouldn’t be a problem!

Any ideas what next?

Tags: , , , , , , , , ,

04 Sep 09 Multithreaded Multi-Connection TCP Proxy Tunnel Update

Further to post http://www.adamsinfo.com/multithreaded-tcp-proxy-tunnel-code/

I have received a report from a user experiencing the following error:
# gcc -Wall -g -O2   -o tcp_tun tcp_tun.c  -lpthread
tcp_tun.c:44:37: error: getaddrinfo/getaddrinfo.h: No such file or directory
tcp_tun.c:45:37: error: getaddrinfo/getaddrinfo.c: No such file or directory

I think that this is a common error involving distros without getaddrinfo available. I have packaged up everything up with getaddrinfo and a configure/Makefile also. Please let me know your feedback.

tcp_tun-0.3-beta

Tags: , , , , ,

05 Aug 09 Using the Phidget Interface Kit under Linux

Further to a comment I received http://www.adamsinfo.com/the-robot-phidgets-usb-interface-board-kit-works/comment-page-1/#comment-490 I thought that it might be a good idea to write a quick high level overview of getting the USB Phidget Interface Kit working under Linux. In my case I am of course using 32bit Debian, however these instructions should mostly be portable to any other Linux based OS

(more…)

Tags: , , , , ,

21 Jun 09 The Linux Robot – Dancing Beat Recognition

I haven’t had a chance to post anything here in quite a while now, partly due to lack of time, and partly due to lack of interesting or original material.

SEE VIDEO BELOW! I found myself with some spare time over the past few days and decided to try and get the robot to dance autonomously. I initially started looking at software algorithms to detect BPM (beats per minute) in music, either by using phase shifting which is challenging to write and not hugely accurate, or by analyzing amplitude peaks at a given [usually bassy] frequency, which is easier to write, and even less accurate.

(more…)

Tags: , , , , , , , , , , , , ,

27 Jan 09 A Beginner’s Guide to Object Oriented Programming (OOP) in PHP5 – Classes, Objects and Methods

***Guest Blogger***
The Personal Home Page (PHP) programming language provides a lightweight framework and foundation for Web application development. It runs on Apache (HTTP) Web server software amonst others, embedded into Hypertext Markup Language (HTML), passed through a Hypertext Preprocessor. As free, open source software – it has low implementation, maintenance and debugging costs. Its latest iteration called PHP5, has incorporated even more powerful object-oriented programming functionalities.

While PHP3 has rendered server-side scripts and PHP4 has established backward compatibility, PHP5 has improved object-oriented programming (OOP) as a cross-platform language. OOP bundles data and code into “objects”. PHP5 works better with object handles; passing or assigning by reference is not required.
(more…)

Tags: , , , , , , ,

26 Dec 08 The Linux Robot – Progress, Software & a Video

Over the past week I’ve made a couple of hardware improvements, as well as building the majority of the software library, a TCP server and making a good start on a client.

The camera draws over 350mA@12V and there’s no reason why I need it permenantly on. I’ve connected one of the Phidget Kit’s outputs to a simple transistor/resistor/LED circuit, with a 12V supply passing into the transistor’s collector pin, through the transistor, relay input and resistor. Then I’ve connected the camera’s power over the relay’s output. The power on and off for the camera/LED are now through setting the board’s digital output 0 to 1 and 0 respectively. Power consumption with no movement has now dropped from 1.25A to just under 0.90A. I’ve also put all essential USB hardware on one usb hub and all optional hardware on another (USB to TTL adapters, sound adapter) on the other. The optional hub is also on a relay now on the opposite side of the robot, and this now reduces idle power consumption from 0.90A to about 0.50A which I’m happy with.


I’ve spent a while working on the software site of things. I’ve written a ‘library’ in C which interfaces with the various hardware that we’re interested in. The library provides a number of functions, I’ve listed the useful ones here, and they’re hopefully pretty self explainatory: (more…)

Tags: , , , , , , , , , , , , , , , , , , , , , ,

30 Nov 08 The Robot – Progress and a Video

Well finally, here is the promised video…

The majority of the previous hardware issues have also now been solved which is good. The degrading CF cards was caused by a bad Alix board (I’d probably blown a resistor somewhere at some point). A replacement Alix board has arrived while I sell the other on eBay as faulty for any enthusiast who may wish to try and repair it. I am also using a SanDisk genuine SD card in an SD to CF adapter rather than some unbranded CF card. No filesystem errors and the disk now behaves as it should.

The motor controllers sometimes dropping/misinterpreting commands during heavy load was solved by a number of different fixes. Firstly, I believe with the USB to TTL converters the data lines are pulled up to 5v with a 4.7K resistor. I added a second 4.7K resistor in parallel to Tx to give the controller more of a chance against interference. I also added various smoothing capacitors, and edited my serial port byte transmit tool to restore the serial port settings graceefully on exit. Oh – I also cut the cables from their default 1m to the 12cm that I needed.. No more dropped commands.
(more…)

Tags: , , , , , , , , , , , , , ,

26 Nov 08 The Robot: Hardware working and ready to go, a few minor glitches

Robot

Robot

Progress has as always been good lately. The robot boots up quickly and appears on the wireless LAN, with openssh running. The internal Atheros miniPCI wasn’t doing the trick and wireless performance was shaky at best. I’m using an Alfa Networks USB adapter (r8187) and an 8dBi gain antenna now, so this has some distance now!

I was also getting frustrated with the laggyness of the board while VLC was running for streaming audio and video and so I decided on an IP Camera (Edimax), which is connected directly to the LAN port on the Alix board (I don’t have any reason to use it for anything else).

The motor control script works well and the device is responsive. At this point I can drive the device around

Robot

Robot

relatively easily and accurately, stream video and audio back to my laptop, which again is connected wirelessly.

Using ‘espeak’ you can easily generate a synthesized voice to provide easy text to voice:

echo “I am a robot”|espeak

Everything is working great and I’m pleased so far. The only reason why there isn’t a video up yet is because I haven’t had the time! There will be one up shortly.
(more…)

Tags: , , , , , , , , , , , , , , , , , , , , , ,

22 Nov 08 The Robot: Independant, moving, talking, and controlled via WiFi

Robot

Robot

I’ve made some excellent progress over the last week! The Robot is now independant, and it moves freely. I’ve written a simple shell script to take the following characters as control:
a – left
s – stop
d – right
w – forward
x – back
q – hard stop
k – turn anticlockwise
l – turn clockwise

This sends a single byte to the serial port. I am using 2xUSB to TTL converters which show up as

Robot

Robot

/dev/ttyUSB0 and /dev/ttyUSB. Each serial port controls two motors through the sabertooth controller. As we control two motors with only a byte, each motor has a 7 bit resolution from full reverse to full forward. For motor 1, 0 is stop, 1 is full forward, 64 is stop, 127 is full reverse. Motor 2 starts at 128 for full forward, 192 for stop, and 255 as full reverse. Although 7 bits of accuracy, speed changes only seem to occur at roughly 4 intervals, so we technically have about 32 different speeds, 14 forward, 2 stop, 14 reverse. We’re only using 3 speeds though as I can’t see the benefit in programming for any more right now.

The movement now seems to be working well. Smooth, controlled and straight which is something of a miracle ;-)

Robot

Robot

The battery is a 12V/7.2Ah sealed lead acid battery. With USB devices active, the board running and the processor 100% active, as well as peripheral fancy LEDs, digital outputs high, wifi active, etc, it uses 12v/800mA.

With all four motors moving at full speed, it uses 12v/6A. Seeing as the motors will be in action for short periods only, I would expect 6h+ battery life.

I have tested the sensors, and they are all working and reporting data except for the top back one which I’m going to have to investigate. Here are some more pictures:

(more…)

Tags: , , , , , , , , , , ,