diff --git a/config.toml b/config.toml index 097c9b3..003c647 100644 --- a/config.toml +++ b/config.toml @@ -629,7 +629,7 @@ theme = "doc-theme" weight = 60 [[menu.main]] name = "Pymesh BLE" - url = "/firmwareapi/pycom/network/bluetooth/BLE_Mesh/" + url = "/firmwareapi/pycom/network/bluetooth/btmesh/" identifier = "firmwareapi@pycom@network@bluetooth@BLE_Mesh" parent = "firmwareapi@pycom@network@bluetooth" weight = 70 diff --git a/content/datasheets/expansionboards/pysense2.md b/content/datasheets/expansionboards/pysense2.md index 24689b9..2c2427f 100644 --- a/content/datasheets/expansionboards/pysense2.md +++ b/content/datasheets/expansionboards/pysense2.md @@ -15,6 +15,7 @@ The datasheet of the Pysense 2.0X is available as a [PDF File](gitbook/assets/Py ## Pinout +The PyPort connector is for a 6 lead mini ribbon cable. Part: Amphenol 20021511-00006T4LF The pinout of the Pysense is available as a [PDF File](/gitbook/assets/pysense2-pinout.pdf) diff --git a/content/datasheets/expansionboards/pytrack2.md b/content/datasheets/expansionboards/pytrack2.md index d14c782..e0d30a0 100644 --- a/content/datasheets/expansionboards/pytrack2.md +++ b/content/datasheets/expansionboards/pytrack2.md @@ -15,6 +15,7 @@ The datasheet of the Pytrack is available as a [PDF File](/gitbook/assets/PyTrac ## Pinout +The PyPort connector is for a 6 lead mini ribbon cable. Part: Amphenol 20021511-00006T4LF The pinout of the Pytrack is available as a [PDF File]( /gitbook/assets/pytrack2-pinout.pdf) diff --git a/content/firmwareapi/micropython/array.md b/content/firmwareapi/micropython/array.md index e0726b1..4062afe 100644 --- a/content/firmwareapi/micropython/array.md +++ b/content/firmwareapi/micropython/array.md @@ -27,6 +27,7 @@ Create array with elements of given type. Initial contents of the array are give * `Q`: unsigned long long, 8 bytes * `f`: foat, 4 bytes * `d`: double, 8 bytes + Adapting the typecode to the array-type you want to create can save a lot of space on the microcontroller ## Methods diff --git a/content/firmwareapi/micropython/builtin.md b/content/firmwareapi/micropython/builtin.md index 38c45a4..9b82c5f 100644 --- a/content/firmwareapi/micropython/builtin.md +++ b/content/firmwareapi/micropython/builtin.md @@ -11,13 +11,14 @@ All builtin functions are described here. ### abs(val) Returns the absolute value of val -### all([]) -Returns true if all items in an iterable are True +### all(itereable]) -### any([]) +Returns true if all items in an iterable are value `True` -Returns true if any of the items in an iterable are True +### any(iterable) + +Returns true if any of the items in an iterable are value `True` ### bin(val) @@ -45,8 +46,8 @@ Returns a classmethod for the passed function ### complex([real, imag]) -Creates a complex number from the passed variables. -> You can also use `a-bj` +Creates a complex number from the passed variables. +> You can also use the textual notation `'a+bj'`, e.g. `'1+2j'` ### delattr(object, name) @@ -58,7 +59,7 @@ Returns a list of valid attributes of the object. If no parameter is passed, it ### divmod(x, y) -Divides and mods the two values. Similar to `(x / y, x % y)` +Divides and mods the two values. Similar to `(x / y, x % y)` \ Returns a tuple `(q, r)` of the two paramters, with quotient `q` and remainder `r` ### numerate() diff --git a/content/firmwareapi/pycom/aes.md b/content/firmwareapi/pycom/aes.md index c430b9d..028660c 100644 --- a/content/firmwareapi/pycom/aes.md +++ b/content/firmwareapi/pycom/aes.md @@ -31,7 +31,7 @@ print(original) ## Constructors -### class ucrypto.AES(key, mode=AES.MODE_ECB, IV, counter, segment_size) +### class ucrypto.AES(key, [mode=AES.MODE_ECB, IV, counter, segment_size]) Create an AES object that will let you encrypt and decrypt messages. @@ -39,7 +39,7 @@ The arguments are: * `key` (byte string) is the secret key to use. It must be 16 (AES-128), 24 (AES-192), or 32 (AES-256) bytes long. * `mode` is the chaining mode to use for encryption and decryption. Can be the following values: - * `AES.MODE_ECB`: Electronic Code Book. Simplest encryption mode. It does not hide data patterns well (see this article for more info) + * `AES.MODE_ECB`: Electronic Code Book. Simplest encryption mode. * `AES.MODE_CBC`: Cipher-Block Chaining. An Initialisation Vector (IV) is required. * `AES.MODE_CFB`: Cipher feedback. `plaintext` and `ciphertext` are processed in segments of `segment_size` bits. Works a stream cipher. * `AES.MODE_CTR`: Counter mode. Each message block is associated to a counter which must be unique across all messages that get encrypted with the same key. diff --git a/content/firmwareapi/pycom/network/lora/_index.md b/content/firmwareapi/pycom/network/lora/_index.md index 63c93c0..da01c7a 100644 --- a/content/firmwareapi/pycom/network/lora/_index.md +++ b/content/firmwareapi/pycom/network/lora/_index.md @@ -3,13 +3,13 @@ title: "LoRa" aliases: - /firmwareapi/pycom/network/lora.md --- -This class provides a LoRaWAN 1.0.2 compliant driver for the LoRa network processor in the LoPy and FiPy. Below is an example demonstrating LoRaWAN Activation by Personalisation usage: +This class provides a LoRaWAN 1.0.2 compliant driver for the LoRa network processor in the LoPy, LoPy4 and FiPy. > Please ensure that there is an antenna connected to your device before sending/receiving LoRa messages as improper use (e.g. without an antenna), may damage the device. ## Examples -For various other complete LoRa examples, check [here](/tutorials/networks/lora/) for examples. +For various complete LoRa examples, check [here](/tutorials/networks/lora/). ## Constructors @@ -38,16 +38,22 @@ The arguments are: * `LoRa.EU868` * `LoRa.US915` * `LoRa.CN470` - * `LoRa.CN779` * `LoRa.IN865` - > If no region is provided, it will default to the setting provided in the CONFIG partition. + > If no region is provided, it will default to the setting provided in the CONFIG partition, set by the Firmware Updater tool. * `frequency` accepts values within the selected Region frequency bands. * `tx_power` is the transmit power in dBm. * `bandwidth` is the channel bandwidth in KHz. + * `LoRa.BW_125KHZ` + * `LoRa.BW_250KHZ` + * `LoRa.BW_500KHZ` * `sf` sets the desired spreading factor. Accepts values between 7 and 12. * `preamble` configures the number of pre-amble symbols. The default value is 8. -* `coding_rate` can take the following values: `LoRa.CODING_4_5`, `LoRa.CODING_4_6`, `LoRa.CODING_4_7` or `LoRa.CODING_4_8`. +* `coding_rate` can take the following values: + * `LoRa.CODING_4_5` + * `LoRa.CODING_4_6` + * `LoRa.CODING_4_7` + * `LoRa.CODING_4_8` * `power_mode` can be either `LoRa.ALWAYS_ON`, `LoRa.TX_ONLY` or `LoRa.SLEEP`. In `ALWAYS_ON` mode, the radio is always listening for incoming - packets whenever a transmission is not taking place. In `TX_ONLY` the radio goes to sleep as soon as the transmission completes. In `SLEEP` mode the radio is sent to sleep permanently and won't accept any commands until the power mode is changed. * `tx_iq` enables TX IQ inversion. * `rx_iq` enables RX IQ inversion. @@ -62,7 +68,9 @@ The arguments are: Join a LoRaWAN network. Internally the stack will automatically retry every 15 seconds until a Join Accept message is received. The parameters are: -* `activation`: can be either `LoRa.OTAA` or `LoRa.ABP`. +* `activation`: can be either: + * `LoRa.OTAA`: Over the Air Activation + * `LoRa.ABP`: Activation By Personalisation * `auth`: is a tuple with the authentication data. * In the case of `LoRa.OTAA` the authentication tuple is: `(dev_eui, app_eui, app_key)` where `dev_eui` is optional. If it is not provided the LoRa MAC will be used. * In the case of `LoRa.ABP` the authentication tuple is: `(dev_addr, nwk_swkey, app_swkey)`. @@ -74,9 +82,16 @@ Join a LoRaWAN network. Internally the stack will automatically retry every 15 s Get or set the frequency in raw LoRa mode (`LoRa.LORA`). The allowed range is region-specific. +### lora.bandwidth([bandwidth]) + +Get or set the bandwidth in raw LoRa mode (`LoRa.LORA`). Bandwidth can be either: (depending on the region setting) +* `LoRa.BW_125KHZ` +* `LoRa.BW_250KHZ` +* `LoRa.BW_500KHZ` + ### lora.coding_rate([coding_rate]) -Get or set the coding rate in raw LoRa mode (`LoRa.LORA`). The allowed values are: +Get or set the coding rate in raw LoRa mode (`LoRa.LORA`). The allowed values are: (depending on the region setting) * `LoRa.CODING_4_5` * `LoRa.CODING_4_6` * `LoRa.CODING_4_7` diff --git a/content/firmwareapi/pycom/pycom.md b/content/firmwareapi/pycom/pycom.md index 25ccb09..1d23973 100644 --- a/content/firmwareapi/pycom/pycom.md +++ b/content/firmwareapi/pycom/pycom.md @@ -53,7 +53,7 @@ Erase the entire NVRAM memory area. ### pycom.pulses_get(pin, timeout) -Return a list of pulses at `pin`. The methods scans for transitions at `pin` and returns a list of tuples, each telling the pin value and the duration in microseconds of that value. `pin` is a pin object, which must have set to `INP` or `OPEN_DRAIN` mode. The scan stops if not transitions occurs within `timeout` milliseconds. +Return a list of pulses at `pin`. The methods scans for transitions at `pin` and returns a list of tuples, each telling the pin value and the duration in microseconds of that value. `pin` is a pin object, which must have set to `INP` or `OPEN_DRAIN` mode. The scan stops if no transitions occur within `timeout` milliseconds. Example: @@ -69,6 +69,16 @@ sleep_ms(20) pin(1) data = pulses_get(pin, 100) ``` +### pycom.get_free_heap() + +Returns the free heap bytes in the memory allocation + + +## Pybytes methods + +### pycom.pybytes_on_boot() + +Get or set the activation of pybytes on boot. ## Boot methods