You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/tutorials/all/PyGate.md
+24-25Lines changed: 24 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ __To connect your Pygate to a LoRa server, follow these steps:__
8
8
9
9
3- Flash the Pycom Device with latest PyGate Firmware.
10
10
11
-
4- Upload the Gateway configuration json file on the attached pycom device (via Pymakr or VsCode) , Depending on the type of Pygate (EU868/US915) you should have different config files.
11
+
4- Upload the Gateway configuration json file onto the attached Pycom device (via Pymakr on Atom or VSCode). Depending on the type of Pygate (EU868/US915) you should have different config files.
12
12
13
-
__In the following example we will demonstrate a simple script for getting started with Pygate using Wifi connection for EU868 region:__
13
+
__The following example will demonstrate a simple script for getting started with a Pygate via a Wifi connection for the EU868 region:__
14
14
15
-
you can use that same file you just need to put your GW unique ID , LoRa server adresse and port numbers
15
+
You can use the same file, just enter your GW unique ID, the LoRa server address and port numbers.
16
16
17
17
```python
18
18
from network importWLAN
@@ -63,7 +63,7 @@ machine.pygate_init(buf)
63
63
64
64
```
65
65
66
-
Sample Config json file for GW configuration on EU868 region:
66
+
A sample Config json file for GW configuration on EU868 region:
67
67
68
68
```json
69
69
{
@@ -258,10 +258,10 @@ To stop the Pygate at any time use:
258
258
- REPL -> use CTRL-C
259
259
- using deinit function `machine.pygate_deinit()`
260
260
261
-
that will stop GW tasks and safely poweroff the Concentrator.
261
+
This will stop GW tasks and safely power-off the Concentrator.
262
262
263
263
264
-
__Note__: The Pygate packet forwarder is a legacy packet forwarder, you must make sure you use check legacy packet forwarder option in TTN as shown below.
264
+
__Note__: The Pygate packet forwarder is a legacy packet forwarder, so you must make sure you use select the legacy packet forwarder option in TTN as shown below.
@@ -272,25 +272,25 @@ __Note__: The Pygate packet forwarder is a legacy packet forwarder, you must mak
272
272
273
273
#### machine.pygate\_init([buff])
274
274
275
-
This function is used to initialize Pygate
275
+
This function is used to initialize the Pygate
276
276
277
-
-`buff`: data contents of gateway global config json file
277
+
-`buff`: the data contents of the gateway global config json file
278
278
279
-
when no parameter is passed to function the Pygate is just powered on. (will be useful when using pygate as just a concentrator controllable via uart by another device eg. RPi)
279
+
When no parameter is passed to function the Pygate is just powered on. (will be useful when using pygate as just a concentrator controllable via uart by another device eg. RPi)
280
280
281
281
#### machine.pygate\_deinit()
282
282
283
-
Shuts down concentrator.
283
+
This shuts down the concentrator.
284
284
285
285
#### machine.pygate\_cmd\_decode(buff)
286
286
287
-
send lora gateway command to concentrator, this is useful when packet forwarder / HAL software is run on a different device (eg. Rpi) and commands to concentrator are passed to Pygate via uart
287
+
This sends the LoRa gateway command to the concentrator. This is useful when packet forwarder / HAL software is run on a different device (e.g. Rpi) and commands to the concentrator are passed to the Pygate via UART.
288
288
289
289
#### machine.pygate\_cmd\_get()
290
290
291
-
Get command execution result from concentrator.
291
+
This gets the command execution result from concentrator.
292
292
293
-
Example script when running Packet forwarder sw on a different device:
293
+
An example script demonstrating running packet forwarder software on a different device:
294
294
295
295
```python
296
296
from machine importUART
@@ -324,14 +324,13 @@ while True:
324
324
325
325
`machine.MP_QSTR_PYGATE_ERROR_EVT`
326
326
327
-
-`handler`: The callback function to be called, when not passed to function the any pre-registered callback will be disabled/removed
327
+
-`handler`: The callback function to be called. When not passed to function, any pre-registered callback will be disabled/removed.
328
328
329
329
-`arg`: Optional arg to be bassed to callback function.
330
330
331
331
#### machine.events()
332
332
333
-
Get the pygate events
334
-
333
+
Get the Pygate events
335
334
336
335
337
336
## Pygate Ethernet adapter APIs
@@ -340,46 +339,46 @@ Get the pygate events
340
339
341
340
### ETH.init(hosname=None)
342
341
343
-
This function starts Ethernet interface and enables the ethernet adapter.
342
+
This function starts the Ethernet interface and enables the ethernet adapter.
344
343
345
-
`hostname`: set the interface hostname.
344
+
`hostname`: set the interface hostname
346
345
347
346
### ETH. ifconfig(config=\['dhcp' or configtuple\])
348
347
349
-
With no parameters given returns a 4-tuple of (ip, subnet_mask, gateway, DNS_server).
348
+
With no parameters given, this returns a 4-tuple of (ip, subnet_mask, gateway, DNS_server).
350
349
351
-
If dhcp is passed as a parameter then the DHCP client is enabled and the IP params are negotiated with the dhcp server.
350
+
If DHCP is passed as a parameter, then the DHCP client is enabled and the IP params are negotiated with the DHCP server.
352
351
353
352
If the 4-tuple config is given then a static IP is configured. For instance:
0 commit comments