Instructables

Setting up to program a picaxe via shell script(linux)

Picture of Setting up to program a picaxe via shell script(linux)
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)
 
Remove these adsRemove these ads by Signing Up

Step 1: What i used

Picture of 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.

wgrube5 years ago
How about a little schematics? For the stupid ones like me... ;)
wee_man (author)  wgrube5 years ago
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
shematic.jpg
wgrube wee_man5 years ago
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.
wee_man (author)  wgrube5 years ago
Whats your project anyway
wgrube wee_man5 years ago
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.
wee_man (author)  wgrube5 years ago
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
wgrube wee_man5 years ago
Thanks! When I start with it I'll write an instructable too, just basics of the process...
wee_man (author)  wgrube5 years ago
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