Creating an iPhone app for dd-wrt interface

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2, 3 ... 9, 10, 11  Next
Author Message
ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Sun Mar 25, 2012 14:07    Post subject: Creating an iPhone app for dd-wrt interface Reply with quote
I've been trying to think of a good iPhone app to create and after trying to use the dd-wrt web interface on my iPhone today, I thought a web app interface would be great.

I guess my first question has to be, would this be allowed? (I don't want to be getting sued by anyone lol)

Second, would dissecting the current web interface give me enough to work with on how the settings are sent/received from dd-wrt?
Sponsor
slobodan
DD-WRT Guru


Joined: 03 Nov 2011
Posts: 1557
Location: Zwolle

PostPosted: Sun Mar 25, 2012 15:17    Post subject: Re: Creating an iPhone app for dd-wrt interface Reply with quote
ddaddy wrote:
I've been trying to think of a good iPhone app to create and after trying to use the dd-wrt web interface on my iPhone today, I thought a web app interface would be great.

I guess my first question has to be, would this be allowed? (I don't want to be getting sued by anyone lol)

Second, would dissecting the current web interface give me enough to work with on how the settings are sent/received from dd-wrt?

DD-WRT is Linux, Linux is open source, so everybody may use and modify it. According to a GPL interpretation, it is still copyrighted, but it is open source.

_________________
2 times APU2 Opnsense 21.1 with Sensei

2 times RT-AC56U running DD-WRT 45493 (one as Gateway, the other as AP, both bridged with LAN cable)

3 times Asus RT-N16 shelved

E4200 V1 running freshtomato 2020.8 (bridged with LAN cable)

3 times Linksys WRT610N V2 converted to E3000 and 1 original E3000 running freshtomato 2020.8 (bridged with LAN cable)


ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Mon Mar 26, 2012 14:55    Post subject: Reply with quote
I didn't really get past the first hurdle.
I've spen all day looking at the HTML and I would have to scrape every individual detail to display and wouldn't be able to submit changes.
Shame there isn't an API to interface with the settings.
slobodan
DD-WRT Guru


Joined: 03 Nov 2011
Posts: 1557
Location: Zwolle

PostPosted: Mon Mar 26, 2012 22:57    Post subject: Reply with quote
ddaddy wrote:
I didn't really get past the first hurdle.
I've spen all day looking at the HTML and I would have to scrape every individual detail to display and wouldn't be able to submit changes.
Shame there isn't an API to interface with the settings.

Now, there is a nvram command which sets options, see e.g. http://www.dd-wrt.com/wiki/index.php/Useful_Scripts#Backup_settings_and_restore_them

So, using nvram set ... you could set all sorts of options (if supported by the firmware).

You can use it via telnet or ssh. You can use nvram commit in order to apply the options.

_________________
2 times APU2 Opnsense 21.1 with Sensei

2 times RT-AC56U running DD-WRT 45493 (one as Gateway, the other as AP, both bridged with LAN cable)

3 times Asus RT-N16 shelved

E4200 V1 running freshtomato 2020.8 (bridged with LAN cable)

3 times Linksys WRT610N V2 converted to E3000 and 1 original E3000 running freshtomato 2020.8 (bridged with LAN cable)


ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Tue Mar 27, 2012 22:09    Post subject: Reply with quote
Thanks for the pointer Smile
I've managed to get a telnet connection and read every variable from the nvram.
There around 1500 of them! I just need to work out which is which.

I don't suppose there is a variable list anywhere?
ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Wed Mar 28, 2012 16:49    Post subject: Reply with quote
slobodan, do you have an iOS device and want to test for me?
tatsuya46
DD-WRT Guru


Joined: 03 Jan 2010
Posts: 7568
Location: YWG, Canada

PostPosted: Wed Mar 28, 2012 17:06    Post subject: Reply with quote
DD-WRT needs something like this, can't wait.
_________________
LATEST FIRMWARE(S)

BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers

[x86_64] Haswell i3-4150/QCA9984/QCA9882 ------> r55797 std
[QUALCOMM] DIR-862L --------------------------------> r55797 std
▲ ACTIVE / INACTIVE ▼
[QUALCOMM] WNDR4300 v1 --------------------------> r50485 std
[BROADCOM] DIR-860L A1 ----------------------------> r50485 std


Sigh.. why do i exist anyway.. | I love you Anthony.. never forget that.. my other 99% that ill never see again..

ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Wed Mar 28, 2012 17:17    Post subject: Reply with quote
I'm not making any promises on what it will actually do lol.
I'm fairly new to iOS programming (I have 2 apps on app store) but this should be simple (I hope).
I've got a telnet connection working and pulling the variables from nvram. The hardest part will be going through the list of 1400 variables and working out which one if which, then display them.
Then work on letting you change them.
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Wed Mar 28, 2012 19:46    Post subject: Reply with quote
ddaddy wrote:
I'm not making any promises on what it will actually do lol.
I'm fairly new to iOS programming (I have 2 apps on app store) but this should be simple (I hope).
I've got a telnet connection working and pulling the variables from nvram. The hardest part will be going through the list of 1400 variables and working out which one if which, then display them.
Then work on letting you change them.


These variables you should ignore..



vars_to_skip.tar.gz
 Description:
dangerous vars to ignore

Download
 Filename:  vars_to_skip.tar.gz
 Filesize:  527 Bytes
 Downloaded:  1892 Time(s)

ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Wed Mar 28, 2012 20:58    Post subject: Reply with quote
Cheers, although the very first one you have is DD_BOARD which i've found has the Router Model name.

I'm seaching in the vars for what's being displayed on the web interface to display the same info.

I could do with 1 or 2 people to test out what I have so far. It works on mine, but if it doesn't work on anyone elses then theres no point me continuing.

Anyone wanting to help, I need your UDID number from your iOS device. There's plenty of free apps that will get this for you, just search UDID on the app store.
tatsuya46
DD-WRT Guru


Joined: 03 Jan 2010
Posts: 7568
Location: YWG, Canada

PostPosted: Thu Mar 29, 2012 19:06    Post subject: Reply with quote
I can do that later..
_________________
LATEST FIRMWARE(S)

BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers

[x86_64] Haswell i3-4150/QCA9984/QCA9882 ------> r55797 std
[QUALCOMM] DIR-862L --------------------------------> r55797 std
▲ ACTIVE / INACTIVE ▼
[QUALCOMM] WNDR4300 v1 --------------------------> r50485 std
[BROADCOM] DIR-860L A1 ----------------------------> r50485 std


Sigh.. why do i exist anyway.. | I love you Anthony.. never forget that.. my other 99% that ill never see again..

ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Thu Mar 29, 2012 22:29    Post subject: Reply with quote
Cheers, just pm me your UDID number and I'll sort something out for you to test tomorrow (I'm on UK time).
I've made good progress today as I've found some old source code with the web interface and I can easily identify most of the variable names.
However the htm files contain some function calls I just cannot find for getting memory usage, and live connection data etc..
slobodan
DD-WRT Guru


Joined: 03 Nov 2011
Posts: 1557
Location: Zwolle

PostPosted: Thu Mar 29, 2012 22:57    Post subject: Reply with quote
ddaddy wrote:
slobodan, do you have an iOS device and want to test for me?

No, I don't have one.

_________________
2 times APU2 Opnsense 21.1 with Sensei

2 times RT-AC56U running DD-WRT 45493 (one as Gateway, the other as AP, both bridged with LAN cable)

3 times Asus RT-N16 shelved

E4200 V1 running freshtomato 2020.8 (bridged with LAN cable)

3 times Linksys WRT610N V2 converted to E3000 and 1 original E3000 running freshtomato 2020.8 (bridged with LAN cable)


slobodan
DD-WRT Guru


Joined: 03 Nov 2011
Posts: 1557
Location: Zwolle

PostPosted: Thu Mar 29, 2012 22:59    Post subject: Reply with quote
ddaddy wrote:
Cheers, just pm me your UDID number and I'll sort something out for you to test tomorrow (I'm on UK time).
I've made good progress today as I've found some old source code with the web interface and I can easily identify most of the variable names.
However the htm files contain some function calls I just cannot find for getting memory usage, and live connection data etc..

For memory usage use:

free>/tmp/memory.txt

or

nvram show|grep freee

_________________
2 times APU2 Opnsense 21.1 with Sensei

2 times RT-AC56U running DD-WRT 45493 (one as Gateway, the other as AP, both bridged with LAN cable)

3 times Asus RT-N16 shelved

E4200 V1 running freshtomato 2020.8 (bridged with LAN cable)

3 times Linksys WRT610N V2 converted to E3000 and 1 original E3000 running freshtomato 2020.8 (bridged with LAN cable)


ddaddy
DD-WRT User


Joined: 15 Dec 2010
Posts: 157

PostPosted: Sun Apr 01, 2012 23:18    Post subject: Reply with quote
Been working on this all weekend. The old web interface source was just getting the nvram variables, tatsuya46 tested it for me and some weren't displaying for him.
I've got the latest web interface source and it's a lot more complex, obviously because of the growing number of compatibility types of routers. I got a few more variables working but now I'm a bit stuck. Its not as simple as grab a variable from nvram as different variables are used in different cases.
There seems to be global variables like HASWIFI and MADWIFI that I can't figure out where or how that are being set.
Also there's different function calls I can't track down like nvram_get (I know what this is doing) and nvram_status_get which I know are part of httpd.

Can anyone help me further?
Goto page 1, 2, 3 ... 9, 10, 11  Next Display posts from previous:    Page 1 of 11
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum