On Networks N150R Routers

Picked up a couple of these from Newegg for free plus a couple of bucks shipping after rebate.  Figured that in combination with a couple of relays on the GPIOs, I could probably use them for switches or work with the serial port for a sensor connection.  Just a few notes on them.

OpenWRT 15.05 Chaos Calmer patched to expose the GPIOs:  https://micu.webserwer.pl/pmwiki/pmwiki.php?n=OpenWRT.Downloads

Forum thread on not flashing direct to 15.05.1; I went to 14.07, then to 15.05.  https://forum.openwrt.org/viewtopic.php?id=51576

OpenWRT Wiki page with device info including GPIOs https://wiki.openwrt.org/toh/netgear/wnr612v2

Controlling the GPIOs

From here, the simple way to control the GPIOs natively is with the “brightness” value for the LEDs.  By example for the LAN1 LED (others are in the same path):

root@OpenWrt:~# echo 0 > /sys/class/leds/netgear\:green\:lan1/brightness
root@OpenWrt:~# echo 1 > /sys/class/leds/netgear\:green\:lan1/brightness

Update 9/18/2016

Finally got the LAN2 LED peeled off of the board, had a heck of a time with it.  After doing so, I discovered that I only get ~2.5v across the pins when the GPIO is active… not enough to drive my 3.3v relays.  I assume they are probably using a voltage divider here.  Measuring the resistance between the positive and negative ends of the LED without power applied, I get about 1580 ohms one direction, and 670 in the other.  There appears to be a ~960 ohm resistor at CA111, but I haven’t figured out exactly how this ties in.

Update 10/9/2016

Spent some time with this again over the past couple of days.  I removed the resistor at CA111, but apparently it is not a divider.  May need to spend some time to see if I can make something work with a 2N7000 MOSFET or something like that, but I’m pretty novice so that will take some effort.

I did test out my 433MHz ASK receiver on the TTL serial port, but without much luck.  This OpenWRT page was helpful in getting stty installed and setting the baud rate on the serial port,

‘stty -F /dev/ttyS0 9600 clocal cread cs8 -cstopb -parenb’ to set the config, and
‘stty -F /dev/ttyS0 -a’ to verify the config

but still didn’t get any output.  I’ll have to give it a shot with my Raspberry Pi just to see if I can get anything out of there.

Leave a Reply

Your email address will not be published. Required fields are marked *