The current "MidgeKamikazeSunspot Distro beta 0.00002"

Statcounter tells me that there have been many visits to this page.
this "Distro" is "email-ware"
PLEASE email me if the software runs on your router
(and if you get some control project running)

It is all thanks to Midge and the linux developers

This is my current work backup, designed for "external linked hardware" experimenters new to Linux and C programs
- connect that project to the Web - share it here!

If it does not work....
The memory stick must be formatted Linux ext2.
You must UNMOUNT cleanly on your Linux PC when you have finished loading the stick with files - wait for the light on the USB memory stick to stop flashing before removing it.
Try using the command line to do decompression. Linux developers think real men use the command line and they do not test the GUI. For example if you compress/decompress in the Fedora 5 GUI you lose all the empty folders - you need them!

One contact modified an Edimax from "K" to "KP" by adding the missing surface mount components. But the boot sequence could not mount the memory stick. He changed the 1Kohm resistor on the oscillator CPU line to 56ohms and it then worked.

 


Update 14 October 2007

Unfortunately in Midge Kamikaze it is not possible to change the baud rate after compile. I have prepared these firmwares for various reasons and I think they are all the same as those reported below for "update 7 August 2007 and 9 Feb 2007" - they only differ in the baud rate of the rs232 ports.
I think they all work but I do not guarantee that they were all tested - please email me if they work for you.

As always they need a USB memory stick to boot from such as stick_070209.tar.gz
(see menu item 11 for some updated stick files to make Samba work correctly)
If you get here from an old link go here for the frames version with a pull down menu

Date Created ttyS0 baud rate ttyS1 baud rate download
11 October 2007 (downloaded & tested OK by HI-Dec07) 115200 2400 071011_115_24.zip
23 September 2007 (downloaded & tested OK - Oct 07) 9600 38400 070923_96_384.zip
29 July 2007 (downloaded & tested OK - Oct 07) 38400 9600 070727_384_96.zip
14 July 2007 2400 2400 070714_24_24.zip
14 February 2007 - exactly as below - well tested 9600 9600 070214_96_96.zip
4 February 2007 - exactly as below - well tested 115200 9600 070204_115_96.zip

The zip files above contain a .bin file for loading to FLASH and a vmlinuz for temporary testing in RAM.
The router will always first offer 115200 baud on ttys0 on the header - in Hyperterminal hit space 3 times to load new firmware.
After the upload the boot reporting sequence then follows in the new baud rate.
After that the terminal processes will not be seen on ttyS0 - "no terminal chatter" - but you can send data to it to control devices.
You have to play a trick to make ttyS0 work like ttyS1 and send characters one at a time ("raw" mode) - see pull down menu item 3.

Update 7 August 2007

To get rid of some (none-critical) errors reported at boot time use this file for /etc/network/interfaces (on the memory stick)
(remove messages like "SIOCGIFFLAGS: No such device")

# Configure Loopback
#
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.4
<<< - your router address on your LAN
netmask 255.255.255.0
gateway 192.168.0.230
<<< - your ADSL modem gateway address on your LAN

(Thanks to "KK" for pointing this out)

Update 9 Feb 2007

We might call this beta 0.0002! - it's all working pretty well here - I am using -

mks1152_96_19in_070204.bin (for Flash). . or. . . vmlinuz (for testing on RAM) . . .with . . . stick_070209.tar.gz
(ttyS0 at 115200 baud and ttyS1 at 9600 baud)

The VAR/WWW/ folder has a more logical structure. The default LAN address is 192.168.0.3
The stick has PHP5cgi and httpd working together - see menu 15 (no need for lighttpd any more to run PHP)

All the features listed on the home page seem to be working for me!
Now to try to use it in anger and stop adding features
.....

Please email me with any problems - and if it works for you!

14 Feb 2007 - this is identical to mks1152_96_19in_070204.bin above except that both rs232 ports are working at 9600 baud
mks96_96_19in_070214.bin (for Flash). . or. . . vmlinuz (for testing on RAM)

23 September 2007 - some more baud rates
ttyS0 38400 baud / ttyS1 9600 baud
. . . . . . mks384_96_070727.bin. . . . vmlinuz

ttyS0 9600 baud / ttyS1 38400 baud. . . . . . mks96_384_070923.bin. . . . vmlinuz

NB! - you CAN run the i2c lines off any led pair without a recompile - see menu item 6 (at the bottom of the page)
- no need to cut the CPU wires now

LCD 16x4 type QY-2004A works fine - some others do not - but the LED backlight fades in 3 months if you do not reduce the current with an external resistor (still bright enough with 100-200ohms)

TIP! -To get ttyS0 to behave like ttyS1 as a device controller (raw mode, single data characters sent either way with no CRLF, reflected characters or other terminal hassle) run rs232io_ttyS0_96 in usr/sbin to send characters, or just one dummy character - after that it behaves till you reboot. (and it still runs at the baud rate chosen when the firmware was compiled - ignore the "96") - See the serial port notes (3) in the pull down menu.













Update 4 Feb 2007
There seem to have been some problems with the rs232 drivers in recent bin files - I have done a complete rebuild and seem to have it all working.
i2c, led drivers as per dl4huf full driver after 3 Feb 07, LCD 4x20 display, no terminal chatter on rs232 ports, blassic basic - but eyeOS has been removed, if you add it it will work.
The stick runs both httpd and lighttpd, the latter set to 192.168.0.3:8080 and phpfastcgi is working with it (try timetest.php and phpinfo.php)
The RAM is close to full (type "free" in telnet and "ps -aux" ) - rename /etc/init.d/S50lighttpd to free some space. If you can see how to use less instances of php please email me.
I intend to see if standard php will work with httpd - I only use lighttpd to test php apps

stick_070104.tar.gz . . . . mks1152_96_19in_070204.bin . . . . . vmlinuz


Update 3 Feb 2007

error please use S05mkdev in /etc/init.d

(the lines
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65

were missing)

Update 24 Jan 2007

Now with i2c (very experimental-but mine works!)
build a 2 wire network of controlled devices (with thanks to dl4huf)

An i2c bus can be connected to gpio1(SCL) and gpio3 (SDA)- these lines have to be cut at the CPU
- but you CAN use any line - even have several i2c buses.

So far tested with an LM75 thermometer (all address lines to 0v)
and a PCF8591 8line bus expander (all address lines to 3.3v)
(chips powered from the Sweex 3.3v line)

For the ready made memory stick files use 070124_i2c.tar.gz
In a Telnet terminal type
pcf8574 to flash diodes on the pcf8574
type lm75 to read temperature

- see pulldown menu 6 for my notes on adding the i2c files to an existing stick

(all features listed below are still available)

 

The Sweex firmware can be as below - but if you have any trouble with those try this recent compile.
Use mks-1152-i2c-070123.bin (Flash) or vmlinuz (RAM)



Update 20 Jan 2007

Bug fix - the dl4huf LCD driver had a problem with the -i command to initialise a display.
On my displays you had to use -i twice and you got random characters at times

Load the new lcd_out_4x20 into the usr/bin folder on the stick - (see pull down item 10)
it uses lcd_out_4x20-i_fixed.c - compiled -lcd_out_4x20

I have two types of 4x20 LCD panels (from China - via eBay)
A Techstar TS2040-1 Ver 1.2 still fails about 1 in 4 tries
-I see random (but repeatable) Japanese and graphic characters and have to send -i a few more times
A QY 2004A now works all the time - rock solid. (Has anyone else seen this?
email me )


Update 15 Jan 07

Very experimental - 19 I/O lines now!!

Thanks to dl4huf ALL the led and GPIO lines can now be input or output (and lots of other modes).

Try the new firmwares - all as earlier (below) but with the dl4huf led.c driver added
mks-1152-96-070112.bin for FLASH and vmlinuz for RAM
(1152000 baud on ttyS0 and 96000 baud on ttyS1)
You must also replace /etc/init.d/S05mkdev with this
To be tidy you should remove the led0 line in /etc/S00init and remove /etc/S97heart_led
- and probably others that will give boot error messages

see menu item 9 above for pinouts of the gpio lines. Also see the "dl4huf readme"

If you change led status (output to input etc) you get a report on the primary ttyS0 rs232 port that I thought was now free of "terminal chatter". It is only at setup time, I think, so may not be a problem.


Update 10 Jan 07

Now you can run the Basic language (Blassic) on the Sweex - see menu item 12 above
download the USB memory stick contents with Blassic ready to run here stick070110.tar.gz

With apologies to Linux purists!
thanks again to PicProjects


Update 5 Jan 07

The Memory stick files now contain Samba (Thanks to PicProjects)
and FTP (vsftpd) Thanks to gpolder (see the discussion board on this site)
DNS and ipkg work now

Samba and FTP work well on my system, but beware security - I have 777 permissions on the folders and files and my Samba asks for a password but runs no matter what you enter. This is fine for development purposes on the local LAN.
But do not use it on the internet! If you can see what is wrong please email me

Samba is very useful - just open the stick files in /var/www directly in a text editor or html editor on your Windows PC or Macintosh

The stick contains even more of my dead files ( I forget which are no longer needed!)
There are options to test an LCD display on the LED lines - but it is a bit random still (can you fix it?)

The LCD also shows a banner on boot - well, it does sometimes.....(can you fix it?)

The web page is at 192.168.0.3
FTP is at 192.168.0.3, log in as root password midge

Use the bin files below. Details of what I did are summarised on the pull down menu above - item 11

The compressed file for the USB memory stick are here stick070105.tar.gz


Update 27 Dec 2006
DNS is not set up properly on the current stick image.
My Sweex never connected to the wider internet.
But you may want to.
My email contact "onlineking" pointed out that wget did not work with sites out on the internet - just with local LAN sites or those for which the "dotted quad" IP address was known.
He pointed out that file
etc/resolv.conf
on the memory stick should point to the DNS server.
I use my ADSL modem to provide DNS to my LAN at 192.168.0.230
So the file resolv.conf contains just -

# domain ci.ukrpack.net
nameserver 192.168.0.230

The domain is not needed on my LAN so is commented out with a # character

To summarise the latest situation on 4 Nov 06
you can now use the primary serial port, ttyS0, for hardware control - no "terminal chatter"!!
Some notes on how to remove the terminal chatter

Sweex/Edimax firmware
For ttyS0 running at 9600 baud and ttyS1 running at 9600 baud
midge_tty96_96_noconsole.bin
into Flash Ram or vmlinuz into RAM as a temporary test §

For ttyS0 running at 115200 baud and ttyS1 running at 9600 baud
midge_tty115_96_noconsole.bin
into Flash Ram or vmlinuz into RAM as a temporary test

Files for the USB memory stick
Decompress the latest stick061103.tar.gz - - - - in a Linux box and place the files onto an ext2 formatted USB memory stick
(plug it into the 2nd USB socket - furthest away from Ethernet sockets)

The Sweex will boot from the USB memory stick and have -

Two RS232 Serial Ports running at 9600 baud with (after the boot-up reporting on ttyS0) no "terminal chatter"
(or 115200 baud and 9600 baud
)
(Control outputs and inputs by clicking on a webpage that you can modify without a re-compile)
(to change the RS232 port speed you still need to re-compile the source)
15 CPU lines as data outputs
4 GPIO lines that can be data input or output
5 Ethernet sockets all at 192.168.0.3 working as a hub


(see etc/midge.conf if you do not want a hub)
(go to etc/network/interfaces to modify the LAN and gateway address)
etc/network/interfaces is contains this -
auto eth0
iface eth0 inet static
address 192.168.0.2 <- change this
netmask 255.255.255.0
gateway 192.168.0.230 <- change this
(ignore the rest)

RAM disk at
/var/www/ramdisk
for storing temporary files in RAM rather than USB Stick FLASH (but see below)

You can run
graham_hello
led_app1 (from TheKr1S)

led_setnew on 9 - - will turn led 9 on
led_setnew off 9 - - will turn led 9 off

Various other failed programs that still clutter the bin folders will be removed soon!

The web pages in var/www show various current experiments for controlling a PIC

§ NB if you want to see the preboot boot-loader this still comes out of ttyS0 (the header pins) at 115200baud
- press space bar 3 times to get the bootloader menu




Earlier versions

To summarise the situation (31 August 06)

Load
midge-ttyS1-96_23June.bin
into Flash Ram or vmlinuz into RAM as a temporary test

Decompress the latest stick10Sep06.tar.gz - - - - (or revert to this stick31aug06.tar.gz) in a Linux box and place the files onto an ext2 formatted USB memory stick
(plug it into the 2nd USB socket - furthest away from Ethernet sockets)

The Sweex will boot from the USB memory stick and have -

RS232 Serial Port2 running at 9600baud with no "terminal chatter"- (controlled by a webpage)
(to change the speed you still need to recompile the source)
15 CPU lines as data outputs (controlled by a webpage)
4 GPIO lines that can be data input or output (controlled by a webpage)
5 Ethernet sockets all at 192.168.0.3 working as a hub

(see etc/midge.conf if you do not want a hub)
(go to etc/network/interfaces to modify the LAN and gateway address)
etc/network/interfaces is contains this -
auto eth0
iface eth0 inet static
address 192.168.0.2 <- change this
netmask 255.255.255.0
gateway 192.168.0.230 <- change this
(ignore the rest)

RAM disk at
/var/www/ramdisk
for storing temporary files in RAM rather than USB Stick FLASH (but see below)

You can run
graham_hello
led_app1 (from TheKr1S)

led_setnew on 9 - - will turn led 9 on
led_setnew off 9 - - will turn led 9 off

Various other failed programs that still clutter the bin folders will be removed soon!

The web pages in var/www show various current experiments for controlling a PIC

Two contacts have got the stick31aug06.tar.gz to run
- but please try
stick10Sep06.tar.gz to test the file stored here


One small problem -

/etc/init.d/S98ramdisk should contain the script

#!/bin/sh
# create the folder ramdisk and set it as RAM
mkdir /var/www/ramdisk
mount -o size=2M -t tmpfs tmpfs /var/www/ramdisk
echo "ramdisk is at http://xxx.xxx.xxx.xxx/ramdisk/picture.jpg"

This runs at boot time and allows you to save files into /var/www/ramdisk and have the data reside in RAM instead of the FLASH storage in the stick. I would use this to store temporary files (like webcam pictures pulled from other web servers) and so not use up the life of the USB FLASH storage.

stick31aug06.tar.gz above does have this function even though the file /etc/init.d/S98ramdisk is garbled in a text editor - odd!
stick10Sep06.tar.gz contains a file that runs and is readable (and lots more junk in the test area!)

You should see
ramdisk is at http://xxx.xxx.xxx.xxx/ramdisk/picture.jpg
at the end of the boot process

If you get any of this running or not PLEASE email me! That might be an incentive for me to clean this up a bit more.


To stop a process
If I start led_app and want to close it
ps -aux---------shows a list of running processes
kill 253---------stops process 253 (the number on the left of the listing) - is there not a simpler way ?

(I still know less than Chapter 1 in Linux but I have a £20 Sweex that can do a great deal!)

footnote - in Fedora 5 if you delete a file in the GUI it stays in place and ~ is added to the end.
A script like S98ramdisk~ might get into the USB stick and the Sweex will run it as a script - you can thus get two copies running, the "deleted" file and the new one. You have to delete the file from the command line - for example - go to the folder where it is and type rm S98ramdisk~
(thus do the Linux Gods get their revenge on Mac users who tell them we want a modern GNU GUI ;-) )