mf60 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +47 -4
  2. data/lib/mf60.rb +1 -1
  3. data/lib/mf60/version.rb +1 -1
  4. metadata +9 -9
data/README.md CHANGED
@@ -2,21 +2,56 @@
2
2
 
3
3
  The MF60 is a portable, personal WIFI hotspot that is sold worldwide in countries like Australia and Switzerland (where I live). Apparently, over a million of these devices were sold in Australia alone last year.
4
4
 
5
+ ![my mf60](http://dl.dropbox.com/u/385855/mf60.jpg)
6
+
7
+ # Installation #
8
+
9
+
10
+ $ gem install mf60
11
+ $ mf60 --help
12
+
5
13
  Like most hotspots, it comes with a pretty pitiful web interface and not much in the way of an API. I commute on the train frequently, and I sometimes find I need to reset the box. I was curious to see if I could somehow automate that a little bit. For instance, I wanted to be able to quickly disconnect/reconnect from the command-line, or maybe gather statistics. So I wrote this library.
6
14
 
7
- This Gem provides a Ruby library that lets you connect to the device and control it:
15
+ _Note: When you are logged into the admin interface from a browser, you will be logged out as soon as you connect with this library. That's just the way it goes._
16
+
17
+ The Swisscom MF60 from ZTE is known to work with this, but other carriers and devices may be compatible. Let me know.
18
+
19
+ ## Library ##
20
+
21
+ By default, the library attempts to connect to the device's web admin interface at http://192.168.0.1/. You can change the address with an environment variable,`MF60URL`:
22
+
23
+ $ export MF60URL="http://swisscom-mf60.home"
24
+
25
+ or, in an app:
26
+
27
+ # ENV['MF60URL'] = "http://192.168.1.1"
28
+
29
+ There's just one class to use, `MF60::Client`:
8
30
 
9
31
  > require 'MF60'
10
32
  > mf60 = MF60::Client.new('admin', 'secret')
11
33
  > mf60.reset
12
34
  => true
13
35
 
14
- You can also get stats:
36
+ Statistics and status are returned as a hash:
15
37
 
16
38
  > mf60.stats
17
39
  => {:current_trans=>1133211, :current_recv=>2884959, :connect_time=>"29:33", :total_recv=>222000830}
40
+
41
+ See the [command-line utility source](https://github.com/somebox/MF60/blob/master/bin/mf60) for descriptions of the keys.
42
+
43
+
44
+ ## Command-line Utility ##
45
+
46
+ A command-line utility gets installed with the gem, called `mf60`. Before using it, set the admin interface password via an environment variable:
47
+
48
+ $ export MF60PW="secret"
49
+
50
+ or
18
51
 
19
- There's a command-line utility installed as well with the gem that makes this easy to do:
52
+ $ MF60PW="secret" mf60 status
53
+
54
+ There are just a few tasks supported for now:
20
55
 
21
56
  $ mf60
22
57
  Tasks:
@@ -38,5 +73,13 @@ Tracking signal strength can be interesting as well:
38
73
  rscp/ecio : 176/16
39
74
  rssi : 11
40
75
  signal : ▁ ▂ ▃......
76
+
77
+ The signal meter is probably not that accurate (needs tweaking) and doesn't work at all when on GPRS (2G).
78
+
79
+ ## Code
41
80
 
42
- The project is built with [HTTParty](https://github.com/jnunemaker/httparty) and [Thor](https://github.com/wycats/thor). Both libraries are fun and awesome to use.
81
+ There's no official published protocol for this device that I know of. Firebug and Firefox were used to inspect and reverse engineer the web admin interface of the device.
82
+
83
+ I hope to soon write a stats-gathering script so I can graph signal strength along different train lines.
84
+
85
+ The project is built with [HTTParty](https://github.com/jnunemaker/httparty) and [Thor](https://github.com/wycats/thor). Both libraries were fun and awesome to use.
@@ -9,7 +9,7 @@ require 'mf60/helpers'
9
9
 
10
10
  module MF60
11
11
  class Client
12
- DEVICE_URL = ENV['MF60URL'] || "http://swisscom-mf60.home/"
12
+ DEVICE_URL = ENV['MF60URL'] || "http://192.168.0.1"
13
13
 
14
14
  include HTTParty
15
15
  format :html
@@ -1,3 +1,3 @@
1
1
  module MF60
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mf60
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70257353769520 !ruby/object:Gem::Requirement
16
+ requirement: &70125287490240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70257353769520
24
+ version_requirements: *70125287490240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &70257353769100 !ruby/object:Gem::Requirement
27
+ requirement: &70125287489820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70257353769100
35
+ version_requirements: *70125287489820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: guard
38
- requirement: &70257353768680 !ruby/object:Gem::Requirement
38
+ requirement: &70125277687140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70257353768680
46
+ version_requirements: *70125277687140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard-test
49
- requirement: &70257353768260 !ruby/object:Gem::Requirement
49
+ requirement: &70125277686720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70257353768260
57
+ version_requirements: *70125277686720
58
58
  description: A library and command-line tool that talk to the MF60 via the admin web
59
59
  interface. This little battery-powered box is available from Swisscom in Switzerland
60
60
  (as well as mobile operators in other countries). With this gem you can get statistics,