CodeWalrus

Development => Hardware => Topic started by: DarkestEx on May 07, 2015, 12:13:15 AM

Title: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on May 07, 2015, 12:13:15 AM
I bought myself a Netgear WNR2200 Router. Not that I need it for it's original purpose, but it is a quite advanced little Linux computer with Wifi and USB actually.
It also has 4 MB Flash for the kernel (you can still use USB with overlay ext4 or fat32 fs to expand up to 32 GB or even more). I built my own firmware for it, which is based on the same Linux distribution as the stock one: OpenWrt.
I am using the trunk version Chaos Calmer which works great on this model, although I needed to patch some files to get it working.
I compiled USB drivers, got the USB chip working and included avrdude (only on overlay fs right now), gcc (overlay fs) and some usb serial FTDI drivers.
I am playing with the idea of letting the router (which I set to client mode wifi), connect to an Arduino / Atmel ATmega chip to get linux and web capabilities.
The router is (as far is I know) more powerful than the Arduino Yun and also a lot cheaper. I bought the router from amazon as used. It was one product that has already been opened but then sent back. It is alright, only the packaging was damaged.

I hope this is somehow useful.
Greetings, Benedikt
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Snektron on May 07, 2015, 07:47:56 AM
whoa thats cool, i didn't know Routers ran on Linux :o Maybe i can hack into my own router which we dont use anymore the same way...
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on May 07, 2015, 09:25:23 AM
Quote from: Cumred_Snektron on May 07, 2015, 07:47:56 AM
whoa thats cool, i didn't know Routers ran on Linux :o Maybe i can hack into my own router which we dont use anymore the same way...
I am sure thats possible.
You should really try it.
Just ask me if you need any help.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Dream of Omnimaga on May 09, 2015, 04:51:55 AM
Wait, does a router have a CPU? I am curious about how well it could run actual softwares such as a small game or text displaying routine?
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Snektron on May 09, 2015, 06:46:54 AM
Well appearantly it has. I haven't really though about it before though...
Also i think it would be quite well, considering you probably need a few hundred Mhz to run such a thing
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Duke "Tape" Eiyeron on May 09, 2015, 07:08:01 PM
A router does have a system (at least the high-end ones) to manage filtering, groups and redistribution. I remember in class having to use minicom to communicate to a router to configure it. I remember well this exercise becaus my glasses broke just before an eight-hour work. Cue headache after 20 minutes.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on May 09, 2015, 09:12:10 PM
Quote from: DJ Omnimaga on May 09, 2015, 04:51:55 AM
Wait, does a router have a CPU? I am curious about how well it could run actual softwares such as a small game or text displaying routine?
Yes it does ;)
Think about it: These things need to deliver gigabit Ethernet and do WLAN, so they need some kind of processor and OS to handle all this.
Most routers run Linux as their OS, but some do run a proprietary RTOS.

E.g. the router I'm using in this case (Netgear WNR2200) has following specs:
CPU: Atheros AR7241 (MIPS architecture) @ 360 MHz
RAM: 64 Mb
Flash: 8 Mb
Interfaces: 1x USB 2.0, 5x Ethernet (1x WAN + 4x LAN @ 100 Mbit/s), Wifi (IC: AR9287, bgn, Host + Client Mode), JTAG, Serial, SPI
I/O: ~22 LEDs, 3 Buttons, and possibly more GPIO inside
Image: [spoiler=Big Image](http://www.hardwareluxx.de/images/stories/newsbilder/mhaber/2010/WNR2200.jpg)[/spoiler]

Yes, it certainly is able to run a terminal game over SSH.
It could probably even drive an LCD or using another PC as an X11 server and run a graphics game.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: novenary on May 10, 2015, 07:19:25 AM
Some routers run some kind of BSD too. pfSense is based on freebsd and is another custom router firmware.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Dream of Omnimaga on May 13, 2015, 06:54:54 AM
Quote from: DarkestEx on May 09, 2015, 09:12:10 PM
Quote from: DJ Omnimaga on May 09, 2015, 04:51:55 AM
Wait, does a router have a CPU? I am curious about how well it could run actual softwares such as a small game or text displaying routine?
Yes it does ;)
Think about it: These things need to deliver gigabit Ethernet and do WLAN, so they need some kind of processor and OS to handle all this.
Most routers run Linux as their OS, but some do run a proprietary RTOS.

E.g. the router I'm using in this case (Netgear WNR2200) has following specs:
CPU: Atheros AR7241 (MIPS architecture) @ 360 MHz
RAM: 64 Mb
Flash: 8 Mb
Interfaces: 1x USB 2.0, 5x Ethernet (1x WAN + 4x LAN @ 100 Mbit/s), Wifi (IC: AR9287, bgn, Host + Client Mode), JTAG, Serial, SPI
I/O: ~22 LEDs, 3 Buttons, and possibly more GPIO inside
Image: [spoiler=Big Image](http://www.hardwareluxx.de/images/stories/newsbilder/mhaber/2010/WNR2200.jpg)[/spoiler]

Yes, it certainly is able to run a terminal game over SSH.
It could probably even drive an LCD or using another PC as an X11 server and run a graphics game.
Can it run DOOM? O.O
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on May 13, 2015, 11:02:43 AM
Quote from: DJ Omnimaga on May 13, 2015, 06:54:54 AM
Quote from: DarkestEx on May 09, 2015, 09:12:10 PM
Quote from: DJ Omnimaga on May 09, 2015, 04:51:55 AM
Wait, does a router have a CPU? I am curious about how well it could run actual softwares such as a small game or text displaying routine?
Yes it does ;)
Think about it: These things need to deliver gigabit Ethernet and do WLAN, so they need some kind of processor and OS to handle all this.
Most routers run Linux as their OS, but some do run a proprietary RTOS.

E.g. the router I'm using in this case (Netgear WNR2200) has following specs:
CPU: Atheros AR7241 (MIPS architecture) @ 360 MHz
RAM: 64 Mb
Flash: 8 Mb
Interfaces: 1x USB 2.0, 5x Ethernet (1x WAN + 4x LAN @ 100 Mbit/s), Wifi (IC: AR9287, bgn, Host + Client Mode), JTAG, Serial, SPI
I/O: ~22 LEDs, 3 Buttons, and possibly more GPIO inside
Image: [spoiler=Big Image](http://www.hardwareluxx.de/images/stories/newsbilder/mhaber/2010/WNR2200.jpg)[/spoiler]

Yes, it certainly is able to run a terminal game over SSH.
It could probably even drive an LCD or using another PC as an X11 server and run a graphics game.
Can it run DOOM? O.O
Probably yes :P
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Snektron on May 13, 2015, 01:52:34 PM
I guess we have a challenge for you, Darkest :P
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on May 13, 2015, 02:04:41 PM
Quote from: Cumred_Snektron on May 13, 2015, 01:52:34 PM
I guess we have a challenge for you, Darkest :P
Challenge accepted!
Title: Re: Using a Router to play DOOM?!
Post by: DarkestEx on May 13, 2015, 03:25:12 PM
Wooha, that would cost me 22€ for the TFT.  O.O
As soon as I can confirm that I have access to the hardware SPI, I will go ahead and buy the TFT.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Dream of Omnimaga on May 13, 2015, 03:32:14 PM
Not bad I guess. :D
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on June 20, 2015, 09:21:14 PM
So I think that I will make a WiFi music player with an LCD out of it.
That will probably be the best thing to do with it. The doom thing will have to wait.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Dream of Omnimaga on June 24, 2015, 05:45:29 PM
Will it be able to play music hosted on your computer if you make your computer into a server, for example?
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: DarkestEx on June 28, 2015, 08:40:43 PM
Quote from: DJ Omnimaga on June 24, 2015, 05:45:29 PM
Will it be able to play music hosted on your computer if you make your computer into a server, for example?
Yes it will stream music and it will have some sort of USB storage somehow.
Title: Re: Using a Router to program and communicate with Atmel AVRs
Post by: Dream of Omnimaga on June 29, 2015, 06:01:05 AM
That is cool and the USB storage is a nice touch :)