HeaterMeter + LinkSys WiFi Router = LinkMeter


 
I changed lcd's to the smaller one and I think burned out pin 11 for the back light im only getting 3.4 stable volts from it.

The good news is the when im connected to the 12volts on the router the HM turns on everytime without gibberish.

Bu, I still can get any info passed to the router and heatermeter. When I put the multimeter on pin 2 of the Atmega i get about 55mv to average of about 65mv and on pin3 (TX) i get about 130mv. Using mv because it seems easier to read then Volts.
 
im just as confused, lol. I can't seem to get it to talk to the router. I have the first Tmp file /tmp/hm.rrd. but i can't get the other two tmp files.

I am using a older version the heatermeter files, I had downloaded just before Byran went to Open-WRT and before the wireless. I have tried just about everything i can think of to get this to communicate.

I will look at the instructable, have not had the time to check it out yet.
 
Yeah I'm still out of town on business for the next two days with limited Internet access. Regarding using the transistor to drive the backlight:

Arduino Pin -> 1k Resistor -> Transistor Base/Gate
LCD backlight (-) cathode -> Transistor Collector/Drain
Transistor Emitter/Source -> Ground
 
img20110627081014.jpg


img20110627084518.jpg

As you can see, i only have one wire to the serial port for the time being until i figure that stuff out, im just using the 12volt from the router basically

I had to use mty little display until i add the transistor to run 90mA. And i just have the sd card set temporary to adjust it in the case. but it works lol.

It works as is. But, i still am very lost when it comes to OpenWrt. I tried again with it and I can not get it to work. I need it to be able to get a connection with another router(repeater bridge) and if I can not get that then its not going to work. and the GUI in OpenWRT SUCKs big time, compared to DD-wrt. Its really hard to understand.
 
Originally posted by Bryan Mayland:
Yeah I'm still out of town on business for the next two days with limited Internet access. Regarding using the transistor to drive the backlight:

Arduino Pin -> 1k Resistor -> Transistor Base/Gate
LCD backlight (-) cathode -> Transistor Collector/Drain
Transistor Emitter/Source -> Ground

So, basically not to much difference then the connection to the fan, except that its staying 5volt and the just the mA is getting the bump to run the backlight.

I found this transistor. This should work

http://www.fairchildsemi.com/ds/2N/2N3904.pdf
 
I used a BC337 which I think is the same as a 2N2222 with possibly a different pinout.

If you just want LinkMeter to connect to another wireless AP, you don't need repeater bridge, you just need client (station) mode. Ed mentioned something you might have missed too, because Ed tends to get pretty descriptive
icon_smile.gif
. If your established network, the one you are connecting to, is 192.168.1.x you MUST change LinkMeter's LAN subnet to something else before you configure the wireless or you'll completely hose yourself. The problem being if the wireless AND the LAN are on the same subnet TCP/IP doesn't know *** you're trying to do.
 
Originally posted by John Bostwick:
img20110627081014.jpg


img20110627084518.jpg

As you can see, i only have one wire to the serial port for the time being until i figure that stuff out, im just using the 12volt from the router basically

I had to use mty little display until i add the transistor to run 90mA. And i just have the sd card set temporary to adjust it in the case. but it works lol.

It works as is. But, i still am very lost when it comes to OpenWrt. I tried again with it and I can not get it to work. I need it to be able to get a connection with another router(repeater bridge) and if I can not get that then its not going to work. and the GUI in OpenWRT SUCKs big time, compared to DD-wrt. Its really hard to understand.


Just like Bryan said, you'll want to put it into client mode. As for OpenWRT, the configuration concepts are the same and the interface configuration is the same or very similar. Try putting it into client mode and if that doesn't work, let me know and I'll help you troubleshoot
icon_smile.gif
 
Why don't you tell us what you're trying to do and I'll tell you how to do it?

If you're trying to connect LinkMeter to your existing wireless network, here's the what I need to know:
-- Is your network assigning addresses automatically (DHCP)? If so, what is the range of addresses used? I don't need the exact range here, just give me an IP address of a machine that has been assigned.

-- The subnet, default gateway, and DNS server. This can also be determined from an existing client machine by opening a command prompt and typing `ipconfig /all`

-- The wireless information
----- SSID
----- Channel
----- Encryption mode: None, WEP, WPA, WPA2, WPA-PSK, WPA2-PSK, RADIUS
----- I don't need to know your wireless password but you'll need to know that obviously
 
The standard firmware image now has everything needed to support the SD card, and mount it as your root filesystem, as well as the hostapd for configuring linkmeter as an AP with WPA/WPA2 encryption, the full LuCI admin interface, and has the linkmeter service built in. It also supports writing to nvram so the first step of the install process is now to install it rather than the 2.4 kernel OpenWrt.

EDIT: FORGOT THE BIGGEST CHANGE
The default LinkMeter installation is no longer 192.168.1.1. I think everyone's standard home network uses that subnet by default so I've changed the LAN ports on LinkMeter to default to 192.168.200.1. This is in failsafe mode (preinit) as well as once booted.
 
Yet another version now up. This one has DHCP enabled on the LAN ports as well. After the initial flashing, you should be able to just plug in to a LAN port and go to http://192.168.200.1/ and LinkMeter should come up. The link to configure the wireless is at the bottom of the page labeled "OpenWrt admin".

I'll update the install documentation when I get a chance. The short version is (from stock Linksys firmware): flash the custom BIN image from their web interface, wait, configure via http://192.168.200.1/
 
Ok, I have it connected to the heatermeter and I have the router setup. Im not getting any info from Arduino to router. Is there a easy way to verify connections.

Should i just turn everything on and i should get info passed to the router automantically?
I can't even get a serial hookup with it and the power button just blinks.

I tooked the Version 2 I had and Followed the direction you had sent and again I had to do the same as I did this morning by clicking joining a network. Then I still did not get a connection, I started over and I joined the Nectwork again and this time i made the changes in the advance settings and it works fine now. Except no info is being passed from router to Arduino.
 
Originally posted by John Bostwick:
Ok, I have it connected to the heatermeter and I have the router setup. Im not getting any info from Arduino to router. Is there a easy way to verify connections.
It should just work in that the HeaterMeter starts up and sends data and once the router boots and starts LinkMeter, it starts recording.

I'd say step 1 is to stop the linkmeter daemon and see if you're getting any data from the serial port. SSH into it and:
/etc/init.d/linkmeterd stop
cat /dev/ttyS1

Every 2 seconds you should see a line of log data coming out. If you get nothing hit Ctrl+C to stop it and try the other serial port:
cat /dev/ttyS0

Still nothing? Which version of the HeaterMeter code are you running? You need something from when the baud was changed to 115200, which is at least a month ago. On the most recent code? Make sure you've compiled with HEATERMETER_SERIAL enabled and HEATERMETER_NETWORKING disabled (the default). Got that? Make sure you don't have your RX/TX lines reversed.

If you get garbage when doing one of the cat /dev/ttyS, the baud rate may be wrong. You can change it with:
stty -F /dev/ttyS1 115200

Try maybe 9600, 19200, 57600. If one of those work, your HeaterMeter code is old.
 
Also your power light should be on steady I believe. Mine boots up and goes like this:
Power light blinking - Router is in bootloader waiting a few seconds for you to tftp something to it. After 3 seconds or so it loads the kernel (power light still blinking)
Power light steady, DMZ light steady - Router is checking failsafe mode. If you press any button during this time you'll enter failsafe mode where you can ssh in and change things.
Power light steady, DMZ light blinking fast - Router has booted to failsafe mode
Power light steady, DMZ off - Router finishing boot process or completely booted

I also have 2 lights, one orange one white, that both come on when the wireless is connected.
 
If you don't have the RFM12B, then comment out the line that says HEATERMETER_RFM12 at the top of hmcore.h. It does work even if that's defined, but it could hang on bootup looking for the device. Most of the time you'll get lucky and it will boot but there is a chance it won't. Therefore it is safest to just disable it in the source code.

Also, I configured my router like you did, with the clicking "join network" or whatever and now my power light blinks all the time too. So I guess that's eeeerrrr normal?
 
I just pushed new heatermeter code to github. This simplifies the RF Mapping a bit by removing the /set?rm=ABC url completely. Now you just use the probe coefficient setter and the type is implied.

PC setter:
/set?pcX=A,B,C,R,TRM
A, B, C - the Steinhart coefficients for probe X
R - the value of the fixed resistor
TRM - If TRM is a single digit number, it is a probe type: 1 for disabled, 2 for internal, 3 for RFM12. However, if TRM is a single capital letter A-Z followed by a single number 0-5 it sets the probe type to 3 (RFM12) and also maps the incoming source and source pin.

You can (and should!) measure the exact resistance of your fixed resistors and put their values in for the respective probes. This means we really don't need to use 1% tolerance resistors any more, because you can compensate here for their actual values. However, it is still best to use metal film or better resistors because their temperature variance is lower than the cheapo carbon ones. Not that it matters, we're talking pennies here right?

Examples!
/set?pc0=2.3067434e-4,2.3696596e-4,1.2636414e-7,10000,2
This sets probe 0 (pit) to use the Maverick steinhart coefficients, a 10k resistor, and an "internal" probe type.

/set?pc0=0,0,0,22000
Set probe 0 (pit) to keep the same steinhart coefficients and type it has, but changes the resistor to 22k ohm

/set?pc3=0,0,0,0,0,B1
Set probe 3 (ambient) to probe type RFM12 and pull its value from RF node "B" pin Analog 1

This will all have a proper web UI once I can get to it of course.
 
Oh also I fixed some code in the LinkMeter Remote code last night. For some really odd reason when I told the AVR to power down and sleep it would enter sleep for the requested amount of time but not power down. This meant it would pull FULL POWER for the duration of the sleep. This would happen at least 1 out of every 10 sleep calls which meant that instead of being awake for 10ms and in power down for 9990ms, we'd be pulling full power the whole time.

Awake power usage: up to 30mA
Sleep power usage: <0.05mA

Usage for "bad" power scenario, 10s period: 0.083mAH
Usage for proper power scenario, 10s period: 0.00022mAH
377x normal power draw!

Hopefully it is fixed now.
 
Originally posted by Bryan Mayland:
If you don't have the RFM12B, then comment out the line that says HEATERMETER_RFM12 at the top of hmcore.h. It does work even if that's defined, but it could hang on bootup looking for the device. Most of the time you'll get lucky and it will boot but there is a chance it won't. Therefore it is safest to just disable it in the source code.

Also, I configured my router like you did, with the clicking "join network" or whatever and now my power light blinks all the time too. So I guess that's eeeerrrr normal?

I did the following and the Arduino started up as usual, with the usual touch of pin 2 with a finger, this morning

Edit as I was typing this I decided to try one more time with a version 2 router, why not I have destoyed two 3.1, one 3, I have a 1.1 that has no serial connection, and I destoyed a 3gs model.

And this is all I Got
icon_biggrin.gif


fially.png
 
I made some time this morning and soldered in the SD card adapter I had. I had purchased an 8gb micro SD card for my phone and it came with a full sized adapter which made it incredibly easy to solder in. Disregard the extra solder on the 2nd GND connection, they are linked internally so I only needed one wire. Inserted a Sandisk 2GB microsd card which I had formatted with ext2. Edit the configuration file
/etc/config/broadcom_sdhc26

And set enabled to 1, and it came right up on boot. 2GB of storage hoooooooooo.
IMG_0433.JPG


This is with my standard custom firmware that has all the needed modules and configuration.
 
Originally posted by Bryan Mayland:
Also, I configured my router like you did, with the clicking "join network" or whatever and now my power light blinks all the time too. So I guess that's eeeerrrr normal?
The reason the light is blinking is because it doesn't think the WAN interface is up. You may also notice the time is wrong (at least on my device it thinks it is like May 2010). This is because it only updates the time from the NTP server when the WAN interface is up.

When you do the "join network" thing, it creates a third interface called wwan and bridges that to the wan. Because the wan interface isn't technically up, the light blinks to tell you you have no connectivity and the NTP client never gets the current time. The only way it does this is if you edit the wifi config and don't create the wwan interface. This is something that should probably be fixed in OpenWrt but I don't have the time dig into it.

So the solution is either fix OpenWrt or make the configuration work (remove the wwan interface, set wireless to use network=lan):
/etc/config/network
<pre class="ip-ubbcode-code-pre">config 'switch' 'eth0'
option 'enable' '1'

config 'switch_vlan' 'eth0_0'
option 'device' 'eth0'
option 'vlan' '0'
option 'ports' '0 1 2 3 5'

config 'switch_vlan' 'eth0_1'
option 'device' 'eth0'
option 'vlan' '1'
option 'ports' '4 5'

config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'

config 'interface' 'lan'
option 'type' 'bridge'
option 'ifname' 'eth0.0'
option 'proto' 'static'
option 'netmask' '255.255.255.0'
option 'ipaddr' '192.168.200.1'

config 'interface' 'wan'
option 'ifname' 'eth0.1'
option 'proto' 'dhcp'</pre>
/etc/config/wireless
<pre class="ip-ubbcode-code-pre">config 'wifi-device' 'radio0'
option 'type' 'mac80211'
option 'macaddr' '00:25:9c:52:44:5e'
option 'hwmode' '11g'
option 'disabled' '0'
option 'txpower' '20'
option 'country' '00'
option 'channel' '11'

config 'wifi-iface'
option 'network' 'wan'
option 'encryption' 'psk2'
option 'device' 'radio0'
option 'mode' 'sta'
option 'key' 'mykey'
option 'ssid' 'capnbry24'</pre>
Note that my channel is 11, that might be easy to miss.
 

 

Back
Top