This year, for my birthday I have a very nice Media Player M3100. This stuff is really usefull, no need to use a noisy computer to watch recorded Divx. It’s pretty kool to watch films from beds you know..
The only issue: I need to take it back to my computer when I want to upload a new film, that’s it .. When I first received this gift, I went back to the shop to exchange it against a networked one. But 1) they cost a lot more money, 2) not available at the shop. (even if it’s a really big one).
Last week, somebody sent me a mail. He found some cheap wireless access point with a USB port: Netgear WGT634U. (50Euro) Hum, ok let’s give it a try. First test, plug a Media Player to this USB port… ok It’s working fine. But you know, I don’t have a network cable near my bed, so I decided to transform the Access Point in a Wireless client. By this way, I can simply plug the Media Player on the WGT634U and remotely put some Divx via FTP, without any wire.
The default firmware on the WGT634 doesn’t support wireless client mode (It’s a AP). So I switched it to OpenWRT Kamikaze. I build the firmware from source, but the kamikaze snapshot shoud work too. I followed the OpenWRT guide step by step with a external serial plug. You can find the complete howto for the serial connection here
# hit Ctrl-C on the bootloader
CFE> ifconfig eth0 -auto
CFE> flash -noheader tftp_host:openwrt-wgt634u.bin flash0.os
CFE> reboot
The first boot is a bit long, but all is fine…
Ok that’s fine, but I want to restrict the access to my local network only.. so I need to hack the firewall a little to avoid remote access from other wireless clients (my wireless network is open you know..). Simply linked this little script in /etc/rc.d/
/opt/ftp-firewall
#!/bin/sh
# clear all firewall rules
for T in filter nat mangle ; do
iptables -t $T -F
iptables -t $T -X
done
# drop incomming packet
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
# accept traffic on localhost
iptables -A INPUT -p tcp -i lo -j ACCEPT
iptables -A INPUT -p udp -i lo -j ACCEPT
# accept ftp only from my home network
iptables -A INPUT -s 192.168.1.0/24 -p tcp -i br-lan --dport 21 -j ACCEPT
# accept incoming http / ssh
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# finaly accept already open Cnx
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
After some tests, I discover that I need a way to know if the WGT634U managed to join the wireless network or no. So I added this little script, that check for the wireless BSSID, and turn the power led in yellow if something goes wrong .. this is really usefull in fact.
/opt/led-daemon
#!/bin/sh
while true
do
{
STATE=$(iwconfig ath0 |grep 00:13:13:53:DA:D1 | wc -l)
[ $STATE -eq 1 ] && echo 0 > /proc/diag/led/power
[ $STATE -eq 0 ] && echo 1 > /proc/diag/led/power
sleep 20
}
done
Foo
Here the result:
The finished product (grrr) works really fine and managed to achieve something like 850Ko/sec, I mean full speed ;) (11Mbs network) I need to remove the serial port right now, and close the box..
Important update
I read on Engadget that I use this to stream video to my TV, (like the Apple TV do), but this is absolutely wrong. This media player has a 320Go hard-drive. Why would stream film on this ? I just put it on that’s it :)
This is really amazing how people doesn’t read the article to see what I’ve done. It’s not the first time this happen in fact.
Here in France, most advanded users have some network TV from a long time, and this little boxes can play network stream (like the Apple TV) for a long time now. Beside you don’t pay for this service (rent for the boxes are included in DSL bill), the only issue is that you must have another computer to stream.
I guess nobody here (in France) would by a Apple TV, since we already have this kind of products for free for a long time. Look at a Freebox for example.
It’s time to watch a film :)