Skip to content

SenseLora 4G gateway

Introduction

If you want the data to be transferred via 4G, either to a remote server or a simple SMS, select the SenseLoRa_4G Gateway please. This Gateway is based on ESP32, it has on-board LoRa receiver and a 4G module, so it get the LoRa data and then transmit the data via 4G to cloud server such as TTN, or the monitors phone with SMS.

image

image

Model: SenseLora 4G gateway

Features

  • IP68 Waterpoof
  • ESP32S3 controller, 16M flash/8M PSRAM
  • High performance LoRa/4G antenna
  • Power: DC 5V/3.7V battery
  • On board battery charger by solar panel

Hardware

  • Plug the SIM card into the board.
  • Plug the GPS antenna into the GPS interface.
  • Plug the 4G-GSM antennas into the LTE interface.
  • Plug the LoRa antennas into the LoRa interface.
  • Plug the USB2UART CH340K into the P1.

Arduino IDE

  • Install the Arduino IDE V1.8.10/V1.8.19 If you haven’t installed the ESP32 Board SDK yet, follow the steps in this guide to get started quickly.

For the ESP32-S3 Development board version, we recommend using versions that have been verified, such as 2.0.8, which is more stable, and less prone to errors.

Note: Different computers may have different port numbers when connecting to a development board. Please select the correct port number based on the development board you are connecting to.

Transmit T&H to Thingspeak

This demo will show you use this device to transmit the temperature and humidity to Thingspeak that the T&H CAN be checked everywhere.

The user needs a Lora transmitter to transmit the corresponding signal to receive the temperature and humidity information. Let's take the example of a SenseLora_Industrial-grade Air Monitor as a transmitter.

Thingspeak

To transmit the data to your Thingspeak channel, it has to create a new channel and get the APIKEY information. Then replace the APIKEY in the code with yours.

  • sign in or sign up for ThingSpeak

If you already have an account, log in and enter the password, otherwise click Create one to register.

ThingSpeak_sign_in.png

  • Create new channel

Select "Channel --> My Channels".

ThingSpeak_myChannels.png

click "New Channel".

ThingSpeak_newChannel.png

Write the name and field information and click Save Channel to create successfully.

Thingsprak information.png

Arduino

1.Open the lora2thingspeak by Arduino IDE.

2.Install "RadioLib" and "ArduinoJson" library.

  • Select "Tools-->Manage Libraries..."

tool_Manage_libraries.png

  • Search "RadioLib", select Version 4.6.0 and click Install. RadioLib.png

Note: It is recommended to use version 4.6.0, using the latest version may cause compilation failure.

  • Search "ArduinoJson" and click Install. ArduinoJson.png

3.Change the APIKEY.

In order to view the data in your own channel, you need to modify the APIKEY in the code.

  • Click the "API Keys" and copy you Key.

key.png

  • Modify the APIKEY in the code.

key_code.png

4.Use Type-C USB cable to connect the USB2UART CH340K and PC, and select the development board "ESP32S3 Dev Module" and the port.

  • Select "Tools > board:"xxx" > ESP32 Arduino > ESP32S3 Dev Module". board.png

  • Select "Tools > Port", Select the port number of the board. port.png

5.Verify the code and upload.

  • Click this icon to upload to the board.

download.png

Once the download is complete, power on the SenseLora_Industrial-grade Air Monitor, press the reset button every time and wait about 1 minute to receive a message in Thingspeak. Thingsprak ok.png

If you want to receive more information, you can add it yourself in "void json2url(String input, char *url)".

Such as adding information about carbon dioxide and light intensity.

Add and modify code in functions as:

float eco2 = doc["eco2"];
float lux = doc["lux"];
sprintf(url, "AT+HTTPPARA=\"URL\",\"http://api.thingspeak.com/update?api_key=%s&field1=%.1f&field2=%.1f&field3=%.1f&field4=%.1f\"",THINGSPEAK_APIKEY, temp, humi, eco2, lux);

In the void lora_receive_task() funtion, change the char url[200] to char url[600];

char url[600];

Verify the code and upload.Repeat the above steps. Thingsprak ok2.png

FAQ

You can list your question here or contact techsupport@makerfabs.com for technology support. Detailed descriptions of your question will be helped to solve your question.

Resource

Github

Hardware