Setup Loraserver [4] – Get data with InfluxDB Integration

Setup Loraserver [4] – Get data with InfluxDB Integration


Hello Everybody In this video, i’ll use the InfluxDB integration Instead of using HTTP integration as the previous video To get the data from Loraserver Okay. Let’s start! First of all, we have to download the InfluxDB Move to the main page Download this First of all, you have to copy all of this And then paste to your terminal We need to add sudo before Okay, it’s downloading And after we’ve downloaded We will run this command Okay, wait a little bit Run it to unpackage this We’ve already downloaded the influxDB So now we will test with the “influx” command It’s refused because we didn’t start the Influxdb We have to start Influxdb as the Loraserver And then enable the InfluxDB Service To start this DB when run the ubuntu Okay, Now let’s check the status Okay, The influxDB run correctly Okay, Now we will try the “influx” command When you see this line, Your influxdb setting is correct We have a command “show databases” It will show all your databases in your InfluxDB I’ve already had some databases before so it also show them here But now i will use a new database To create a new database, we have “create database” I will create a database with name is “loraserver” You can put your database name into the quotes Show database again Now i will “use loraserver” This command will access the “loraserver” database We will use “show measurements” I don’t have any table right here so it doesn’t show anything Now, I will config the Loraserver To auto create some tables in this Okay, Let it here Move to Loraserver Let me check the live data Okay, My Loraserver is still receiving data from Arduino I will move to Applicationi IOTAPP/ and Application Configuration In the previous video, I chose the “NONE” Payload Codec But now, I will choose the CJSCF This session will help us Decode and Encode some data I have some code right here to decode the data I will put the code below this video I will explain you a little bit First of all I have a function “toHexString” That is the function, will help us Decode the 64Base data to Hex Here , i call the “toHexString” function And transfer the parameter “bytes” To receive the Hex data I convert the 64Base data to Hex And then i convert Hex to Ascii And then i return the data The return right here will help us Create a table with name is “mydata” And “toascii” right here is the parameter This is the data i sent from Arduino And that is a number, it just a number I think we cannot receive a String To database I’ve not already tried, but you can try it Okay, This is 2 functions First is convert Hex to Ascii And the second one is 64Base to hex After that , we have to move to Integration session Create a new one Create InfluxDB instead of using HTTP integration Right here, i will put the “http://localhost:8086/write” As the loraserver recommend Username and password is “admin” The database name right here I created the “loraserver” database So i will put it is “loraserver” Don’t put anything right here And this , i will choose the “Microsecond” Okay, You can choose what you want Okay, That are all things Okay, As you see My object And this is “mydata” This is the number “2” This is the data i sent from Arduino That is the random numbers When use see this instead of null or error. Your setting are correct Now, I will check with the “show measurements” Okay, As you see, the Loraserver auto create Some new tables Your data is in this table We will “select * from” Okay, As you see, this is the time The application name Dev EUI, dev name “f_port” , and the last one is “value” This is the value we received from Arduino Okay, that are all the config with the InfluxDB Integration In the next video, i will show you how to setup the Grafana-Server To display the data are received from HTTP integration or InfluxDB integration Okay, Thanks for Listening and Watching this video !

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *