View source for User:Nukama
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to User:Nukama.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to User:Nukama.
Dynamo powered openmoko (and other USB-Devices/Host) using the frequency/voltage of the dynamo to gather information about speed and distance.
Wishlist for this USB-Charger:
nice to
== /etc/network/freerunner == chmod -x
DEVICE=usb0 IPADDR=192.168.0.200 REMOTE_IPADDR=192.168.0.202 NETMASK=255.255.255.0
DNSIP=$(awk '$1 == "nameserver"{print $2; exit(0);}' /etc/resolv.conf)
case "$1" in start) iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP
if [ "$(cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then echo "temoprarely allow ip_forward for openmoko" > /var/run/openmoko.ip_forward echo 1 > /proc/sys/net/ipv4/ip_forward fi
stop) iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP
if [ -f /var/run/openmoko.ip_forward ]; then rm /var/run/openmoko.ip_forward echo 0 > /proc/sys/net/ipv4/ip_forward fi
esac
== /etc/udev/rules.d/80-freerunner.rules
KERNEL=="usb[0-9]*", DRIVERS=="cdc_ether", ACTION=="add", RUN+="/usr/local/sbin/freerunner-usb-add.sh %k"
== /usr/local/sbin/freerunner-usb-add.sh == chmod -x
( ip address add 192.168.0.200/26 netmask dev usb0 > /dev/null ip link set usb0 up > /dev/null /etc/network/freerunner start ) & exit 0