Skip to content

Commit fddacce

Browse files
author
Jirka Krepl
authored
Merge pull request #199 from pycom/lilycey-grammar
Updates to make more readable (whole document)
2 parents 3abf97a + 3623a16 commit fddacce

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

content/tutorials/all/PyGate.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ __To connect your Pygate to a LoRa server, follow these steps:__
88

99
3- Flash the Pycom Device with latest PyGate Firmware.
1010

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

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:__
1414

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

1717
```python
1818
from network import WLAN
@@ -63,7 +63,7 @@ machine.pygate_init(buf)
6363

6464
```
6565

66-
Sample Config json file for GW configuration on EU868 region:
66+
A sample Config json file for GW configuration on EU868 region:
6767

6868
```json
6969
{
@@ -258,10 +258,10 @@ To stop the Pygate at any time use:
258258
- REPL -> use CTRL-C
259259
- using deinit function `machine.pygate_deinit()`
260260

261-
that will stop GW tasks and safely power off the Concentrator.
261+
This will stop GW tasks and safely power-off the Concentrator.
262262

263263

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

266266
![alt_text](https://wiki.dragino.com/images/c/c6/TTN_Create_Gateway_0.png)
267267

@@ -272,25 +272,25 @@ __Note__: The Pygate packet forwarder is a legacy packet forwarder, you must mak
272272

273273
#### machine.pygate\_init([buff])
274274

275-
This function is used to initialize Pygate
275+
This function is used to initialize the Pygate
276276

277-
- `buff`: data contents of gateway global config json file
277+
- `buff`: the data contents of the gateway global config json file
278278

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)
280280

281281
#### machine.pygate\_deinit()
282282

283-
Shuts down concentrator.
283+
This shuts down the concentrator.
284284

285285
#### machine.pygate\_cmd\_decode(buff)
286286

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

289289
#### machine.pygate\_cmd\_get()
290290

291-
Get command execution result from concentrator.
291+
This gets the command execution result from concentrator.
292292

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:
294294

295295
```python
296296
from machine import UART
@@ -324,14 +324,13 @@ while True:
324324

325325
`machine.MP_QSTR_PYGATE_ERROR_EVT`
326326

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

329329
- `arg`: Optional arg to be bassed to callback function.
330330

331331
#### machine.events()
332332

333-
Get the pygate events
334-
333+
Get the Pygate events
335334

336335

337336
## Pygate Ethernet adapter APIs
@@ -340,46 +339,46 @@ Get the pygate events
340339

341340
### ETH.init(hosname=None)
342341

343-
This function starts Ethernet interface and enables the ethernet adapter.
342+
This function starts the Ethernet interface and enables the ethernet adapter.
344343

345-
`hostname`: set the interface hostname.
344+
`hostname`: set the interface hostname
346345

347346
### ETH. ifconfig(config=\['dhcp' or configtuple\])
348347

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

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

353352
If the 4-tuple config is given then a static IP is configured. For instance:
354353

355354
`eth.ifconfig(config=('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8'))`
356355

357356
### ETH.hostname(string)
358357

359-
Set interface host name.
358+
Set the interface host name.
360359

361360
### ETH.mac()
362361

363362
Get the ethernet interface mac address.
364363

365364
### ETH.deinit()
366365

367-
shuts down ethernet interface.
366+
Shuts down the ethernet interface.
368367

369368
### ETH.isconnected(Bool)
370369

371-
Returns `True` if the ethernet if link is up and IP is accquired, `Fasle` otherwise
370+
Returns `True` if the ethernet link is up and IP is accquired, `Fasle` if otherwise
372371

373372
### ETH.register(reg, cmd, value)
374373

375-
Write/Read specific register from/to the ksz8851 ethernet controller
374+
Write/read specific register from/to the ksz8851 ethernet controller
376375

377376
`cmd`: 0 to read , 1 to write
378377

379378
Ex: to read register 0x90
380379

381380
`eth.register(0x90,0)`
382381

383-
to write:
382+
To write:
384383

385384
`eth.register(0x90, 1, 0x0000)`

0 commit comments

Comments
 (0)