Thursday 24 January 2008

SITELITE





To be continued....

Unfortunately, I have not been able to create a successful connection between the Arduino and the web server, due to unexpected problems and a limited knowledge of Programing. however, I have tried my best to create a smart little gadget and I've had fun in the process. For now, I have only managed to make my Arduino project into a kind of USB disco! Although I feel I have learnt a lot in theory, and in practice and will definitely  be pursuing SITELITE further to finally get that connection working. Here are some videos of how it looks so far.... enjoy the light show!



Not much Luck!

Unfortunately, I'm not having much luck getting the Arduino to connect to a server properly. I have been looking further into how the scripting language 'Python' works, and it's a bit more complex than what I was expecting. Further research into other projects and codes that have similarly connected the Arduino to a server has shown me that using Python is not the only way in which to connect the device. Some have connected directly to their server through USB. However to do this, you must have a local server in place with an available port, which would then need to be activated. The server that I currently use is based in Gloucester, ! so that kinda creates a problem!

Tuesday 22 January 2008

Python - Scripting Language

After researching a number of sites, I have found that in order to complete my project, being an LED blinker that is triggered by website activity, would have to be connected through another programming language like Python.. Running python would then read data from the website every 10 or so seconds, and then send that data to the Arduino through it's serial port. I have downloaded the Python software and had a quick look at it, and found some examples of code that I can try out. Hopefully I can get this to work.. it clear that the process is more complex than I originally thought!

On to the tricky stuff...

Now that I have determined a stable connection with my controller, it's time to look at how I can use the Arduino set-up I have to interact with the internet through a web-server or other. Recently I have been looking at other people's projects, and how they have incorporated the Arduino into a web / physical project...

Here's one example - Tinkerlog

Tinker log, is a project that takes a 'hitcount' from the blog itself, and then every ten seconds connects with the server-side coding, Python, and establishes wether or not there has been any action (more hits). If there has, the Python code then tells the Arduino to carry out an action, if not the cycle is looped until the next ten second interval. Pretty smart!

This project uses three stages of Software programming, including PHP, Python and the Arduino language, so it immediately appealed to me. I knew that I if I was going to use my Arduino circuit to connect to the Internet, then PHP was a major factor and I needed to research how other people have gone about completing their set-ups. I read into the code that this creator had used, It states in his blog, that he has used PHP, Python Syntax, which I have never heard of, but seems to be an open source scripting language similar to Applescript, however a lot more efficient. I have downloaded the Python environment to try and get to grips with it, maybe this is something that I will need to use to bridge the gap between the Internet and my arduino. Whatever the outcome, it has certainly given me hope that creating a connection to my Arduino based upon online variables is fairly easily feasible....

One small step for Mankind, One GIANT LEAP for me..!


This was the circuuit set up and talking to the Arduino environment for the first time... I made it blink at intervals of  '1000', being 1 second.


Installing the Arduino Environment....

Today I have taken the gadget back to pieces and am going to try and talk to the Arduino through it's environment... Initially, I have found many problems... Without the necessary help, the whole programming of micro-controllers is new to me...!

When I tried installing the software initially, I had some problems getting the drivers to work.. After a while fiddling with that I managed to create a successful connection with the arduino.. I had defined the serial port, and opened the initial example, "Blinking LED" to see if I could get the basic's from the equipment. I tried time after time to upload the example code to the Arduino, but I had no response, except for error messages, that meant nothing to me!! 

By this point I was fiddling with it for at least 3 hour's and still could not figure out why it was not working, Maybe the bootloader was not installed? I tried all kinds of things... Anyway, It turns out in the end, after endless searching and reading on the Arduino.cc site that I had not defined the micro-controller itself. I was trying to upload to a model 'Atmega168' micro-controller, When in fact my Arduino NG uses the 'Atmega8'... A Simple error, that has cost me valuable time. However, When That LED finally started blinking, and I was able to determine factors such as the length of time between flash's etc, I was so excited..! Amazing how something so small can encourage you to see the positives of such task's!