Getting Started with LoRa | Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone today I'll take a look at these Laura modules from reiax have you ever had a project where you needed to send some data over a long distance maybe a remote sensor of some kind like a weather monitor or even an alarm system or maybe you'd like to water your plants on the other side of your property just by pressing a button these are situations where technology is like Wi-Fi and Bluetooth probably aren't the most practical while their network speeds are great their range is really limited with my home network for instance the signal drops down to one or two bars just by being in the opposite corner of the house and after a few steps into the back yard it's practically non-existent but these are exactly the kinds of applications where Laura devices like this work really well essentially they give you much better range in exchange for reduced bandwidth so this means that you won't be streaming movies over it but for signaling and periodic updates over a long distance this is a really good trade-off these Reax modules are particularly nice to use because they have a simple API that you can interact with over your interface and since most microcontrollers and single board computers support you are that means that these modules will work with all kinds of devices now the devices that I've chosen to use here are both as spree no boards meaning that they come pre-loaded with a JavaScript interpreter and that'll make all of the asynchronous Network code really easy to work with you can also install a spree know on other boards but I haven't experimented with that yet this one is in a spree no Wi-Fi which I just covered in a video yesterday and this one is a pixel j/s which I haven't really gotten a show off yet but one thing I really like here is that if you line up the ground pins you can configure the rest of the pins so that the Reax module plugs right in without needing any wires or a breadboard to demonstrate I've programmed them so that pressing this button on the Wi-Fi sends the text on and releasing it's ins off then the pixel is listening for those Laura messages and responding accordingly the communication is also bi-directional so pressing one of the buttons on the side of the pixel lights up the LED on the Wi-Fi so this is the code that I use to make happen and I'm editing it here in the Esprit no web IDE and you can see the first thing I've done is I've imported a module from github repo and this is a module that I wrote basically it just simplifies the interface for dealing with these ray X modules so that instead of using a bunch of low-level UART commands I can work with JavaScript methods and promises which makes the code a lot easier next I'm setting up the you our interface with the pins that the Reax module is connected to and this is the default baud rate for those devices but there's also a method in the API for changing the baud rate next I'm instantiating this Laura object using that serial interface that I just defined and now we can call methods on that Laura object and the first thing I'm doing is setting the network ID to 13 so with Laura the devices have to be on the same network in order to see each other's messages and basically that's just a matter of setting the network ID and making sure that each device uses the same one I chose 13 for this demo but that's entirely arbitrary they just have to be on the same one next I'm setting the address for this lawyer device to one and this is the Reax module that's connected to the Esprit no Wi-Fi the other one that's connected to the pixel I set to two just so they have a different address and with the address for incoming messages you can actually tell which address that came from so if you had a bunch of lower devices like this it might be useful to know which one sent the packet next I'm adding an event listener to the Laura object that's listening for data event types and so every time the Laura device receives an incoming message it's gonna emit these data events and this method here will be able to listen to them so once we've received an incoming message we're just checking the data that was sent and comparing it with this string so if the message that was sent is the string on then we'll set this led to high and if it's anything else like the string off we'll set the LED to low this event here has other properties too it has the address of the device sent the message as well as things like signal strength and signal-to-noise ratio then down here I'm setting a watch that's listening for changes to the button state and it's listening for both rising and falling changes so when the button is pressed or released the repeat property is set to true because otherwise it behaves like a one time trigger and I want to catch it every single time the button is pressed and released so the callback here is going to have this state property which will be true or false depending on the state of the button so when the button is down will send on and when the button is up will send off and this is being sent using this laura dotson method so it's sending with the first parameter a string which will be either on or off and then as the second parameter it's the address of the device that it's sending it to in this case it's being sent from the Esprit no Wi-Fi device which is address 1 to the pixel J s device which is address 2 and that's really all there is to the code here's a more complex example I've got the Esprit no Wi-Fi program to be a web server that I can connect my browser to now when I change this drop-down on the page it sends the changes over Laura to the pixel and this is also bi-directional so when I press the button on the side of the pixel it updates the page now I basically have a bridge between my Laura Network and my Wi-Fi network but why not take it even further to use the Bluetooth capabilities of the pixel to bridge over to Bluetooth devices like this puck J s anyway I just thought I'd share these devices with you here and show some of the projects I've been playing around with I'll leave links in the description for the source code and also for the hardware if you're interested also if you have any ideas for projects that you'd like to see built using these lunar modules let me know in the comments and until next time bye
Info
Channel: Davy Wybiral
Views: 114,377
Rating: undefined out of 5
Keywords: LoRa, LoRaWAN, Espruino, Javascript, Espruino WiFi, Pixl.js, Puck.js, BLE, Bluetooth, WiFi, Bridge, Gateway
Id: IStuUv9eAmE
Channel Id: undefined
Length: 6min 19sec (379 seconds)
Published: Thu Oct 11 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.