| Author |
Topic  |
|
TheKr1S
Netherlands
24 Posts |
Posted - 05/17/2006 : 21:09:57
|
quote: Originally posted by electrickery
The kernel code has support for the GPIO pins (kamikaze-200602050443/trunk/openwrt/build_mipsel/linux-2.4-adm5120/linux-2.4.32/arch/mips/am5120 in led.h, led.c),
I used that led.c of kamikaze kernel 2.4.31 and added the led support. If you are interested I can put is online. You can see it work at http://wasse632.speed.planet.nl/leds.php
RMW
http://wasse632.speed.planet.nl |
Edited by - TheKr1S on 05/17/2006 21:14:35 |
 |
|
|
margro
Netherlands
13 Posts |
Posted - 05/17/2006 : 21:37:19
|
quote: Originally posted by electrickery
The ADM5120 data sheets lists the LED pins as pins for the network utp ports. The possible states include several GPIO conditions, so it should be possible. The kernel code has support for the GPIO pins (kamikaze-200602050443/trunk/openwrt/build_mipsel/linux-2.4-adm5120/linux-2.4.32/arch/mips/am5120 in led.h, led.c), but not for the LED pins. So we probably need a kernel guru to add this. (It is quite confusing that the software calls the GPIO pins 'LED0 to LED3', while there are actual LED pins. Funny is the latter can have a GPIO state :-) )
It is already there... See my post on the Amilda forum http://forum.amilda.org/viewtopic.php?id=65 -or- directly: http://www.scintilla.utwente.nl/~marcelg/adm5120/adm5120gpio_with_switch_leds/ (This uses the new gpio driver from Sergio)
If you want to have the support in the old driver (led.c/h), use the modified driver from TheKr1S. I saw that he has also added support for controlling the switch leds to the 'old' driver.
2x Modded Sweex LB000021 with USB and LCD, Linksys WRT54G |
 |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/18/2006 : 00:06:46
|
TheKr1S - could you put the working firmware for the router on line please as offered? Has that got the USB drivers or USB boot?
I have a working toolchain for Midge kamikaze (with boot from USB memory stick) - but it is still mainly black magic for me. If you can please make your driver available please also say exactly where I add it in the build process. I have a "new users" guide at http://www.sunspot.co.uk/Projects/SWEEX/files/notes.html Could you help me modify that with basic instructions as to how to add your driver?
12 new lines is quite a prospect!
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/18/2006 : 18:34:51
|
I loaded the amilda-6104k-0.4.4.RMW.zip downloaded from TheKr1S above and the flashing light show and web pages are impressive!
But I want to add that function to my Midge toolchain as built following IJs at http://midge.vlad.org.ua/forum/viewtopic.php?t=229&postdays=0&postorder=asc&start=0
do I just dump led.c and replace it with led_app.c in arch\mips\am5120 ?
Is led_app.c the driver or just the flashing light show?
Then what terminal command will control the LEDs? - I want to put that into a .sh script that I run from a simple html web page.
Seems to me that the margro files are only for Amilda? Is that so? Sorry - new user...
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
TheKr1S
Netherlands
24 Posts |
Posted - 05/18/2006 : 21:06:12
|
I put a zipfile online at http://wasse632.speed.planet.nl with the original and modified led driver. see also the readme.txt in the zip file.
sunspot: I'm afraid you cannot control the leds from the shell. You have to make a small program routes the command line parameters to the ioctl call to the driver. then call that program from the shell. I did NOT build in support for echoing 'on' and 'off' to /dev/led0
NOTE that the reset switch is not supported in the modified driver. So disable the reset switch monitor on your router else your router keeps resetting and erasing the router configuration.
Note2: it's a draft version of the driver. i did not plan to do more work on it. it was just for playing.
Note3: the leds of my router can be controlled via the web: http://wasse632.speed.planet.nl/leds.php
Note4: the site may be offline when i'm testing. retry later then. enjoy it!
RMW
http://wasse632.speed.planet.nl |
Edited by - TheKr1S on 05/18/2006 21:17:09 |
 |
|
|
Sunspot
United Kingdom
51 Posts |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/21/2006 : 15:41:06
|
Elektor and other hardware enthusiasts!
I can now control from a web page, and all at the same time -
10 lines as outputs (the ethernet status LEDs) 4 lines as outputs or INPUTS (the GPIO bidirectional lines) 2 RS232 lines (one terminal line and one free for any use)
The web page resides in a directory (var/www) on the USB memory stick from which Midge Kamakazi Linux boots. You can modify the USB stick contents without having to recompile the kernel.
I have 1 Gig Bytes available on my stick. So now to control the world.
Special thanks to (among others) Midge, IJs, Electrickery, TheKr1S, Phill and an anonymous contact for all their help.
But wait!
How about - An I2C driver? Web pages that display data received by the Router? Working ftp? HELP!
see my preliminary notes at http://www.sunspot.co.uk/Projects/SWEEX/led_control.html
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
TheKr1S
Netherlands
24 Posts |
Posted - 05/22/2006 : 09:59:19
|
Sunspot can control the world! Watch-out, take shelter.
Note that pinns to which the LAN and WAN leds are connected can also be programmed as input. The adm5120 has 4 GPIO pinns and 15!! LED (= also I/O) pinns. I should say:
There is more to control!
RMW
http://wasse632.speed.planet.nl |
 |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/22/2006 : 10:31:09
|
So what are you waiting for!!?! How about a new led.c and led.h then? (when Sunspot controls the world you TheKr1S can run Holland)
(an 8 bit bidirectional port would be great)
Still, I really want I2C since my home network runs that and I saw a reference in the tool chain. Has anyone done that?
If not, I plan to build this RS232 to I2C converter See - http://members.localnet.com/~kmmp/PIC/
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
TheKr1S
Netherlands
24 Posts |
Posted - 05/22/2006 : 12:59:10
|
Sorry, they are not bidirectinal. they can be configured as input or output, but not at the same time.
I did not plan to do anything on the led.c because I don't have any purpose for it. I will only fix the reset switch functionality.
RMW
http://wasse632.speed.planet.nl |
 |
|
|
TheKr1S
Netherlands
24 Posts |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/22/2006 : 15:37:16
|
I have just discovered devmem2.c http://www.lartmaker.nl/lartware/port/devmem2.c that seems to be able to let me change the status of any one of the 15 LED lines. Guess I can compile it in my toolchain then run it on the Sweex terminal(?)
Does anyone have a list of example codes/numbers to feed it to make the some of the 15 LEDs inputs?
I know that I need status 0000 for input but looking at the spec sheet the memory format etc is confusing.
Also found an I2C driver - i2c-adm5120.c Can anyone offer a tutorial on that?
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 05/25/2006 : 12:49:28
|
I could not resist the temptation.
I connected the 5 LED pins that are free on the CPU and I now have 15 LED output lines. TheKr1S kindly updated led.c and it worked first time for me even though he has no connections yet on his router and could not test it. (now that's what I call a code god - he can have France as well)
see http://www.sunspot.co.uk/Projects/SWEEX/led_control.html and my data record http://www.sunspot.co.uk/Projects/SWEEX/led_data.html
You just need a craft knife with a long V shaped blade ending in a very sharp point and a desk mounted magnifying lens. I now find the easiest way is to prize up the foot of the pin and crack the solder joint. The knife is at 30 degrees to the board and does not get in the way of your view. I have done 9 without a failure.
Go for it!
Now someone please help make them inputs and I will give you Italy. (but we can negotiate)
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
Sunspot
United Kingdom
51 Posts |
Posted - 07/14/2006 : 10:16:48
|
Update for hardware control enthusiasts -------------------------------------------
I have a 5 port hub working OK on a single IP now - see the mod on my website.
I am controlling a DS-SCX16S servo control chip from the second rs232 port to control a web-cam. see:- http://www.totalrobots.com/access_files/sm_drivers.htm#ds-scx
Help please! - question for the experts --------------------------------------------
I use the IJs "boot from USB memory" on Midge Kamikazi.
How can I set up a folder to store jpegs from my webcam in RAM and so preserve the Flash memory?
ALSO ---- has anyone got an I2C driver RUNNING OK in the router?
Thanks to all
http://www.sunspot.co.uk/Projects/Sweex.htm |
 |
|
|
Sunspot
United Kingdom
51 Posts |
|
Topic  |
|