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
-
STM32F411CEU6 Black Pill development board
-
A9G module (GPS, cellular connectivity, SD card support)
-
SX1278 LoRa module (range up to 10 kilometers)
-
ST-Link V2 programming port
-
DPDT switch for power management
2.2. Product Images
2.2.1. PCB Front and Back Views
2.2.2. 3D Views
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 |
2.3.3. ST-Link V2 to Black Pill Connections (Programming)
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
-
Download and install the latest Arduino IDE from the official website.
-
Install STM32 board support:
-
Go to File > Preferences
-
Add the following URL to the "Additional Boards Manager URLs" field:
https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json
-
Go to Tools > Board > Boards Manager
-
Search for "STM32" and install the "STM32 MCU based boards" package
-
-
Select the board: Tools > Board > STM32 boards > Generic STM32F4 series > BlackPill F411CE
-
Install necessary libraries for A9G and LoRa (RadioHead) modules
2.4.2. Option 2: PlatformIO (VS Code)
-
Install Visual Studio Code
-
Install the PlatformIO extension for VS Code
-
Create a new project:
-
Select STM32F411CEU6 as the board
-
Choose Arduino as the framework
-
-
Configure
platformio.ini
file:
[env:blackpill_f411ce]
platform = ststm32
board = blackpill_f411ce
framework = arduino
upload_protocol = stlink
-
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
-
Connect ST-Link V2 to your computer via USB
-
Set DPDT switch to programming position (Position 2)
-
Connect ST-Link V2 to the programming port on the UpNode GW03
-
In your chosen IDE:
-
Write or open your program
-
Compile the code
-
Upload the program to the board
-
-
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
-
SMS: Send and receive text messages
-
MQTT: Connect to MQTT brokers for IoT applications
-
GPS: Retrieve location data
-
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
-
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
-
-
A9G module not responding:
-
Check power supply
-
Verify UART connections in the program
-
Ensure correct baud rate
-
-
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
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Comments