ruxbee 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 69ebe56191c20cccd48c56e1f2b20482b7e1b61f
4
+ data.tar.gz: 9bb47080661c2fe93f631b8f57a8e27002bd410d
5
+ SHA512:
6
+ metadata.gz: 1fd355db0cd854f0054f2578908f2ea9a23903a617b4ae36d6462c27c1b7aace385c1c3c5c065a7707d47628402c2dd0240a16591cde92dac84f443232c503a3
7
+ data.tar.gz: d42af74047bbed46233eda7d10cc08592d663908bc697a301c587579102ec2420374ee0986684115f3aab5a830bc8e0ae078f95ae6096a3f64b11bf247bde159
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea
11
+ *.swp
12
+ *.tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.4
5
+ before_install: gem install bundler -v 1.12.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruxbee.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ This program is free software: you can redistribute it and/or modify
2
+ it under the terms of the GNU Affero General Public License version 3 as
3
+ published by the Free Software Foundation.
4
+
5
+ This program is distributed in the hope that it will be useful,
6
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
7
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8
+ GNU Affero General Public License version 3 for more details.
9
+
10
+ You should have received a copy of the GNU Affero General Public License ("agpl.txt") along with this program.
11
+ If not, see http://www.gnu.org/licenses/
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Ruxbee
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruxbee`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ruxbee'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install ruxbee
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruxbee.
36
+
data/README.rdoc ADDED
@@ -0,0 +1,233 @@
1
+ = ruby-xbee
2
+ {<img src="https://travis-ci.org/exsilium/ruby-xbee.png" />}[https://travis-ci.org/exsilium/ruby-xbee]
3
+ {<img src="https://coveralls.io/repos/exsilium/ruby-xbee/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/exsilium/ruby-xbee]
4
+ {<img src="https://gemnasium.com/exsilium/ruby-xbee.png" alt="Dependency Status" />}[https://gemnasium.com/exsilium/ruby-xbee]
5
+ {<img src="https://codeclimate.com/github/exsilium/ruby-xbee.png" />}[https://codeclimate.com/github/exsilium/ruby-xbee]
6
+
7
+ == Ruby::XBee - What is it?
8
+ Ruby::XBee lets you configure and access Digi XBee RF devices using ruby classes and ruby-based
9
+ command line utilities.
10
+
11
+ Current host platforms supported:
12
+ * Linux (Intel)
13
+ * Mac OS X (PPC or Intel)
14
+
15
+ == What is an XBee?
16
+ XBee devices are handy, low-cost RF data radios often used in embedded applications for
17
+ communicating with microcontrollers and sensors. The distance an XBee covers ranges from a
18
+ few hundred feet to 15 miles line of sight depending upon the XBee device type, frequency,
19
+ antenna type, and power ratings.
20
+
21
+ Some XBees can be configured to support the ZigBee standard. Other XBees support
22
+ various forms of proprietary mesh networking especially suited to scaling sensor networks.
23
+
24
+ To learn more about Digi's XBee modules, see Digi's web site at:
25
+ http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/
26
+
27
+ == Why use Ruby::XBee?
28
+
29
+ * Ruby::XBee is a convenient way to script the configuration of XBee especially if you have a lot of XBees to program.
30
+ * Ruby::XBee lends itself to building command line applications and deploying XBee networks.
31
+ * Ruby::XBee is a quick way to experiment with functionality of XBees.
32
+ * Ruby::XBee can alleviate the need to memorize lots of AT modem commands and their parameters.
33
+ * Since Digi has no configuration host support for Linux or OS X, if these are your native or preferred environments, Ruby::XBee may be for you.
34
+ * Ruby::XBee is open source and contributions are welcome.
35
+
36
+ == Ruby::XBee Documentation
37
+
38
+ See doc/index.html from the downloaded bundle for detailed documentation on Ruby XBee class and utilities.
39
+ This documentation is primarily RDoc generated from the actual code, so it should be complete and accurate.
40
+ If documentation mistakes are found, please report errors to landon att 360vl com.
41
+
42
+ Not all of the many XBee features are supported by Ruby::XBee, but many of the most common ones are. New features
43
+ will be supported as this software evolves. Complete XBee feature coverage represents a main project goal and is
44
+ a significant area of solicited contributions.
45
+
46
+ Example use of the core XBee ruby class can be found in the utilities themselves:
47
+ xbeeinfo.rb, xbeeconfigure.rb, xbeedio.rb, xbeelisten.rb, xbeesend.rb
48
+
49
+ == Quick Start
50
+ 1. install ruby 1.9.3 or 2.0.0 for your platform (see http://www.ruby-lang.org)
51
+ 2. download the ruby-xbee ( git clone https://github.com/exsilium/ruby-xbee )
52
+ 3. install the dependencies `bundle install`
53
+ 4. determine your /dev string and configure that in bin/ruby-xbee.rb
54
+ 5. try ./bin/xbeeinfo.rb
55
+
56
+ == Detailed Quick Start
57
+ === clone the ruby-xbee repository.
58
+
59
+ git clone https://github.com/exsilium/ruby-xbee
60
+
61
+ === Determine your /dev string and configure that in bin/ruby-xbee.rb
62
+
63
+ When you plug in your XBee using an USB explorer board such as the Sparkfun XBee explorer:
64
+
65
+ https://www.sparkfun.com/products/8687
66
+
67
+ a new device will appear in the /dev directory of your Mac or Linux machine. As a hint,
68
+ look for a device such as /dev/tty.usb* or /dev/ttyUSB*
69
+
70
+ If you use the Sparkfun XBee explorer board mentioned above as an example, you will see
71
+ a device such as:
72
+
73
+ ls -l /dev/tty.usbserial*-
74
+ crw-rw-rw- 1 root wheel 10, 14 Jan 2 11:03 /dev/tty.usbserial-A80081sF
75
+
76
+ Each USB device has a unique tag so your device will not be named exactly the same as
77
+ this example.
78
+
79
+ Once you determine the device name, edit the ruby-xbee/bin/ruby-xbee.rb file and
80
+ modify the @xbee_usbdev_str to match your device. Example:
81
+
82
+ @xbee_usbdev_str = "/dev/tty.usbserial-A80081sF"
83
+
84
+ save the ruby-xbee.rb file.
85
+
86
+ === Build and install the RubyGem
87
+
88
+ If you are relying on rvm, please set the appropriate gemset prior
89
+
90
+ gem build ruby-xbee.gemspec
91
+ gem install ruby-xbee-<version>.gem
92
+
93
+ === Try xbeeinfo.rb
94
+
95
+ Once the RubyGem is properly installed you can try to call one of the distributed scripts.
96
+
97
+ Insure your XBee device is plugged into your host and the device is enumerated
98
+ in /dev according to Step 2 above.
99
+
100
+ xbeeinfo.rb
101
+
102
+ If everything's configured correctly you will see output from xbeeinfo similar to
103
+ this (your output will vary):
104
+
105
+ cooper:ruby-xbee lcox$ ./xbeeinfo.rb
106
+ Attention: OK
107
+ Firmware: 10CD
108
+ Hardware: 180B
109
+ Baud: 9600
110
+ Parity: None
111
+ Neighbors:
112
+ [{:NI=>"BMW528", :MY=>"2", :SH=>"13A200", :SL=>"4008A642", :DB=>-36}]
113
+ Node ID: BaseStation
114
+ Channel: C
115
+ PAN ID: 1
116
+ MY: 1
117
+ SH: 13A200
118
+ SL: 4008A64E
119
+ DH: 0
120
+ DL: 2
121
+ Last received signal strength (dBm): -36
122
+ Port 0: Disabled
123
+ Port 1: DI
124
+ Port 2: Disabled
125
+ Port 3: Disabled
126
+ Port 4: Disabled
127
+ Port 5: Associated_Indicator
128
+ Port 6: Disabled
129
+ Port 7: CTS
130
+ Port 8: Disabled
131
+
132
+ == Troubleshooting
133
+
134
+ XBee won't respond:
135
+ * Refer to: http://www.faludi.com/projects/common-xbee-mistakes/
136
+ * Insure your XBee has the latest firmware flashed into the device (use Digi X-CTU)
137
+ * Insure your device's USB driver is enumerated in the /dev directory when you plug in USB
138
+ * Insure your XBee device and Ruby::XBee baud rate configuration is identical
139
+ * Digi's XBee development boards do not have USB drivers for OS X or Linux.
140
+ I recommend using SparkFun USB XBee Explorer board: https://www.sparkfun.com/products/8687
141
+ This board supports drivers that are compatible with OS X and Linux operating systems. This board
142
+ can be used with Digi's X-CTU windows configuration utility as well, so it's a great board to have
143
+ if you're working with XBee on various platforms.
144
+ * Insure your full device path is configured in conf/xbeeconfig.rb
145
+ * Insure you can "talk" to your device with Digi X-CTU on Windows
146
+ - make sure the device itself can be contacted before trying again with Ruby::XBee
147
+ * Try the Linux or OS X 'screen' command to contact the device:
148
+ screen /dev/tty.usbserial-A80081sF 9600
149
+ where you would replace the /dev/ string in the example above with the one for your USB XBee device.
150
+ When you plug in a USB serial device, Linux and OS X will enumerate that device automatically by adding
151
+ a new entry into the /dev directory.
152
+ * When you make contact with the device using 'screen', issue a +++ and wait for a second or two for an OK response
153
+ * Contact Digi. See: http://www.digi.com/support/productdetail?pid=3257 (S1) or http://www.digi.com/support/productdetail?pid=3430 (S2)
154
+
155
+ Other than these suggestions, sorry, I have no time to support connectivity problems to the XBee itself.
156
+ Google is your friend.
157
+
158
+ == Limitations
159
+ * Not all XBee Series 1 features are supported, though many are.
160
+ * New efforts are mostly aimed towards supporting Series 2. Efforts are made not to break Series 1
161
+ * No provision is made to flash new device firmware into the XBee from Ruby::XBee classes or utilities.
162
+ Reflashing firmware requires using Digi's X-CTU windows program. Code contributions in this area are welcome.
163
+
164
+ == See Also
165
+ There are several other utilties included with Ruby::XBee. See also:
166
+
167
+ * xbeedio.rb - A Ruby utility for configuring and manipulating XBee DIO ports
168
+ * xbeeinfo.rb - A Ruby utility for extracting XBee setup information using xbee ruby class (Ruby::XBee)
169
+ * xbeelisten.rb - A ruby utility for listening to data output from an XBee
170
+ * xbeesend.rb - A ruby utility for sending raw data to and through an XBee
171
+
172
+ == Contact and Contribute
173
+ Please feel to Fork the repository and create pull requests back.
174
+
175
+ == Synopsis
176
+ Ruby::XBee - Configure and access XBee using Ruby
177
+
178
+ Current host platforms supported:
179
+ Linux (Intel)
180
+ Mac OS X (PPC or Intel)
181
+
182
+ == Release Notes
183
+ 2014-03-09 Ruby::XBee Version 1.1 - Requirements: Ruby 1.9.3; serialport 1.1.0
184
+
185
+ 2009-01-02 Ruby::XBee Version 1.0 - Requirements: Ruby 1.8.7; ruby-serialport
186
+
187
+ == Prerequisites
188
+ * *Prerequisites* - SerialPort
189
+ A platform-specific version of the SerialPort is a prerequisite for Ruby::XBee. Please
190
+ refer to Rubygems ( http://rubygems.org/gems/serialport ) for package information.
191
+
192
+ * *Prerequisites* - Ruby 1.9.3
193
+ To date, all testing has been done using Ruby 1.9.3 (p194) & 2.0.0. There has been extensive
194
+ changes introduced to Ruby after 1.8.x branch and backwards compatibility is not esnured.
195
+ Please refer to earlier versions of this software.
196
+
197
+ == Bugs
198
+ I'm sure there are bugs. Please test and submit a detailed report to github issues.
199
+ Better yet, please submit a patch for a fix. Thanks.
200
+
201
+ == Feature Requests
202
+
203
+ Original author can be reached by checking http://www.esawdust.com/blog/ for updates and
204
+ sending feature requests to landon att 360vl com
205
+
206
+ Current maintainer can be reached by sending e-mail to exile att chamber ee or filing a issue via github.
207
+
208
+ == Generating Ruby::XBee RDoc
209
+
210
+ Ruby::XBee uses RDoc and the Hanna template. To generate documentation yourself, you need
211
+ to do a one-time install of the hanna template and dependencies:
212
+
213
+ sudo gem install hanna-nouveau
214
+
215
+ Then from within the ruby-xbee install directory run:
216
+
217
+ rdoc -f hanna
218
+
219
+ == Accessing/Obtaining earlier versions of Ruby::XBee
220
+
221
+ Original version of Ruby::XBee can be downloaded:
222
+ http://www.esawdust.com/ruby-xbee/releases/ruby-xbee-1.0/ruby-xbee-1.0.tar.gz
223
+ (2013-02-25 MD5 checksum MD5 (ruby-xbee-1.0.tar.gz) = 5f01b6af4cfc8719b601f354c627b6e8)
224
+
225
+ Mike Ashmore's version can be obtained via GitHub: https://github.com/motomike/ruby-xbee
226
+
227
+ == Copyright
228
+
229
+ Copyright (c) 2008-2009 360VL, Inc. and Landon Cox
230
+ Copyright (c) 2009 Mike Ashmore
231
+ Copyright (c) 2013-2014 Sten Feldman
232
+
233
+ See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec