HomePi, Coming together

Posted by beakersoft | Posted in Raspberry Pi | Posted on 12-05-2013

0


Over the last couple of weeks l’ve done a bit more work on my HomePi project. I have now finished the design of the pcb (for the first version). Previously i had been using Eagle to design my pcb’s, this time however i have used Fritzing instead.

While Eagle is very good, its also a bit hard to use, especially if you have not done a lot of electronics work before. Fritzing on the other hand is aimed at novices and is very easy to get to grips with. You can create a virtual breadboard of your project, and based on this it will create you a real schematic and a PCB. There are also loads of template part available online, so building up the project is a simple! Check out the software at http://fritzing.org/.

They also offer a PCB fabrication service, but it doesn’t work out as cheap as using Seedstudio, although (from a European standpoint)  you will end up with your board a lot faster. This is an export of my breadboard view:

HomePi_V1_bb

So, on this board I have the following sensors:

  • A DHT11 temperature and Humidity sensor
  • A light resistor and capacitor for measuring the current light level
  • An LED that can be turned on or of (to be used as a lego street light that comes on at night)
  • An Rj45 interface so the device can be extended with 1-wire devices

My HomePi board will be mounted on the top of an Adafuit LCD pi plate using a 45° GPIO header. The LDC plate will have the LCD screen plugged in, and is mounted in the roof of the Lego house. My first (unfinished version) of this is pictured below:

WP_20130512_001

From the  Fritzing software, I have also printed out the PCB, backed it on a some polythene packing sheet and mounted all the components on it. I have done this to give me a rough idea of how big the finished PCB will be, and to make sure its going to fit in the house OK. Lucky it looks to be the right size:

WP_20130512_002

 
So hardware wise, I think I am now ready to get my board made. I still need to do some more work on the actual house, one of my main things with the house is i’m not sure the best way to create my little street light. I have ordered a pre-made Lego street lamp, so I might have to drill some holes in it to get my LED in.

Software wise, I have done a bit more work on the Python script that controls everything. I have tided up some of the code, and it is now hosted on Github, so you can download it yourself and have a play around. At the moment there is no instructions on how to build everything needed for the code to run, but as I need to build an sd card from scratch for the micro sd adapter I am going to use, I will document it as I build. Go and grab the python script now from https://github.com/beakersoft/HomePi

Building the HomePi

Posted by beakersoft | Posted in Raspberry Pi | Posted on 07-04-2013

0


As I mentioned in the previous post, I am building a little Lego house with a raspberry pi inside it that is going to drive an LCD screen and output some interesting information. I now have most of my hardware parts working on a breadboard, and I am displaying text on the LCD screen.

WP_20130407_002

So far its doing the following, all via a python script:

  • Show the current date and time on the LCD screen
  • Read the temperature and humidity from the sensor, and display on the screen
  • Show the current twitter trends on the LCD screen
  • Using the light sensor, if the light level is below a certain level (ie its dark) then turn off the LCD screen, and turn an LED on. When the light level returns back to normal, turn off the LED, turn the LCD screen back on and start looping through the date/temp/twitter information again

I have mounted the Adafruit LCD breakout board on an extra long GPIO header, so I can still use the pins on the pi. Instead of attaching the LCD screen directly to the breakout board I have connected it via cables, this is so the Pi can sit at the bottom of my lego ‘house’, and the LCD screen can be put in the roof.

The actual python script needs a couple of tweaks  then I will upload it onto Github so anyone can have a play with it. Its quit simple, but someone might find it useful.  The next things i need to do are:

  • Work out the best way of putting a 1-wire connector (probably Rj45) onto the system, so a new sensor can be easily added to the new system.
  • Try and work out if  the new Pi camera  module will fit into the system somehow
  • Design an actual pcb for the system to mount the components on. Everything is on a breadboard at the moment, obviously this cant be used in the finished house. Seedstudio offer quite a good pcb prototyping service, hopefully I can use them. I also need to work out the best way to mount the pcb to the pi, in the house.
  • Build the actual lego house to hold it all in. I looked at the LEGO Digital Designer software, but I have decided to do it old school and just try and build it from scratch.
  •  Look at some sort of back end to the system, probably web based so it can be configured easily and some of the data can be logged.

Once I have the script on Github I’ll post a link on here

HomePi – Raspberry Pi Lego House

Posted by beakersoft | Posted in Hardware | Posted on 25-03-2013

0


One of the amazing things about the Raspberry Pi micro computer (apart from its price) is its ability to interface with other hardware. It opens up so many possibilities that used to be quite expensive and difficult to implement . As interfacing a pc directly with hardware is not something I have ever done before, I’ve come up with a project to learn some of the basics, I call it HomePi

The idea is to house a Raspberry Pi in a little Lego house, and attach various sensors to perform certain task, and maybe implement some sort of data logging and remote access into the project as well. My ideas for sensors and extra hardware so far are:

  • A temperature and humidity sensor
  • A light sensor, that will turn on a ‘street light’ when its dark. This will just be a single LED light enclosed in some Lego
  • An LCD screen to sit in the roof, to display various bits of information, such as the current temperature & humidity, date & time, RSS feeds, Twitter trends etc.
  • A couple of buttons to maybe change what the display is currently showing
  • An LED in a ‘street light’ that will come on when the lights are turned off
  • A motion tracker to see when someone enters the room
  • Maybe an RJ45 jack to interface 1-Wire, so I can plug in additional sensors if needed.

I have already decided on a bought some of the hardware I will need for the project:

  • For LCD screen I have bought the Adafruit RGB 16×2 LCD kit. This includes the actual LCD screen. The advantage of this kit (as opposed to just buying the screen on its own) is that it you only use the 2 I2c pins on the pi. Plus you don’t really use them as you can attach other things onto the I2c bus anyway. Check it out here.
  • With the LCD breakout sitting on the GPIO pins, I have also got an extra long header connector, so I can mount the LCD breakout on the pi as normal, but also have access to all the pins
  • A DHT11 temperature and humidity sensor
  • A light dependent resistor sensor
  • Plenty of cables to run the sensors and other devices

I have started work on it now, I’ll post some more info later in the week.

Creating Outlook Profiles for RemoteApps

Posted by beakersoft | Posted in Enterprise | Posted on 15-08-2012

4


The Problem

Recently I have been involved in a project to roll out Microsoft RemoteApps, so users can launch applications on a terminal server via a website or shortcut. One of the issues we had was with a business application that was trying to send email out via Outlook.

The application was trying to open a new outlook email, but as outlook had never been launched before the application just hit an error as soon as it tried to send the email. I came across a few articles that pointed at adding a entry to the registry at HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\ImportPRF that contains a path to a prf file. When you set this path when Outlook first opens it will use this entry to create the profile based on the settings in the PRF file.

The problem I had was because Outlook was not actually being opened by the user, then the profile was never created, so they got an error. So in order to get around this, I decided to write a VB script that would create a Outlook object then launch the application. I would then use this as the application path in RemoteApp Manager to start the application.

The Solution

This is the script I wrote to launch my application:

Set objRegistry = CreateObject("Wscript.shell")
objRegistry.RegWrite "HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\ImportPRF", "\\server\share\settings.prf", "REG_SZ"

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(6)
objRegistry.Run "%SYSTEMDRIVE%\Progam Files\App1\App1.exe"

So, what is the script doing. First of all we create a shell object so we can write to the registry. Then we write the key to point at our prf file (obviously you need to change this to your relevant path, and if you are not running Outlook 2010 the reg path will be different).

Now we have that setting in the reg, we create an object pointing at Outlook. As we do this Outlook essentially ‘runs’ and sets its self up based on the info in the prf. We then just shell out to the application we want to run, and an Outlook profile should be available for the application to use!