Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions notecard/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,15 @@ def locationTrack(card, file=None, heartbeat=None, hours=None, payload=None, sta


@validate_card_object
def monitor(card, count=None, mode=None, usb=None):
def monitor(card, count=None, mode=None, off=None, on=None, usb=None):
"""When a Notecard is in monitor mode, this API is used to configure the general-purpose `AUX1`-`AUX4` pins to test and monitor Notecard activity.

Args:
card (Notecard): The current Notecard object.
count (int): The number of pulses to send to the overridden AUX pin LED. Set this value to `0` to return the LED to its default behavior.
count (int): The number of pulses to send to the overridden AUX pin LED. To return the LED to its default behavior, use `"off": true` along with the `mode` of the LED.
mode (str): Can be set to one of `green`, `red` or `yellow` to temporarily override the behavior of an AUX pin LED. See Using Monitor Mode for additional details.
off (bool): Set to `true`, along with a `mode`, to clear an override and return that AUX pin LED to its default behavior.
on (bool): Set to `true`, along with a `mode`, to turn that AUX pin LED on continuously.
usb (bool): Set to `true` to configure LED behavior so that it is only active when the Notecard is connected to USB power.

Returns:
Expand All @@ -450,6 +452,10 @@ def monitor(card, count=None, mode=None, usb=None):
req["count"] = count
if mode:
req["mode"] = mode
if off is not None:
req["off"] = off
if on is not None:
req["on"] = on
if usb is not None:
req["usb"] = usb
return card.Transaction(req)
Expand Down
2 changes: 1 addition & 1 deletion notecard/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def set(card, align=None, details=None, duration=None, host=None, inbound=None,

Args:
card (Notecard): The current Notecard object.
align (bool): Use `true` to align syncs on a regular time-periodic cycle. The cycle is anchored to the Notecard's boot time, not to a wall-clock time.
align (bool): Use `true` to align syncs on a regular time-periodic cycle. The cycle is anchored to the moment the Notecard first obtained valid time after booting, not to a wall-clock time.
details (str): When using Notecard LoRa you can use this argument to provide information about an alternative LoRaWAN server or service you would like the Notecard to use. The argument you provide must be a JSON object with three keys, "deveui", "appeui", and "appkey", all of which are hexadecimal strings with no leading 0x. For example: `{"deveui":"0080E11500088B37","appeui":"6E6F746563617264","appkey":"00088B37"}` The LoRaWAN details you send to a Notecard become part of its permanent configuration, and survive factory resets. You can reset a Notecard's LoRaWAN details to its default values by providing a `"-"` for the details argument.
duration (int): When in `continuous` mode, the amount of time, in minutes, of each session (the minimum allowed value is `15`). When this time elapses, the Notecard gracefully ends the current session and starts a new one in order to sync session-specific data to Notehub.
host (str): The URL of the Notehub service. Use `"-"` to reset to the default value.
Expand Down
4 changes: 2 additions & 2 deletions notecard/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def add(card, binary=None, body=None, file=None, full=None, key=None, limit=None
body (dict): A JSON object to be enqueued. A Note must have either a `body` or a `payload`, and can have both.
file (str): The name of the Notefile. On Notecard LoRa this argument is required. On all other Notecards this field is optional and defaults to `data.qo` if not provided. When using this request on the Notecard the Notefile name must end in one of: `.qo` for a queue outgoing (Notecard to Notehub) with plaintext transport `.qos` for a queue outgoing with encrypted transport `.db` for a bidirectionally synchronized database with plaintext transport `.dbs` for a bidirectionally synchronized database with encrypted transport `.dbx` for a local-only database
full (bool): If set to `true`, and the Note is using a Notefile Template, the Note will bypass usage of omitempty and retain `null`, `0`, `false`, and empty string `""` values.
key (str): The name of an environment variable in your Notehub.io project that contains the contents of a public key. Used when encrypting the Note body for transport.
key (str): The name of an environment variable in your Notehub project that contains the contents of a public key. Used when encrypting the Note body for transport. Note body encryption is not supported on Notecard for LoRa.
limit (bool): If set to `true`, the Note will not be created if Notecard is in a penalty box.
live (bool): If `true`, bypasses saving the Note to flash on the Notecard. Required to be set to `true` if also using `"binary":true`.
max (int): Defines the maximum number of queued Notes permitted in the specified Notefile (`"file"`). Any Notes added after this value will be rejected. When used with `"sync":true`, a sync will be triggered when the number of pending Notes matches the `max` value.
Expand Down Expand Up @@ -129,7 +129,7 @@ def get(card, decrypt=None, delete=None, deleted=None, file=None, note=None):

Args:
card (Notecard): The current Notecard object.
decrypt (bool): `true` to decrypt encrypted inbound Notefiles.
decrypt (bool): `true` to decrypt encrypted inbound Notefiles. Notefile decryption is not supported on Notecard for LoRa.
delete (bool): `true` to delete the Note after retrieving it.
deleted (bool): `true` to allow retrieval of a deleted Note.
file (str): The Notefile name must end in `.qi` (for plaintext transport), `.qis` (for encrypted transport), `.db` or `.dbx` (for local-only DB Notefiles).
Expand Down
2 changes: 1 addition & 1 deletion notecard/ntn.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def config(card):

@validate_card_object
def gps(card, off=None, on=None):
"""On a Notecard paired with a Starnote, this controls whether the Starnote uses a location known to the paired Notecard instead of acquiring one with its own GPS/GNSS module. It does not, by default. On Notecard for Skylo, the satellite radio and the GPS/GNSS are part of the same module. This request controls whether the Notecard uses a known location (typically a fixed location set with `card.location.mode`), instead of acquiring a new location for NTN use.
"""On a Notecard paired with a Starnote, this controls whether the Notecard supplies a location it already knows to the Starnote for satellite use. It does not, by default. On Notecard for Skylo, the satellite radio and the GPS/GNSS are part of the same module. This request controls whether the Notecard uses a known location (typically a fixed location set with `card.location.mode`), instead of acquiring a new location for NTN use.

Args:
card (Notecard): The current Notecard object.
Expand Down