Access Point for use away from home


 

Robert Burditt

TVWBB Member
I was reading through past posts and have run across a few posts that talk a little about the desire to use the HM in AP mode but didn't see any instruction on how that is done or how to add the DHCP server to HM. Can someone who has done this walk me through the process? Maybe the DHCP server isn't necessary if it uses the same IP each time and our mobile devices can just point to it??

I copied this from a post in another thread:

Originally Posted by RJ Riememsnider
Question about the wireless capabilities as well, is there routing capability like before or just the ability to connect to a single network? Is there client and AP modes before with a DHCP server?
I'm not sure about the routing capability if you wanted to use the device like a firewall but it may be possible.

It does have both client and AP mode, but the DHCP server has to be installed manually. Good news though, unlike the WRT54GL, you can install any package from the standard OpenWrt package repository (that's the RC1 but there will be one for final too). That package is dnsmasq.
 
The DHCP server is added by adding the dnsmasq package from the OpenWrt repository (RC1 right now):
http://downloads.openwrt.org/attitu.../generic/packages/dnsmasq_2.62-2_brcm2708.ipk

Go to Configuration -> System -> Software, paste that into where it says "download and install package" and hit OK.

To enable AP Mode:
-- Go to System -> Startup, located dnsmasq and make sure it is set to enabled.
-- Go to Network -> Wifi -> Edit. Switch the mode to access point and change any other wifi options you want. Hit "Save" (no apply)
-- Go to Network -> Interfaces -> WWAN -> Edit. Change protocol from DHCP to Static. Then click the button "Switch protocols"
-- Hit the button "Enable DHCP"
-- Enter your static network information. DO NOT use network 192.168.200.x as this is used by the LAN interface.
-- Save and Apply

After the changes are applied you will lose contact with the web interface. Reboot the Pi.
 
Robert, This was an important feature for me as i cook over at friend's houses a lot and sometimes at competitions. How about you keep the linkmeter in client mode and when away from your home network, turn on tethering on your phone with the same SSID as your home network? That would also allow your linkmeter true internet access.
 
Isn't the SSID tied to the MAC address of the router? So you're saying that if I had several routers who's SSID was the same w/ same password, the HM would automatically connect?
 
It is a bit confusing, but the BSSID is the mac address of the router. The SSID is the "network name" you see when browsing for a network. A single SSID can have multiple BSSIDs that all make up the same wireless network, but they all (should) have the same network name, security mode, and password.

To get HeaterMeter (OpenWrt) to connect to any wireless network with the right network name and password, go to Network -> Wifi -> Edit then clear out the field "BSSID". If this field is filled, which it will be if you use the Scan -> Join method to create the configuration, then HeaterMeter will only connect to that specific router. Clear out the BSSID, save and apply, and it will connect to any network with the right name and key.

EDIT: After I changed it luci stopped responding. I could still SSH in though so I rebooted it and it connects to either my AP and Android Tether depending on which I have turned on.
 
Last edited:
To get HeaterMeter (OpenWrt) to connect to any wireless network with the right network name and password, go to Network -> Wifi -> Edit then clear out the field "BSSID". If this field is filled, which it will be if you use the Scan -> Join method to create the configuration, then HeaterMeter will only connect to that specific router. Clear out the BSSID, save and apply, and it will connect to any network with the right name and key.

Great tip! I hadn't thought about just turning tethering on my phone on when I do remote cooks. It's certainly easier than having to hook up wired to a router to reconfigure the WiFi, and then having to do it all over again when I get home.
 
Or another option is to just have 2 SD cards, one for LM in client mode and one for AP mode with DHCP.....

Right, but that means having to crack open the 3d printed case I have to swap the cards out. I could hook it up to the network, let it grab a DHCP address and update the WiFi config faster than I could open and close it..
 
I've been trying to setup my HM as a DHCP server and everything worked except the wireless security. The only way that I could get it to work was with no encryption. When I tried the various security protocols, my phone was unable to join the HM network. Is there something obvious that I'm missing?

I also had another related question. Let's say that I don't tether and instead set it up as DHCP server, and when cooking at home wanted it to have internet access for itself and any device connected to it. Is it as simple as using my home router's IP for the IPv4 gateway in the WWAN settings? Or is bridging what I would need to do and is that a simple task?

Thanks!
Bob
 
Yes, the HM would need to have an IP address that doesn't interfere with anything on your home network, use the same subnet mask, and will use your home router as the default gateway. You will also need to change wifi from AP mode when away from home to client mode to connect to your existing home wireless. The tether option really is easier.
 
I have an even easier option I came up with last night. I was thinking of a way to wire a button or switch to the rPi that would boot it up in one mode or the other, but that relies on installing a switch, and probably a new package, and isn't something that's very easy for a novice to undertake.

So what I was thinking of was this, a simple script you paste into the init.local field on the website. From there, if when the RaspberryPi boots, the lid mode is active (which is easily set by pressing the button to the left) it switches from client to AP mode or AP mode to client then reboots into the new mode.

Any thoughts how that can be better?
 
How could you do that? They're not connected!

Really the largest problem I have with that is that you need to be able to generate a "profile" which includes all of the following:
-- Which adapter: wired, wireless
-- Adapter mode: dhcp, static
-- Static IP address
-- Static IP subnet
-- Static IP gateway
-- Wifi SSID
-- Wifi encryption
-- Wifi password
-- Wifi mode: ap, sta
-- dnsmasq (dhcp server): run or do not run?

You could have one of those for each adapter for each network profile. Where do you manage that data? How is it organized? You'd have to build a giant configuration system that comprises the network adapter settings, wifi settings, and service startup settings all into one bundle. Then somehow catalog and be able to select between them.

I do agree it would be cool if you'd just go into the menu and say "Network config" and select "Client" or "AP", but there's not an easy way to specify what parameters those modes would include. I'm not opposed to it, I just can't imagine how to do it without it being a massive massive undertaking.
 
Could you create a stored value on the HM that the RPi reads on startup and executes a script to copy one of several groups of config files to the correct system location, then restarts the appropriate services?
 
Could you create a stored value on the HM that the RPi reads on startup and executes a script to copy one of several groups of config files to the correct system location, then restarts the appropriate services?
That's sort of what I'm doing but the major question is: how do you trigger switching from one to another. And the second, only less minor question is: how do you set up all those auxiliary files? Set them all up in the web interface then copy them to a profile directory? Seems like an incredible pain in the ***.

Here's what I've got so far that requires absolutely no editing, just paste it into rc.local.
Code:
LID=""
CNT=0
while [ -z "$LID" ] ; do
  CNT=$((CNT+1))
  [ "$CNT" -gt 10 ] && exit 1
  LID=`lmclient | grep -o '"lid":[0-9]*,' | grep -o '[0-9]*'`
done

# Turn off lid mode to prevent a boot loop
lmclient LMST,ld,,,0
# Lid is 0, no change
[ "$LID" -eq 0 ] && exit 0

WIFIMODE=`uci get wireless.@wifi-iface[-1].mode`
if [ "$WIFIMODE" = "sta" ] ; then
  lmclient "LMST,tt,Switching to,Wireless AP"
  uci set wireless.@wifi-iface[-1].mode=ap
  uci commit wireless
  uci set network.wwan.proto=static
  uci set network.wwan.ipaddr=192.168.1.1
  uci set network.wwan.netmask=255.255.255.0
  uci commit network
  /etc/init.d/dnsmasq enable
else
  lmclient "LMST,tt,Switching to,Wireless Client"
  uci set wireless.@wifi-iface[-1].mode=sta
  uci commit wireless
  uci set network.wwan.proto=dhcp
  uci commit network
  /etc/init.d/dnsmasq disable
fi

sync
reboot
It just switches your wifi adapter to AP mode, which uses the same network name and security key as your home wireless network. It isn't working perfectly yet though because something in the boot process turns off lid detect on startup so you've gotta really be on the ball with the timing.
 
This could be more than an AP vs client mode switch. more analagous to a multi user mode. there could be 2-4 labels like the probe name labels that are selected with separate network configs, this could allow you to connect as a client to different networks, or use different static IPs, etc. As for application, how about at startup? If you want to change modes, select the one you want on the HM and power cycle. I don't know that people would want to change modes mid cook.
 
How could you do that? They're not connected!

Really the largest problem I have with that is that you need to be able to generate a "profile" which includes all of the following:
-- Which adapter: wired, wireless
-- Adapter mode: dhcp, static
-- Static IP address
-- Static IP subnet
-- Static IP gateway
-- Wifi SSID
-- Wifi encryption
-- Wifi password
-- Wifi mode: ap, sta
-- dnsmasq (dhcp server): run or do not run?

You could have one of those for each adapter for each network profile. Where do you manage that data? How is it organized? You'd have to build a giant configuration system that comprises the network adapter settings, wifi settings, and service startup settings all into one bundle. Then somehow catalog and be able to select between them.

I do agree it would be cool if you'd just go into the menu and say "Network config" and select "Client" or "AP", but there's not an easy way to specify what parameters those modes would include. I'm not opposed to it, I just can't imagine how to do it without it being a massive massive undertaking.

hey bryan I have an idea that may work....i like your button idea to switch back and forth....
what about setting up a script to use the gpio on the pi then all you have to do is make a script that reads the initial state of the IO of 2 pins... if the loop is open then it boots nornal and if the loop is closed it boots another way. i would make it more of a switch then i would make it anything else. Plus you just have to solder 2 points on the link meter on the back side of the gpio connector .... what do you think any possibility on that one. I know at one time i was working on a garage door opener for siri that did the same thing.
So basically in the boot loader if gpio (whatever) was getting 3.3 v(i think this was the voltage i cant remember) then boot wireless mode if it has no voltage boot "AP" mode

only problem and i am to tired to remember but can you call on the gpio state in the bootloader
 
Last edited:

 

Back
Top