IOT at you service with LoraWan and Ruby
Manage your devices with Loriot cloud system

What is Lora?
LoRaWAN is a Low Power Wide Area Network with features that support low-cost, mobile, and secure bi-directional communication for Internet of Things (IoT), machine-to-machine (M2M), and smart city, and industrial applications. LoRaWAN is optimized for low power consumption and is designed to support large networks with millions and millions of devices. Innovative features of LoRaWAN include support for redundant operation, geolocation, low-cost, and low-power - devices can even run on energy harvesting technologies enabling the mobility and ease of use of Internet of Things.

Install
gem install loriot-rb
To use it in a bundle, add to gem file gem 'loriot-rb'
and run bundle install
Connection to loriot server
Establish a secure connection to your Loriot Application
on the cloud.
This version only support the TLS protocol.
From irb require the library:
require 'loriot-rb'
then create an instance
lora = LoriotClient.new
if you are in debug mode you should also receive a json:
{ "hello":"LORIOT.io TLS Server", "version":"1.0.4" }
Send data to a device
lora.send_cmd(EUI: 'Insert here your EUI code', confirmed: true, data: "0101")
Request example:
{ "cmd":"tx", "EUI":"BE7A0000000010B7", "port":40, "confirmed":false, "data":"0101" }
Response example:
{ "cmd":"txd", "EUI":"BE7A0000000010B7", "seqdn":114, "seqq":113, "ts":1489133179385 }
"cmd":"txd"
show the data sent to the gateway
The response could also be:
{ "cmd":"tx", "EUI":"BE7A0000000010CF", "seqdn": 4, "data": "0301", "success": "Data enqueued" }
Receive Data
To listen your devices:
lora.listen
Close the connection
lora.quit
Compatibility
Ruby 2.3+
Install
gem install loriot-rb
To use it in a bundle, add to gem file gem 'loriot-rb'
and run bundle install
To Do
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-feature
) - Commit your changes (
git commit -am 'I made extensive use of all my creativity'
) - Push to the branch (
git push origin my-feature
) - Create new Pull Request
Testing
Wide coverage with xx unit tests
and xxx assertions
To test locally install the development requirements:
bundle install
Then execute:
bundle exec ruby test/unit_test.rb
Performance tests:
bundle exec ruby test/performance_test.rb
Found a bug?
Please open an issue.
License
The GNU Lesser General Public License, version 3.0 (LGPL-3.0)
See LICENSE file