Dragino LoRa gateway: connecting to ThingSpeak

16

In this blog post, I will make further progress with the Dragino LG01-S Lora Gateway and LoRa Shield, and I will show you the steps required to publish data on ThingSpeak.

Developed by Mathworks (best known as the creators of MATLAB®), ThingSpeak is “an Internet of Things (IoT) platform that lets you collect and store sensor data in the cloud and develop IoT applications”. A lot of IoT devices can push data to Thingspeak (including but not limited to Arduino, Raspberry Pi). The gathered data can be analyzed online, using MATLAB®.

Unfortunately, this doesn’t come free. There’s the option of a free account for testing and for small non-commercial projects. A student license starts from 55 EUR. Home use licenses start from 75 EUR. Academic and commercial licenses are also available.

In this blog post, I will use a free license, as for the given moment I have no further plans to use ThingSpeak.

If you already own a MathWorks account, you can use it to connect also to ThingSpeak. Otherwise create an account first.

Login to ThingSpeak

Login to ThingSpeak

Once you log in, you can check your account settings. Mine is a free account.

ThingSpeak account setings

ThingSpeak account settings

To publish data to ThingSpeak, one must create a channel. To do so, go to ChannelsMy channels and create a new channel.

The new channel is named Dragino_LoRa and has two fields, for temperature and humidity. I didn’t fill any additional data (position and such) as this is for testing purposes only. I’ve left the channel private, for the given moment.

Once the new channel is created, we have to look at the API keys:

ThingSpeak API settings

ThingSpeak API settings

Write down the Channel ID and the Write API Key. You will need it later when you will configure the gateway.

1 2 3
Share.

16 Comments

  1. Hi,

    I think I’ve done exactly like what you did, uploaded the source code for both client and server without any problem. The DHT11 collected data just fine when I checked with the Serial Monitor, however I can’t get any data for my Thingspeak channel. Do you know where i might’ve done wrong? I’ve checked the API, etc.

    • Hi!

      Is your node permanently connected to the serial monitor? Otherwise it might just wait for serial to be availlable.

      • i’ve figured out that there are problem with transmitted data, it says “No reply, is rf95_server running?” . Any idea why is that?

        • Hi

          it looks there’s no communication over the LoRa between the gateway and the node.

          I can try to replicate this issue Monday when I will be back to work.

          • Hi, I think one of the reason is because my global led isn’t lighting up. Do you have any idea why? I tried both DHCP and Static IP. No change.

          • Hi

            I did check today, and my Dragino gateway is set up as follows:
            – Network – Internet access menu
            – Access Internet Via = WiFi Client
            – Way to Get IP = Static IP
            – WiFi settings to match my WiFi access point
            – IP, Gateway and Netmask set accordingly to my local network configuration
            – DNS is 8.8.8.8 (Google’s DNS)

            Power led is ON (green), WiFi led is blinking (green). All other LEDs are off.

            If everything is set correctly you should be able to access the configuration interface of the Dragino gateway from any PC on your local network, by typing the IP address you have assigned in your web browser.

    • did you manage to figure the issue out? I am having same problem only 1 field is being updated in Thingspeak even though can see both readings in the serial console.

      • Teodor Costachioiu on

        Hi,

        For the given moment I have my Dragino gateway configured to work with The Things Network.

        I hope next week to have some time to reconfigure it for Thingspeak.

    • I tried it only with the example code, with temperature and humidity only. In the mean time I have got some other Arduino nodes and I have plans to make an air quality monitoring station.
      Unfortunately, that project has to wait until spring, now it’s too cold to work outside.

  2. Hayden Lewis on

    I have this up and running fine and the graphs are appearing in thingspeak with the temp and humidity. But the problem im having is that when I disconnect the uno with the lorar and dht11 and connect it to another power source other than my pc’s usb cable….the data only sends the same values of 20c and 40% humidity regardless how hot i try to make it. If i connect it back up to my pc on com7 and do the same thing….the data starts to reflect the extra heat as you would expect.
    Why does it not work when disconnected from the pc with arduino on it?? Im guess im missing something here? I thought the whole idea of the lora was to be able to communicate to the gateway from a remote lora client??

    • Teodor Costachioiu on

      Two ideas come into my mind:

      – Please comment out anything that deals with PC communication – Serial.begin(), Serial.print(), etc.
      – Use a good power supply. Put a 1000uF/16V capacitor between Vcc and GND pins.

  3. Muhammad Rakeh Saleem on

    I have this problem while uploading the blink code for dragino kit.

    processing.app.debug.runnerexception at cc.arduino.packages.uploaders.ssh uploader.uploadusingpreferences(sshuploader.java:145) at cc.arduino.uploaderutils.upload(uploaderutils.java:78) at processing.app.sketchcontroller.upload(sketchcontroller.java:732) at processing.app.sketchcontroller.exportapplet(sketchcontroller.java:703) at processing.app.editor$defaultexporthandler.run(editor.java:2030) at java.lang.thread.run(thread.java:748) caused by: com.jcraft.jsch.jschexception: java.net.connectexception: connection timed out: connect at com.jcraft.jsch.util.createsocket(util.java:389) at com.jcraft.jsch.session.connect(session.java:215) at cc.arduino.packages.uploaders.sshuploader.uploadusingpreferences(sshuploader.java:117)

    Please someone help me how to fix this issue. as i have been trying for the past 4 hours and nothing is working properly and everytime I upload it messed up.
    Nd now the IP 10.130.1.1 is also not working. either config problm or some other ??
    Any help will be much appreciated

  4. Muhammad Rakeh Saleem on

    I think I have messed up with my wifi settings during the configuration of LS O1, and now I am not able to see the dragino wifi network in wifi search box. And cant connect to this dragino site to again re configure it, anyone here can help me how to solve this problem as It keep frustrated me for the past 6-7 hours. I have checkedd on the internet too but have no possible solution to cope with my problem.

    Anyone help me please. how to get back the wifi status and to configure properly the dragino device as wifi client.

    Thank you.
    Rakeh

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.