Controlling AR300M from iPhone App

I’d like to create an app to control and monitor my AR300M from my phone. Could somebody point me in the right direction, if there is an API for example for OpenWRT, or otherwise? I suppose the app could simply SSH and issue commands, but I was wondering if there was another way to go about it?

So far I’ve looked into a few options…

  1. An app that effectively SSH’s into the box, and then issues raw commands — pros: quick for a proof of concept, cons: not robust/scaleable

  2. Installing a server app, such as lighttpd and creating a RESTful interface to server-side commands — pros: somewhat more involved to get security right, cons: convoluted

  3. Something like HomeBridge to expose features of the box as HomeKit items — pros: Controllable via Siri/automation, cons: how to install HomeBridge on the AR300M?

Any thoughts on the above, or general advice greatly appreciated!

I realize you have ides of your own, but I have been looking for an app that is a simple wifi manager for connecting stations. I think this would offer you a project with wide appeal and more feedback than, while very kool, a home automation hub. Easier to learn when you have more users to test.

As there are no “APPS” for OpenWrt that I am aware of it’s wide open as far as approach.

For a connection manager, it would be easy to store all the connection data on the phone, including login to the router. It should be about 2 clicks (open and scan, then select) and a key.

I’m open to ideas. What do you mean by “a simple wifi manager for connecting stations”?

What would you expect that to do? Select a station, from a list of stations, and then show the web interface?

Could you expand a bit, please?

Think of it as the Settings => WIFI equivalent on your iPhone or the “Connect to a Network” in Windows, but for the router.

Open the “App”

The “App” connects to the router based on credentials stored in the “App” (OpenWrt logon and stored credentials for the WLAN). NOTE: Opening the APP would consciously override any other WLAN connection. Depending on the config below (autoconnect on or off) an entry page would be presented. For autoconnect ‘on’, the user would see a page with a Scan button and the results of the autoconnect, if the program could not connect to a saved STAtion the tool would perform a wireless scan. With Autoconnect off, the tool would perform a wireless scan on open (OpenWrt => Network => Wireless => Scan) and presents the results. (SSID, encryption icon and “Join” button.)

One would then select a network. There are 3 cases:

1 - secured know network => you are connected

2 - secured unknown network => you are prompted for a key and below a connect button and check box. The check box is to save the network.

3 - unsecured network => you are presented a warning screen “Unsecured network Blah Blah Do you want to continue?” with Yes and No buttons and check box. The check box is to save the network.

You then get to a screen that says “you are connected to the XXX network”. Your lease time is XX Hrs , YY minutes and possibly some other relevant info like security method, signal strength, IP etc. There would also should be 2 additional buttons at the bottom, Disconnect (WWAN) and Rescan.

There would need to be a config area, which is typically in the “Settings” section. Here one would enter the router IP and password, the default AP to connect to. There could be some additional parameters like “autoconnect” which would connect to the strongest or preferred network directly.

we used to have an iphone app and an Andrio app. But we decided to abort them because making a good app is very difficult.

HomeBridge is a nodejs module right? This may work in AR300M as AR300M has the newest nodejs v6.9.1. But making a nodejs module to work is painful always.

We are redesigning our REST api and should be able to redevelop the app as well later.

I agree with you both, @amprsanduk and @RangerZ. So this is a future product and will implement what @RangerZ said for the first priority.

It is not possible to control the radios on iOS, so if I’ve understood @rangerz correctly, this would not be an app that could be developed for iPhone.

I am interested in creating a native (iOS) interface for the AR300M device itself. So a prerequisite would be that you are connected to its wifi network, secondly that you input valid credentials to authenticate to it. From there, the app would be an alternative UI to the web UI presented by default.

For starters, rather than attempting to replicate all of the features, I’d like to start with controlling the VPN on/off option - however as a proof of concept, I suppose it’d be just as good to display some property of the device (eg. “Connected devices”) or something trivial.

@alzhao you mention that you are redesigning your REST api - what is presenting this? Are you running lighttpd or similar?

Yes. Using lighttpd.

It is not possible to control the radios on iOS,
Are you referring to changing the iPhone network and connect to the AR300 or are you saying that you can not send commands to the AR300 to connect to a WISP?

I also do not understand the part on credentials. Is there a difference from calling the values from a file as opposed to typing them in.


I think he means you cannot control which network you connect to in IOS using an app. IOS don’t offer such functions for app.