Skip to content

SenseLora 4G gateway

1. 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-S3, 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

2. 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

3. 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.

4. 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.

5. Transmit Air Monitor data 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.

5.1 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

5.2 Arduino

1.Open the send_lora_data_to_thingspeak 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

6. Transmit 4G gateway itself T&H data to Thingspeak

The 4G gateway itself has a built-in temperature and humidity sensor. Users can easily obtain the current environment status of the 4G gateway, this ensures the stability and reliability of data transmission and facilitates device maintenance and management.

6.1 By way of 4G

This Demo reads the temperature and humidity of the Senselora 4G gateway itself and transmits the temperature and humidity data to ThingSpeak via 4G.

1.Open the 4Gthingspeak by Arduino IDE.

2.Install "Adafruit_AHT10" library.

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

tool_Manage_libraries.png

  • Search "Adafruit_AHT10" and click Install.

Adafruit_AHT10 library.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.
  • Modify the APIKEY in the code. key_code 4G.png

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

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

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

5.Verify the code and upload.

  • Click this icon to upload to the board.

download.png

Once the download is complete, wait a while to receive a message in Thingspeak. TS.png

6.2 By way of WIFI

This Demo reads the temperature and humidity of the Senselora 4G gateway itself and transmits the temperature and humidity data to ThingSpeak via WIFI.

1.Open the WIFIthingspeak by Arduino IDE.

2.Install "Adafruit_AHT10" library.

  • Select "Tools-->Manage Libraries..."
  • Search "Adafruit_AHT10" and click Install.

3.Change the WIFI ssid, password and APIKEY.

  • Change your WIFI ssid and password.
  • Click the "API Keys" and copy you Key.
  • Modify the APIKEY in the code. key_code WIFI.png

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

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

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

5.Verify the code and upload.

Once the download is complete, wait a while to receive a message in Thingspeak. TS.png

7. 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.

8. Resource

Github

Hardware