Skip to content

Commit acd8a11

Browse files
committed
Update: WM1302 Module with new Linux kernel
1 parent 61cdd31 commit acd8a11

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

docs/Network/LoRa_Wio_Series/Wio_WM1302/WM1302_module.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ keywords:
77
image: https://wiki.seeedstudio.com/wio_gps_board/
88
slug: /WM1302_module
99
last_update:
10-
date: 01/30/2023
11-
author: hushuxu
10+
date: 02/17/2025
11+
author: Leo Liu
1212
---
1313

1414
<!-- ![](https://files.seeedstudio.com/wiki/WM1302_module/WM1302_3.jpeg) -->
@@ -220,7 +220,22 @@ make
220220

221221
#### Step4. Run Semtech SX1302 packet forwarder
222222

223-
Firstly, modify `reset pin` for SX1302 and SX1261 in `reset_lgw.sh` script, with text editor `nano`:
223+
:::caution Note
224+
In the new Linux kernel, the **sysfs interface** has been replaced by the **chardev interface**. This causes the reset_lgw.sh provided in the sx_1302 repository to not reset the module properly.
225+
226+
To determine if the system you are running on still has the sysfs interface, you can run the following command:
227+
228+
```shell
229+
ls /sys/class/gpio
230+
```
231+
232+
:::
233+
234+
**For Linux with sysfs interface:**
235+
236+
If a series of `gpiox` folders appear in it, it means that your system kernel still has the sysfs interface, and you can use the script above to reset the module.
237+
238+
Modify `reset pin` for SX1302 and SX1261 in `reset_lgw.sh` script, with text editor `nano`:
224239

225240
```
226241
nano tools/reset_lgw.sh
@@ -252,6 +267,58 @@ AD5338R_RESET_PIN=13 # AD5338R reset (full-duplex CN490 reference design)
252267

253268
Save these changes by pressing `CTRL + x`, and then `y`, finally pressing `Enter` to close the text editor.
254269

270+
**For Linux without sysfs interface:**
271+
272+
If there is no folder named `gpiox` in it, then you need to call the GPIO using the **Libgpiod package**.
273+
274+
The reset_lgw.sh script to control the GPIO using the Libgpiod package is as follows:
275+
276+
<details>
277+
<summary>reset_lgw.sh</summary>
278+
279+
```shell
280+
SX1302_RESET_PIN=17 # SX1302 reset
281+
SX1302_POWER_EN_PIN=18 # SX1302 power enable
282+
SX1261_RESET_PIN=5 # SX1261 reset (LBT / Spectral Scan)
283+
284+
285+
WAIT_GPIO() {
286+
sleep 0.1
287+
}
288+
289+
reset() {
290+
echo "CoreCell reset through GPIO$SX1302_RESET_PIN..."
291+
echo "SX1261 reset through GPIO$SX1261_RESET_PIN..."
292+
echo "CoreCell power enable through GPIO$SX1302_POWER_EN_PIN..."
293+
294+
# write output for SX1302 CoreCell power_enable and reset
295+
gpioset gpiochip0 $SX1302_POWER_EN_PIN=1; WAIT_GPIO
296+
297+
gpioset gpiochip0 $SX1302_RESET_PIN=1; WAIT_GPIO
298+
gpioset gpiochip0 $SX1302_RESET_PIN=0; WAIT_GPIO
299+
300+
gpioset gpiochip0 $SX1261_RESET_PIN=0; WAIT_GPIO
301+
gpioset gpiochip0 $SX1261_RESET_PIN=1; WAIT_GPIO
302+
}
303+
304+
case "$1" in
305+
start)
306+
reset
307+
;;
308+
stop)
309+
reset
310+
;;
311+
*)
312+
echo "Usage: $0 {start|stop}"
313+
exit 1
314+
;;
315+
esac
316+
317+
exit 0
318+
```
319+
320+
</details>
321+
255322
Copy `reset_lgw.sh` to `packet_forwarder` folder, then run `lora_pkt_fwd`. Please note that you should select a `global_conf.json.sx1250.xxxx` config file based on the module you are using:
256323

257324
```

0 commit comments

Comments
 (0)