mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 11:06:37 +01:00
fix on alert info
This commit is contained in:
@@ -9,5 +9,5 @@ The standard Python libraries have been "micro-ified" to fit in with the philoso
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Some modules are available by an u-name, and also by their non-u-name. The non-u-name can be overridden by a file of that name in your package path. For example, `import json` will first search for a file `json.py` or directory `json` and load that package if it's found. If nothing is found, it will fallback to loading the built-in `ujson` module.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
|
||||
@@ -9,5 +9,5 @@ The standard Python libraries have been "micro-ified" to fit in with the philoso
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Some modules are available by an u-name, and also by their non-u-name. The non-u-name can be overridden by a file of that name in your package path. For example, `import json` will first search for a file `json.py` or directory `json` and load that package if it's found. If nothing is found, it will fallback to loading the built-in `ujson` module.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Print exception with a traceback to a file-like object file (or `sys.stdout` by
|
||||
**Difference to CPython**
|
||||
|
||||
This is simplified version of a function which appears in the traceback module in CPython. Unlike `traceback.print_exception()`, this function takes just exception value instead of exception type, exception value, and traceback object; file argument should be positional; further arguments are not supported. CPython-compatible traceback module can be found in `micropython-lib`.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Constants
|
||||
|
||||
@@ -36,7 +36,7 @@ This is simplified version of a function which appears in the traceback module i
|
||||
**Difference to CPython**
|
||||
|
||||
CPython mandates more attributes for this object, but the actual useful bare minimum is implemented in MicroPython.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
* `sys.maxsize`: Maximum value which a native integer type can hold on the current platform, or maximum value representable by MicroPython integer type, if it's smaller than platform max value (that is the case for MicroPython ports without long int support).
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Convert binary data to hexadecimal representation. Returns bytes string.
|
||||
**Difference to CPython**
|
||||
|
||||
If additional argument, `sep` is supplied, it is used as a separator between hexadecimal values.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### ubinascii.unhexlify(data)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The parameter `bits` is rounded upwards to the nearest multiple of 32 bits.
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
Cryptography is not a trivial business. Doing things the wrong way could quickly result in decreased or no security. Please document yourself in the subject if you are depending on encryption to secure important information.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### crypto.generate\_rsa\_signature(message, private_key, \*, pers="esp32-tls")
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ This module implements "foreign data interface" for MicroPython. The idea behind
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Module ustruct Standard Python way to access binary data structures (doesn't scale well to large and complex structures).
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Defining Structure Layout
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ Bind the `socket` to `address`. The socket must not already be bound. The `addre
|
||||
|
||||
{{% hint style="info" %}}
|
||||
In the case of LoRa sockets, the address parameter is simply an integer with the port number, for instance: `s.bind(1)`
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.listen(\[backlog\])
|
||||
|
||||
@@ -126,7 +126,7 @@ The socket must be in blocking mode; it can have a timeout, but the file object'
|
||||
**Difference to CPython**
|
||||
|
||||
Closing the file object returned by `makefile()` **WILL** close the original socket as well.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.read(size)
|
||||
|
||||
|
||||
@@ -90,5 +90,5 @@ Set or get the timezone offset, in seconds. If `secs` is not provided, it return
|
||||
|
||||
{{% hint style="info" %}}
|
||||
In MicroPython, `time.timezone` works the opposite way to Python. In [Python](https://docs.python.org/3/library/time.html#time.timezone), to get the local time, you write `local_time = utc - timezone`, while in MicroPython it is `local_time = utc + timezone`.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@ Create a `stream` wrapper which allows transparent decompression of compressed d
|
||||
**Difference to CPython**
|
||||
|
||||
This class is MicroPython extension. It's included on provisional basis and may be changed considerably or removed in later versions.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -18,4 +18,4 @@ Currently, there are 2 classes that support interrupts; the [`Alarm`](../pycom/m
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Currently the interrupt system can queue up to **16 interrupts**.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -10,7 +10,7 @@ AES (Advanced Encryption Standard) is a symmetric block cipher standardised by N
|
||||
|
||||
{{% hint style="info" %}}
|
||||
AES is implemented using the ESP32 hardware module.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Quick Usage Example
|
||||
|
||||
@@ -65,5 +65,4 @@ Decrypt data with the key and the parameters set at initialisation.
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
To avoid security issues, IV should always be a random number and should never be reused to encrypt two different messages. The same applies to the counter in CTR mode. You can use `crypto.getrandbits()` for this purpose.
|
||||
{{< /hint >}}
|
||||
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -89,7 +89,7 @@ Returns a byte string with a unique identifier of a board/SoC. It will vary from
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Use `ubinascii.hexlify()` to convert the byte string to hexadecimal form for ease of manipulation and use elsewhere.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### machine.info()
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ Returns a byte string with a unique identifier of a board/SoC. It will vary from
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Use `ubinascii.hexlify()` to convert the byte string to hexadecimal form for ease of manipulation and use elsewhere.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### machine.info()
|
||||
|
||||
|
||||
@@ -96,4 +96,4 @@ Converts the provided value into a voltage (in millivolts) in the same way volta
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
ADC pin input range is `0-1.1V`. This maximum value can be increased up to `3.3V` using the highest attenuation of `11dB`. **Do not exceed the maximum of 3.3V**, to avoid damaging the device.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -132,7 +132,7 @@ p_in.callback(Pin.IRQ_FALLING | Pin.IRQ_RISING, pin_handler)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
For more information on how Pycom's products handle interrupts, see [here](/firmwareapi/notes#interrupt-handling).
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Attributes
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ Deinitialise the RMT object.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
If an RMT object needs to be reconfigured from RX/TX to TX/RX, then either first `deinit()` must be called or the `init()` again with the desired configuration.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### rmt.pulses\_get(pulses, timeout)
|
||||
|
||||
@@ -107,7 +107,7 @@ Return value: Tuple of items with the following structure: `(level, duration)`:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Maximum of 128 pulses can be received in a row without receiving "idle" signal. If the incoming pulse sequence contains more than 128 pulses the rest is dropped and the receiver waits for another sequence of pulses. The `pulses_get` function can be called to receive more than 128 pulses, however the above mentioned limitation should be kept in mind when evaluating the received data.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### rmt.pulses\_send(duration, data, start\_level)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ rtc.init((2017, 2, 28, 10, 30, 0, 0, 0))
|
||||
|
||||
{{% hint style="info" %}}
|
||||
`tzinfo` is ignored by this method. Use `time.timezone` to achieve similar results.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### rtc.now()
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ If you have one of the Pycom expansion boards, then simply insert the card into
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Make sure your SD card is formatted either as FAT16 or FAT32.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Quick Example Usage:
|
||||
|
||||
@@ -56,4 +56,4 @@ Disable the SD card.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Please note that the SD card library currently supports FAT16/32 formatted SD cards up to 32 GB. Future firmware updates will increase compatibility with additional formats and sizes.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -16,7 +16,7 @@ These two concepts are grouped into two different subclasses:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
You can create as many of these objects as needed.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
### Constructors
|
||||
|
||||
@@ -131,4 +131,4 @@ clock = Clock()
|
||||
|
||||
{{% hint style="info" %}}
|
||||
For more information on how Pycom's products handle interrupts, see [notes](/firmwareapi/notes#interrupt-handling).
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
@@ -79,7 +79,7 @@ Construct a UART object on the given `bus`. `bus` can be `0, 1 or 2`. If the `bu
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
On the GPy/FiPy UART2 is unavailable because it is used to communicate with the cellular radio.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Methods
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ To use an external antenna, set `P12 as output pin.`
|
||||
|
||||
Pin('P12', mode=Pin.OUT)(True)
|
||||
```
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
### bluetooth.deinit()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ To use an external antenna, set `P12 as output pin.`
|
||||
|
||||
Pin('P12', mode=Pin.OUT)(True)
|
||||
```
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
### bluetooth.deinit()
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ print(data)
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
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.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Additional Examples
|
||||
|
||||
@@ -93,7 +93,7 @@ The arguments are:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
In `LoRa.LORAWAN` mode, only `adr`, `public`, `tx_retries` and `device_class` are used. All the other params will be ignored as they are handled by the LoRaWAN stack directly. On the other hand, in `LoRa.LORA` mode from those 4 arguments, only the public one is important in order to program the sync word. In `LoRa.LORA` mode `adr`, `tx_retries` and `device_class` are ignored since they are only relevant to the LoRaWAN stack.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
For example, you can do:
|
||||
|
||||
@@ -444,7 +444,7 @@ s.bind(1)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The `bind()` method is only applicable when the radio is configured in `LoRa.LORAWAN` mode.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.send(bytes)
|
||||
|
||||
@@ -500,7 +500,7 @@ s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, True)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Socket options are only applicable when the LoRa radio is used in LoRa.LORAWAN mode. When using the radio in LoRa.LORA mode, use the class methods to change the spreading factor, bandwidth and coding rate to the desired values.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.settimeout(value)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ print(data)
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
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.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Additional Examples
|
||||
|
||||
@@ -88,7 +88,7 @@ The arguments are:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
In `LoRa.LORAWAN` mode, only `adr`, `public`, `tx_retries` and `device_class` are used. All the other params will be ignored as they are handled by the LoRaWAN stack directly. On the other hand, in `LoRa.LORA` mode from those 4 arguments, only the public one is important in order to program the sync word. In `LoRa.LORA` mode `adr`, `tx_retries` and `device_class` are ignored since they are only relevant to the LoRaWAN stack.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
For example, you can do:
|
||||
|
||||
@@ -432,7 +432,7 @@ LoRa-Mesh socket is created, if the Mesh was enabled before (`lora.mesh()` was c
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The LoRa-Mesh socket supports only the following socket methods: `close()` , `bind()`, `sendto()`, and `recvfrom()`.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
LoRa sockets support the following standard methods from the socket module:
|
||||
|
||||
@@ -454,7 +454,7 @@ s.bind(1)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The `bind()` method is only applicable when the radio is configured in `LoRa.LORAWAN` mode.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.send(bytes)
|
||||
|
||||
@@ -515,7 +515,7 @@ s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, True)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Socket options are only applicable when the LoRa radio is used in LoRa.LORAWAN mode. When using the radio in LoRa.LORA mode, use the class methods to change the spreading factor, bandwidth and coding rate to the desired values.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### socket.settimeout(value)
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ Pymesh sockets is created, if the Mesh was enabled before (`lora.Mesh()` was cal
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The Pymesh sockets supports only the following socket methods: `close()` , `bind()`, `sendto()`, and `recvfrom()`.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
LoRa sockets support the following standard methods from the socket module:
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ The GPy and FiPy support both new LTE-M protocols:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
**Please note:** The GPy and FiPy only support the two protocols above and are not compatible with older LTE standards.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The Sequans modem used on Pycom's cellular enabled modules can only work in one of these modes at a time. In order to switch between the two protocols you need to flash a different firmware to the Sequans modem. Instructions for this can be found [here](/tutorials/lte/firmware).
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
{{% hint style="info" %}}
|
||||
|
||||
@@ -33,7 +33,7 @@ The Sequans modem used on Pycom's cellular enabled modules can only work in one
|
||||
|
||||
- Fipy/GPy v1.2 with Sequans old modem Firmwares < (39xxx)==> Supports 6 Bands (3, 4, 12, 13, 20, 28)
|
||||
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## AT Commands
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ for i in range(1, 100):
|
||||
```
|
||||
|
||||
There will be a 20 second delay after every 2 packets.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
This class provides a driver for the Sigfox network processor in the Sigfox enabled Pycom devices.
|
||||
|
||||
@@ -50,7 +50,7 @@ s.send(bytes([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
Please ensure that there is an antenna connected to your device before sending/receiving Sigfox messages as in proper use (e.g. without an antenna), may damage the device.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Constructors
|
||||
|
||||
@@ -69,7 +69,7 @@ sigfox = Sigfox(mode=Sigfox.FSK, frequency=912000000)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Sigfox.FSK mode is not supported on LoPy 4 and FiPy.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -85,7 +85,7 @@ The arguments are:
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The SiPy comes in 2 different hardware flavours: a +14dBm Tx power version which can only work with `RCZ1` and `RCZ3` and a +22dBm version which works exclusively on `RCZ2` and `RCZ4`.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### sigfox.mac()
|
||||
|
||||
@@ -110,7 +110,7 @@ To return human-readable values you should import `ubinascii` and convert binary
|
||||
|
||||
print(ubinascii.hexlify(sigfox.mac()))
|
||||
```
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### sigfox.frequencies()
|
||||
|
||||
@@ -261,7 +261,7 @@ To communicate between two Sigfox capable devices, it may be used in FSK mode. T
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Sigfox.FSK mode is not supported on LoPy 4 and FiPy.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
**Device 1**:
|
||||
|
||||
@@ -295,5 +295,5 @@ while True:
|
||||
|
||||
{{% hint style="danger" %}}
|
||||
Remember to use the correct frequency for your region (868 MHz for Europe, 912 MHz for USA, etc.)
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ Create a WLAN object, and optionally configure it. See [`init`](../wlan.md#wlan-
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The WLAN constructor is special in the sense that if no arguments besides the `id` are given, it will return the already existing WLAN instance without re-configuring it. This is because WLAN is a system feature of the WiPy. If the already existing instance is not initialised it will do the same as the other constructors an will initialise it with default values.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -93,7 +93,7 @@ To use an external antenna, set `P12 as output pin.`
|
||||
|
||||
Pin('P12', mode=Pin.OUT)(True)
|
||||
```
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### wlan.deinit()
|
||||
|
||||
@@ -115,7 +115,7 @@ Connect to a wifi access point using the given SSID, and other security paramete
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The ESP32 only handles certificates with `pkcs8` format (but not the "Traditional SSLeay RSAPrivateKey" format). The private key should be RSA coded with 2048 bits at maximum.
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### wlan.scan()
|
||||
|
||||
@@ -171,7 +171,7 @@ To use an external antenna, set `P12 as output pin.`
|
||||
|
||||
Pin('P12', mode=Pin.OUT)(True)
|
||||
```
|
||||
{{< /hint >}}
|
||||
{{% /hint %}}
|
||||
|
||||
#### wlan.mac()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user