loading
Simple walk through that shows how to make a shell script that will down load a program from a ftp site then compile it then download it to the picaxe.

(This is also my first instructable)

Step 1: What I Used

This is what i used

1x ubuntu
1x picaxe 08m
1x breadboard
2x led
jumper leads
some way to program the picaxe i use the PICAXE021 prototyping board with jumper leads to the breadboard

You can pretty much use any picaxe micro as long as you adjust and use the correct complier

Step 2: Setting Up

Now we need a place for the script to be ran from for this instructable I decided to place it in ~/picaxe-ftp (~ means your home folder by the way). Now we want to get the complier, http://www.rev-ed.co.uk/software/picaxe.tgz that their contains all the compliers for all the different versions of picaxe. Now I am using the 08m so i get complier 'picaxe08m' and place it in the directory but you could just as easily substitute that for your version. Ok so now you should have your directory with the complier in it thats all.

Step 3: Code

Now open your text editor or what ever you use and paste this code in.

#!/bin/sh
HOST='0catch.com'
USER='picaxeprogramer.0catch.com'
PASSWD='picaxetest'
FILE='test.bas' #Enter the name of the bas script here

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
get $FILE
quit
END_SCRIPT
# That was the ftp part that logs in gets the file and quits
./picaxe08m -c/dev/ttyS0 $FILE # that downloads the file to the picaxe change this to suit

Save this as picaxeprogramer.sh in the same folder you put the complier in. Now you can use the settings their the code is the simple flashing led you can check for yourself if you want. You can also use that ftp site if you want just be respectful and don't mess around with it.

Step 4: Running the Program

Now if you wanted to you could set this up to run every 1h, 2h 5h or what ever you want but for the sake of this instructable we will just run it.

OK connect your picaxe how you normally would(probly better if its not programed to blink on pin 1) and then add a led on pin 1 and turn it on. Now navigate to the folder where the script and complier is and run the program by typing 'sh picaxeprogramer.sh' . it should run and continue to program the picaxe.

Step 5: Last Step

Now i know this alone isn't very useful but if you expand on this you could be able to update robots controls or make sure all your robots are updated to a new commands and controls but anyway what you decide to do is completely up to you.

Here's a video of the shell running.(sorry for poor quality camera is more of a photo taking camera. Also the background noise)


If you want a script with a little added to it try this

#!/bin/sh
HOST='0catch.com'
USER='picaxeprogramer.0catch.com'
PASSWD='picaxetest'
FILE='test.bas' #Enter the name of the bas script here
NEWNAME=`date +%Y-%m-%d`'.bas'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
get $FILE $NEWNAME
quit
END_SCRIPT
# That was the ftp part basicly that logs in gets the file and quits
./picaxe08m -c/dev/ttyS0 $NEWNAME # that downloads the file to the picaxe
echo $NEWNAME

That one downloads it and changes the name to the date so you can see the previous codes.

How about a little schematics? For the stupid ones like me... ;)
Oh yea sorry thought i forgot something. This here is for the download circuit i use. I will also add it to one of the steps
This microcontroller is really simple, I've searched the web and found many documentation about it. I think it will work on a project I'm developing better than the arduino. Hope to see more instructables like this. I really liked it.
Whats your project anyway
I need to control temperature and humidity in a room very precisely and in a pre-programmed schedule. You see, it's not an easy task, it is intended for mushroom growing facilities. For example, during 2 to 3 weeks I need high temperature (about 26C degrees, that's high for mushrooms) and high humidity (90-95%), the both must fall gradually in 4 days to 16C/82% and after that every 14 days have a little up-down in both to 20C/85-90% in 2 days. The circuit must control different climatization equipments, like air-conditioners, heaters, cold/warm water pumps, fans, and so on. And all this must be logged on a computer and done without capacitive RH sensors, they don't work well at high humidity. It is a crazy idea, but if I could make this work, hmmm, there will be a lot of people dying to have such a termo-higrometer.
Wow wasn't expecting that. thats way out of my range of things i can do. Although i wish you luck in your new system
Thanks! When I start with it I'll write an instructable too, just basics of the process...
Thanks i just thought it might help someone somewhere and yes it should work on pretty much anything if you just change the commands and that

About This Instructable

5,468views

9favorites

More by wee_man:Setting up to program a picaxe via shell script(linux) 
Add instructable to: