Home Subscribe

2. GW03

This manual provides essential information for programming the UpNode GW03 gateway adapter module. The UpNode GW03 is a pre-assembled PCB that integrates an STM32F411CEU6 Black Pill development board, an A9G module, and a SX1278 LoRa module, offering a versatile platform for IoT and wireless communication projects.

2.1. Product Overview

2.1.1. Key Components

  1. STM32F411CEU6 Black Pill development board

  2. A9G module (GPS, cellular connectivity, SD card support)

  3. SX1278 LoRa module (range up to 10 kilometers)

  4. ST-Link V2 programming port

  5. DPDT switch for power management

2.2. Product Images

2.2.1. PCB Front and Back Views

Front PCB View
Back PCB View

2.2.2. 3D Views

3D Left View
3D Right View

2.3. Hardware Connections

2.3.1. SX1278 to Black Pill Connections

SX1278 Pin Black Pill Pin Function

GND

GND

Ground

VCC

3.3V

Power

DIO0

PB0

Interrupt Pin

NSS

PA4

SPI Chip Select

SCK

PA5

SPI Clock

MOSI

PA7

SPI MOSI

MISO

PA6

SPI MISO

RST

PA3

Reset

2.3.2. A9G Module to Black Pill Connections

A9G Pin Black Pill Pin Function

GND

GND

Ground

VCC

5V

Power

TXD

PA10

UART1 RX

RXD

PA9

UART1 TX

ST-Link V2 Pin Black Pill Pin Function

6 (SWCLK)

PA14

Serial Wire Clock

2 (SWDIO)

PA13

Serial Wire Data I/O

4 (GND)

GND

Ground

8 (3.3V)

3.3V

Power

2.3.4. Power Management

The DPDT switch manages power supply and programming modes:

  • Position 1 (Normal Operation): 5V to STM32’s 5V input

  • Position 2 (Programming Mode): ST-Link 3.3V to STM32’s programming port

2.4. Development Environment Setup

The UpNode GW03 can be programmed using various development environments. This manual covers two popular options:

2.4.1. Option 1: Arduino IDE

  1. Download and install the latest Arduino IDE from the official website.

  2. Install STM32 board support:

    1. Go to File > Preferences

    2. Add the following URL to the "Additional Boards Manager URLs" field: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json

    3. Go to Tools > Board > Boards Manager

    4. Search for "STM32" and install the "STM32 MCU based boards" package

  3. Select the board: Tools > Board > STM32 boards > Generic STM32F4 series > BlackPill F411CE

  4. Install necessary libraries for A9G and LoRa (RadioHead) modules

2.4.2. Option 2: PlatformIO (VS Code)

  1. Install Visual Studio Code

  2. Install the PlatformIO extension for VS Code

  3. Create a new project:

    1. Select STM32F411CEU6 as the board

    2. Choose Arduino as the framework

  4. Configure platformio.ini file:

[env:blackpill_f411ce]
platform = ststm32
board = blackpill_f411ce
framework = arduino
upload_protocol = stlink
  1. Install necessary libraries for A9G and LoRa modules using PlatformIO’s library manager

2.5. Programming the UpNode GW03

2.5.1. Flashing the STM32F411CEU6

  1. Connect ST-Link V2 to your computer via USB

  2. Set DPDT switch to programming position (Position 2)

  3. Connect ST-Link V2 to the programming port on the UpNode GW03

  4. In your chosen IDE:

    1. Write or open your program

    2. Compile the code

    3. Upload the program to the board

  5. After programming, switch DPDT to normal operation (Position 1 (5V))

2.5.2. Programming the A9G Module

The A9G module offers GPS, cellular connectivity (including SMS and MQTT), and SD card support. Here’s a basic example to initialize the module and retrieve GPS data:

#include <SoftwareSerial.h>

SoftwareSerial a9gSerial(PA10, PA9); // RX, TX

void setup() {
  Serial.begin(115200);
  a9gSerial.begin(115200);

  // Initialize A9G module
  a9gSerial.println("AT");
  delay(1000);

  // Enable GPS
  a9gSerial.println("AT+CGPS=1");
  delay(1000);
}

void loop() {
  // Request GPS information
  a9gSerial.println("AT+CGPSINFO");

  // Read and print response
  while (a9gSerial.available()) {
    Serial.write(a9gSerial.read());
  }

  delay(5000);
}

2.5.3. Programming the SX1278 LoRa Module

The SX1278 LoRa module allows for long-range wireless communication up to 10 kilometers. Here’s a basic example using the RadioHead library to initialize the module and send data:

#include <SPI.h>
#include <RH_RF95.h>

#define RFM95_CS PA4
#define RFM95_RST PA3
#define RFM95_INT PB0

// Initialize RadioHead driver
RH_RF95 rf95(RFM95_CS, RFM95_INT);

void setup() {
  Serial.begin(115200);

  // Reset LoRa module
  pinMode(RFM95_RST, OUTPUT);
  digitalWrite(RFM95_RST, LOW);
  delay(10);
  digitalWrite(RFM95_RST, HIGH);
  delay(10);

  // Initialize LoRa module
  if (!rf95.init()) {
    Serial.println("LoRa initialization failed");
    while (1);
  }

  // Set frequency
  rf95.setFrequency(915.0);
  // Set transmit power to 23 dBm
  rf95.setTxPower(23, false);
}

void loop() {
  // Send data
  const char* data = "Hello from UpNode GW03";
  rf95.send((uint8_t*)data, strlen(data));
  rf95.waitPacketSent();

  Serial.println("Data sent");
  delay(5000);
}

2.6. Advanced Features

2.6.1. A9G Module Capabilities

  1. SMS: Send and receive text messages

  2. MQTT: Connect to MQTT brokers for IoT applications

  3. GPS: Retrieve location data

  4. SD Card: Store and retrieve data locally

2.6.2. SX1278 LoRa Long-Range Communication

The SX1278 LoRa module can communicate up to 10 kilometers in optimal conditions. Factors affecting range include:

  • Antenna design and placement

  • Environmental obstacles

  • Transmission power settings

  • Spreading factor and bandwidth settings

  • Line of sight availability

2.7. Troubleshooting

2.7.1. Common Programming Issues

  1. Upload fails:

    • Check DPDT switch position

    • Verify ST-Link connections

    • Ensure correct board and port selection in IDE

    • For Black Pill, check BOOT0 jumper position

  2. A9G module not responding:

    • Check power supply

    • Verify UART connections in the program

    • Ensure correct baud rate

  3. LoRa communication issues:

    • Check antenna connection

    • Verify SPI pin connections

    • Ensure correct frequency and power settings

    • Verify LoRa parameters (spreading factor, bandwidth)

2.8. Suggestions for Improvement

Any suggestions or improvements for the UpNode GW03 is welcome. Please contact SiliconWit on GitHub or visit our community forums.

For detailed specifications or advanced usage, please refer to the individual component datasheets.



Add Comment

* Required information
1000
Drag & drop images (max 3)
Enter the word shark backwards.

Comments

No comments yet. Be the first!