User Manual
www.dragino.com
LoRa Gateway User Manual ---Update:2017-11-07 45 / 67
9.3.2 Try RESTful API call with LG01 Linux command
First, we need to make sure the LG01 has internet access. We can log in the SSH and ping an
Internet address and see if it get through. As below:
LG01 has built-in Linux tool curl. It is a very powerful tool for http communication. We can use
this tool to handle RESTful API call in LG01.
The command to update a feed is as below:
curl -k "https://api.thingspeak.com/update?api_key=B9Z0R25QNVEBKIFY&field1=40"
(Make sure the “” is included , otherwise you will get null value in ThingSpeak)
Below is the output window:
So we success to use LG01 to uplink data to ThingSpeak, the curl command is executed in the
Linux side, finally, we will have to call curl command with sensor data variable in Arduino side.
This is through the process class in Arduino and we will show it in the final sketch.