From 1113dba9ebc6a5d19139d9f438e04fc0ee104d0f Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 7 Aug 2020 13:17:33 +0200 Subject: [PATCH] fixed pybytes section --- content/advance/frozen.md | 2 +- content/tutorials/networks/sigfox.md | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/content/advance/frozen.md b/content/advance/frozen.md index 7dd10e7..317a834 100644 --- a/content/advance/frozen.md +++ b/content/advance/frozen.md @@ -5,7 +5,7 @@ In this section, we discuss the usage of so called `Frozen` code. This is only u What we call `Frozen` code, relates to a principle in MicroPython where you can include specific codeblocks or python module inside the firmware, such that you do not have to manually upload them. This can be very useful if you have a specific section of code you want to include on all your devices, without manually uploading it every time and risk losing it when formatting the file system. -## How To use the Frozen section (Without Pybytes) +## How To use the Frozen section 1. Download the (latest) source code from our [Github Repository](https://github.com/pycom/pycom-micropython-sigfox) and extract the archive, or use the GitHub desktop tool. If you have never build firmware from the sourcecode before, you can find the setup guide on GitHub as well. 2. Inside the folder `pycom-micropython-sigfox/esp32/frozen` you will find the `frozen` section. We already have frozen some of the python modules into the firmware, such as `sqnsupgrade.py` and `OTA.py`. diff --git a/content/tutorials/networks/sigfox.md b/content/tutorials/networks/sigfox.md index 49dc93c..1f5de53 100644 --- a/content/tutorials/networks/sigfox.md +++ b/content/tutorials/networks/sigfox.md @@ -13,26 +13,25 @@ The following tutorials demonstrate how to register and get started with the SiP ```python from network import Sigfox import socket -​ + # init Sigfox for RCZ1 (Europe) sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) -​ + # create a Sigfox socket s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) -​ + # make the socket blocking s.setblocking(True) -​ + # configure it as uplink only s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) -​ + # send some bytes 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 %}} +> 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. + ## Disengage Sequence Number