View Single Post
Old 02-26-2012, 09:43 AM   #31
knc1
Embedded Cheerleader
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,154
Karma: 5830426
Join Date: Feb 2012
Device: Too many.
Network access to /proc/?

If using the Netcat (nc) built into Busybox, you will need to adjust the following nc command to match its limitations.

Objective: Send strings via network to /proc/keypad
Kindle: Listen on all interfaces, using some port number of your choosing (12345)
Remote machine: Assume Kindle appears as 192.168.2.1 on that machines network

Using a full copy of Netcat (nc) and assuming you haven't blocked new UDP connections in the Kindle's iptables setup (that is, open your above choice of port for UDP, state:new).

On Kindle:
(Listen, IPv4, re-start a new connection, no DNS lookups, UDP)
nc -l -4 -k -n -u 12345 >/proc/keypad

On remote machine:
echo "send 104" > nc -4 -n -u 192.168.2.1:12345

The Kindle end will auto-restart its listening for the next connection when it finishes receiving the above UDP packet.
I.E: You don't have to repeat the Kindle nc command, it will continue until you kill it.

Embellish as desired.
Such as start the Kindle nc command "on demand" using inetd and inetd.conf (in which case you don't need the "-k" - inetd will take care of start/stop of nc).

Last edited by knc1; 02-26-2012 at 09:53 AM.
knc1 is offline   Reply With Quote