NB! this is work in progress! - but it seems to do all I need at present.
Towards a "load it, run it" distro for Debian on Bifferboard
for web connected hardware control projects.
(For people like me who are not Linux developers but want to web-connect
a PIC based hardware control system or similar at minimum cost and only use 1 Watt).
NB! These are my personal notes for back-up.
- please email me with comments and corrections if you attempt to repeat this.
Other notes on this site for Sweex router and NSLU2 (Slug) may you help you to follow this page - do a keyword search of this site here
Run the Bifferboard with an operating system that allows it to web connect a network of i2c devices.
Some of these may be PIC micros running as i2c slave devices connected to servos, relays etc.
I had hoped to run OpenWrt on Bifferboard since it needs no swap partition.
However it was not possible to read and write to i2c devices using OpenWrt.
Run Debian on an external USB memory stick or hard disk.
Once a core system is up and running it is then very easy to load new programs with "apt-get install xxxx"
Working so far -
Secure ftp connection for file transfer.
web server (lighttpd) with cgi scripting
i2c both read and write (!!!!) - a PIC can be used for servo control, A/D, D/A, port expansion etc
Logitech 9000 HD webcam
USB sound dongle like this
WIFI dongle as on this page - D-Link DWL-G122
Compile C programs directly (gcc -o program program.c)
Blassic basic - great for hardware control and you can understand it simply by reading it!
GPIO *is* working ! - see http://sites.google.com/site/bifferboard/Home/gpio - here is a backup of that page -
Not yet working (expert help welcome please)
rs232 read from a webpage (write works OK but not read - the read code worked on OpenWrt BB - odd....)
Acknowledgements and links
Debian on Bifferboard has been developed by, in particular,
famzah and by d1savowed. See this debate
Many thanks for their hard work and helpful answers to my very basic questions.
i2c network drivers
These are included in my custom start-up script /etc/graham_startup.sh
- If this is modified do the following at a command line-
update-rc.d -f graham_startup.sh remove
update-rc.d -f graham_startup.sh defaults 99
modprobe i2c-gpio-custom bus0=0,12,9 - NB these are not the same pins as in the Bifferos Wiki
i2c works! -
BiffDeb09:~# i2cdetect 0
apt-get install lighttpd - web server
USB sound dongle
apt-get install alsa-utils - wav file player - works very well
apt-get install madplay - mp3 player - only works for very short, single word mp3 files
apt-get install flite - text to speech - make it speak temperatures etc!
For flite to work you need snd-pcm-oss but if you add it to /etc/graham_startup.sh as modprobe snd-pcm-oss
then the USB webcam only works if plugged in after boot time
To have it work if plugged in before boot time you have to add snd-pcm-oss to the file etc/modules
(D-Link DWL-G122 IEEE 802.11b/g USB 2.0 High Speed 2.4GHz Wireless Adapter) - also see this
apt-get install wireless-tools was not needed - they are present. But rt73.bin was absent
I found a copy and put it into /lib/firmware then did depmod
In /etc/network/interfaces you have to add
iface wlan0 inet static
pre-up ifconfig wlan0 up
pre-up iwconfig wlan0 mode Managed
pre-up iwconfig wlan0 essid "225"
and comment out the lines
iface eth0 inet static
(My WIFI is at 192.168.0.225)
To make WIFI live do
ifconfig wlan0 up
iwlist wlan0 scan
(I use a Logitech Quickcam Pro 9000 HD webcam)
get mjpg-streamer-r63.tar.gz from Source Forge
apt-get install libjpeg-progs
tar xzvf mjpg-streamer.tar.gz
make clean all
test it with -
./mjpg_streamer -o "output_http.so -w ./www"
The web page cgi script that starts the webcam calls /var/www/cgi-bin/mjpg_streamer_on.sh
which starts mjpg-streamer as a daemon (background process)
/home/mjpg-streamer-r63/mjpg_streamer -i "/home/mjpg-streamer-r63/input_uvc.so -r 960x720" -b -o "/home/mjpg-streamer-r63/output_http.so -p 8080 -w /home/mjpg-streamer-r63/www
PHP scripting - confusion here!! - needs more work
apt-get install php5-cgi was used for lighttpd (- I think?)
apt-get install php5 allowed PHP scripts to run but I got web pages at 80 and 8009
- it seemed to load Apache? - removed at present
note - filename.php did work in var/www folder but not var/www/cgi-bin
I did -
apt-get install libcgi-fast-perl libio-all-perl
but I now forget why....
fsck would run some 3 or 4 times at boot time because there is no hardware clock see this
It says "Edit /etc/init.d/checkroot and locate part of the script responsible
for executing fsck" but I did not know how - so I hit the file with an axe and the problem died - improve this later!!
espeak runs but is "jumpy" - so I use flite
GPIO control is now working - see above
/etc/graham_startup.sh loads a 2MByte ramdisk at /var/www/ramdisk
mount -o size=2M -t tmpfs tmpfs /var/www/ramdisk
I use this to interface Blassic with bash scripts
No need to repeat my battle with Linux!
- just load it, run it, and web-connect that PIC
This "distro" (my current back-up files) allows a remote web browser to run cgi scripts to test the board and associated i2c and USB hardware.
It is similar to my OpenWrt experiment.
The associated PIC runs servos as described here
the rs232 terminal uses speed 115200 N81
login to rs232 terminal or ssh session with
From a network terminal type
The web home page is at http://192.168.0.9 to change this make the same changes as here
Samba is not yet present - it used lots of memory on the NSLU2 (Slug) and was not so reliable as "secure ftp"
when I run
and type hello world in the form box the string that the script sees is hello+world
This did not happen with the same pages in my OpenWrt slug - to be fixed with sed
The "distro" is here
For the Bifferboard
download vmlinuz-18.104.22.168 and burn it to the Bifferboard as explained here
For the external memory stick or hard drive
I compressed a folder called disk containing all the files and folders that go onto the external USB memory stick or hard disk by doing
tar -cf disk.tar disk/
The Skydrive host limits files to 50MBytes so I split the compressed file disk.tar into 49MByte files using
split -b 49m disk.tar
download the files xab xac ........xaj and put in a folder in a Linux PC (I use Ubuntu in a VMWare image on a Mac)
Use the terminal to cd to the folder then type
cat xa* > disk.tar
To "untar" the file do -
tar -xvvf disk.tar
Then modify the network files like here if you do not want to use 192.168.0.9
Then in Ubuntu using the GUI do "System/Administration/Partition Editor"
Create a disk with an ext3 partition first (on the left of the bar) then add a Linux Swap partition of perhaps 100MByte (on the right of the bar).
Copy the files to the stick using the command line (the Ubuntu GUI fails)
Use http://192.168.0.9 to see a web page that runs scripts that test the system
The html files go into /var/www and cgi and bash scripts go into /var/www/cgi-bin
rs232 input fails
I use Cyberduck to connect by secure ftp
Use apt-get update
and apt-get install filename
to add more functions
If you are a Mac user like me you will hate the Ubuntu GUI. Not so bad for PC users since they expect life to be difficult ;-).
If you try to compress the dev folder, for example, it fails but the command line works.
Linux developers do not fully test the GUI.
Since I use a VMWare image on my Mac I can keep backups of my Ubunto image very easily
- so I always work as root (the world did *not* end) and this makes Ubuntu a bit more Mac like.
Please email me if it works for you or if you can fix the problems noted above.