mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 08:06:34 +01:00
GitBook: [master] 334 pages and 4 assets modified
This commit is contained in:
committed by
gitbook-bot
parent
1694c83fcd
commit
260e81c8e8
@@ -1,16 +0,0 @@
|
||||
# Hardware Setup
|
||||
|
||||
This chapter of the documentation will show you how to connect you Pycom module. For each device there are detailed instructions on how to connect your module to one of our base boards, a USB UART adapter or WiFi as well as what antennas you might need to connect. Please select your module below to be taken to the appropriate guide.
|
||||
|
||||
{% page-ref page="lopy.md" %}
|
||||
|
||||
{% page-ref page="lopy4.md" %}
|
||||
|
||||
{% page-ref page="sipy.md" %}
|
||||
|
||||
{% page-ref page="gpy.md" %}
|
||||
|
||||
{% page-ref page="fipy.md" %}
|
||||
|
||||
{% page-ref page="wipy.md" %}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
# FiPy
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* When using the expansion board with a FiPy, you will need to remove the CTS and RTS jumpers as these interfere with communication with the cellular modem.
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the FiPy module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* When using the expansion board with a FiPy, you will need to remove the CTS and RTS jumpers as these interfere with communication with the cellular modem.
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the FiPy module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the FiPy module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your FiPy. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do **not** feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the FiPy respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the FiPy into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the FiPy via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the FiPy:
|
||||
|
||||

|
||||
|
||||
* By default, when the FiPy boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID: `fipy-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the FiPy. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### Lora/Sigfox
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the LoRa/Sigfox connectivity of the FiPy you **must** connect a LoRa/Sigfox antenna to your FiPy before trying to use LoRa/Sigfox otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
{% hint style="info" %}
|
||||
The FiPy only supports LoRa on the 868MHz or 915MHz bands. It does not support 433MHz. For this you will require a LoPy4.
|
||||
{% endhint %}
|
||||
|
||||
* Firstly you will need to connect the U.FL to SMA pig tail to the FiPy using the U.FL connector on the same side of the FiPy as the LED.
|
||||
|
||||

|
||||
|
||||
* If you are using a pycase, you will next need to put the SMA connector through the antenna hole, ensuring you align the flat edge correctly, and screw down the connector using the provided nut.
|
||||
* Finally you will need to screw on the antenna to the SMA connector.
|
||||
|
||||

|
||||
|
||||
### LTE Cat-M1/NB-IoT
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the LTE CAT-M1 or NB-IoT connectivity of the FiPy you **must** connect a LTE CAT-M1/NB-IoT antenna to your FiPy before trying to use LTE Cat-M1 or NB-IoT otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
* You will need to connect the antenna to the FiPy using the U.FL connector on the under side of the FiPy.
|
||||
|
||||

|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the FiPy, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the FiPy in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
### SIM card {#sim-card}
|
||||
|
||||
If you intend on using the LTE CAT-M1 or NB-IoT connectivity of the FiPy you will need to insert a SIM card into your FiPy. It should be noted that the FiPy does not support regular LTE connectivity and you may require a special SIM. It is best to contact your local cellular providers for more information on acquiring a LTE CAT-M1/NB-IoT enabled nano SIM.
|
||||
|
||||

|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
# GPy
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the GPy module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the GPy module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the GPy module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your GPy. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do **not** feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the GPy respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the GPy into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the GPy via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the GPy:
|
||||
|
||||

|
||||
|
||||
* By default, when the GPy boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID:`gpy-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the GPy. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### LTE Cat-M1/NB-IoT
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the LTE CAT-M1 or NB-IoT connectivity of the GPy you **must** connect a LTE CAT-M1/NB-IoT antenna to your GPy before trying to use LTE Cat-M1 or NB-IoT otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
* You will need to connect the antenna to the GPy using the U.FL connector on the same side of the GPy as the LED.
|
||||
|
||||

|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the GPy, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the GPy in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
### SIM card {#sim-card}
|
||||
|
||||
If you intend on using the LTE CAT-M1 or NB-IoT connectivity of the GPy you will need to insert a SIM card into your GPy. It should be noted that the GPy does not support regular LTE connectivity and you may require a special SIM. It is best to contact your local cellular providers for more information on acquiring a LTE CAT-M1/NB-IoT enabled nano SIM.
|
||||
|
||||

|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
# LoPy
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the LoPy module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the LoPy module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the LoPy module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your LoPy. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do _not_ feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the LoPy respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the LoPy into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the LoPy via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the LoPy:
|
||||
|
||||

|
||||
|
||||
* By default, when the LoPy boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID: `lopy-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the LoPy. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### Lora
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the LoRa connectivity of the LoPy you **must** connect a LoRa antenna to your LoPy before trying to use LoRa otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
{% hint style="danger" %}
|
||||
The LoPy only supports LoRa on the 868MHz or 915MHz bands. It does not support 433MHz. For this you will require a LoPy4.
|
||||
{% endhint %}
|
||||
|
||||
* Firstly you will need to connect the U.FL to SMA pig tail to the LoPy using the U.FL connector on the same side of the LoPy as the LED.
|
||||
|
||||

|
||||
|
||||
* If you are using a pycase, you will next need to put the SMA connector through the antenna hole, ensuring you align the flat edge correctly, and screw down the connector using the provided nut.
|
||||
* Finally you will need to screw on the antenna to the SMA connector.
|
||||
|
||||

|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the LoPy, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the LoPy in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
## Deep Sleep current issue
|
||||
|
||||
The LoPy, SiPy, and WiPy 2.0 experience an issue where the modules maintain a high current consumption in deep sleep mode. This issue has been resolved in all newer products. The cause for this issue is the DC to DC switch mode converter remains in a high performance mode even when the device is in deep sleep. The flash memory chip also does not power down. A more detailed explanation can be found [here.](https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current)
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
# LoPy 4
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the LoPy4 module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the LoPy4 module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the LoPy4 module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your LoPy4. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do **not** feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the LoPy4 respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the LoPy4 into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the LoPy4 via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the LoPy4:
|
||||
|
||||

|
||||
|
||||
* By default, when the LoPy4 boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID: `lopy4-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the LoPy4. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### Lora/Sigfox
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the LoRa/Sigfox connectivity of the LoPy4 you **must** connect a LoRa/Sigfox antenna to your LoPy4 before trying to use LoRa/Sigfox otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
* Firstly you will need to connect the U.FL to SMA pig tail to the LoPy4 using one of the two the U.FL connectors on the same side of the LoPy4 as the LED. The one on the left hand side is for 433MHz \(LoRa only\), the one of the right hand side is for 868MHz/915MHz \(LoRa & Sigfox\). **Note:** This is different from the LoPy.
|
||||
|
||||

|
||||
|
||||
* If you are using a pycase, you will next need to put the SMA connector through the antenna hole, ensuring you align the flat edge correctly, and screw down the connector using the provided nut.
|
||||
* Finally you will need to screw on the antenna to the SMA connector.
|
||||
|
||||

|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the LoPy4, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the LoPy4 in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
# SiPy
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the SiPy module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the SiPy module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the SiPy module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your SiPy. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do **not** feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the SiPy respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the SiPy into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the SiPy via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the SiPy:
|
||||
|
||||

|
||||
|
||||
* By default, when the SiPy boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID: `sipy-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the SiPy. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### Sigfox
|
||||
|
||||
{% hint style="danger" %}
|
||||
If you intend on using the Sigfox connectivity of the SiPy you **must** connect a Sigfox antenna to your SiPy before trying to use Sigfox otherwise you risk damaging the device.
|
||||
{% endhint %}
|
||||
|
||||
* Firstly you will need to connect the U.FL to SMA pig tail to the SiPy using the U.FL connector on the same side of the SiPy as the LED.
|
||||
|
||||

|
||||
|
||||
* If you are using a pycase, you will next need to put the SMA connector through the antenna hole, ensuring you align the flat edge correctly, and screw down the connector using the provided nut.
|
||||
* Finally you will need to screw on the antenna to the SMA connector.
|
||||
|
||||

|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the FiPy, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the FiPy in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
## Deep Sleep current issue
|
||||
|
||||
The LoPy, SiPy, and WiPy 2.0 experience an issue where the modules maintain a high current consumption in deep sleep mode. This issue has been resolved in all newer products. The cause for this issue is the DC to DC switch mode converter remains in a high performance mode even when the device is in deep sleep. The flash memory chip also does not power down. A more detailed explanation can be found [here.](https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current)
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
# WiPy
|
||||
|
||||
## Basic connection
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Exp Board 2.0" %}
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the WiPy module on the the expansion board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Exp Board 3.0" %}
|
||||
* Before connecting your module to an Expansion Board 3.0, you should update the firmware on the Expansion Board 3.0. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the expansion board.
|
||||
* Insert the WiPy module on the Expansion Board with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Pytrack/Pysense/Pyscan" %}
|
||||
* Before connecting your module to a Pysense/Pytrack/Pyscan board, you should update the firmware on the Pysense/Pytrack/Pyscan. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
* Look for the reset button on the WiPy module \(located at a corner of the board, next to the LED\).
|
||||
* Locate the USB connector on the Pysense/Pytrack/Pyscan.
|
||||
* Insert the module on the Pysense/Pytrack/Pyscan with the reset button pointing towards the USB connector. It should firmly click into place and the pins should now no longer be visible. 
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="USB UART Adapter" %}
|
||||
* Firstly you will need to connect power to your WiPy. You will need to supply `3.5v`-`5.5v` to the `Vin` pin.
|
||||
|
||||
{% hint style="danger" %}
|
||||
Do **not** feed `3.3v` directly to the `3.3v` supply pin, this will damage the regulator.
|
||||
{% endhint %}
|
||||
|
||||
* The connect the `RX` and `TX` of your USB UART to the `TX` and `RX` of the WiPy respectively.
|
||||
|
||||
{% hint style="warning" %}
|
||||
Please ensure you have the signal level of the UART adapter set to `3.3v` before connecting it.
|
||||
{% endhint %}
|
||||
|
||||
* In order to put the WiPy into bootloader mode to update the device firmware you will need to connect `P2` to `GND`. We recommend you connect a button between the two to make this simpler.
|
||||
|
||||

|
||||
{% endtab %}
|
||||
|
||||
{% tab title="WiFi" %}
|
||||
**Note:** This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection.
|
||||
|
||||
* In order to access the WiPy via WiFi you only need to provide `3.5v` - `5.5v` on the `Vin` pin of the WiPy:
|
||||
|
||||

|
||||
|
||||
* By default, when the WiPy boots, it will create a WiFi access point with the following credentials:
|
||||
* SSID: `wipy-wlan`
|
||||
* password: `www.pycom.io`
|
||||
* Once connected to this network you will be able to access the telnet and FTP servers running on the WiPy. For both of these the login details are:
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
## Antennas
|
||||
|
||||
### WiFi/Bluetooth \(optional\)
|
||||
|
||||
All Pycom modules, including the WiPy, come with a on-board WiFi antenna as well as a U.FL connector for an external antenna. The external antenna is optional and only required if you need better performance or are mounting the WiPy in such a way that the WiFi signal is blocked. Switching between the antennas is done via software, instructions for this can be found [here.](../../firmwareapi/pycom/network/wlan.md)
|
||||
|
||||

|
||||
|
||||
## Deep Sleep current issue
|
||||
|
||||
The LoPy, SiPy, and WiPy 2.0 experience an issue where the modules maintain a high current consumption in deep sleep mode. This issue has been resolved in all newer products. The cause for this issue is the DC to DC switch mode converter remains in a high performance mode even when the device is in deep sleep. The flash memory chip also does not power down. A more detailed explanation can be found [here.](https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current)
|
||||
|
||||
## WiPy 2.0 vs WiPy 3.0
|
||||
|
||||
The WiPy 3.0 is an upgraded version of the WiPy 2.0 with the following changes:
|
||||
|
||||
* The FLASH has been upgraded from 4MB to 8MB.
|
||||
* The RAM has been upgraded from 512KB to 4MB.
|
||||
* The deepsleep current consumption issue has been fixed
|
||||
* The antenna select pin has moved to GPIO21 \(P12\)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# Software
|
||||
|
||||
To get you up and running, Pycom provides a suite of tools to assist with developing and programming your Pycom Devices:
|
||||
|
||||
1. [**Drivers:**](drivers.md) If you are using Microsoft Windows, you might be required to install drivers for our products to function correctly.
|
||||
2. [**Pycom firmware update utility:**](firmwaretool.md) This tool automates the process of upgrading the firmware of your Pycom device. It is important that you use this tool before you attempt to use your device. Not only to ensure you have the most stable and feature packed firmware, but also to ensure all the functionality of your device is enable. E.g. this tool also activates your two year free sigfox connectivity.
|
||||
3. [**Development Environment:**](pymakr.md) Pymakr is a plug-in for Atom and Visual Studio Code developed by Pycom to make development for Pycom modules super easy. It allows you to use your favourite text editor while simplifying the process of uploading code to the device.
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Drivers
|
||||
|
||||
## Linux
|
||||
|
||||
You should not need to install any drivers for our devices to be recognised by Linux. You may how ever need to adjust permissions to make sure you have access to the serial port. On most distributions this can be done by adding your user to the `dialout` user group. Please check the specific instructions for your linux distribution for how to do this.
|
||||
|
||||
## macOS
|
||||
|
||||
On macOS you shouldn't need to do anything special to get our device to work.
|
||||
|
||||
## Windows
|
||||
|
||||
All our products will work out of the box for Windows 8/10/+. If using Windows 7, drivers to support the Pysense/Pytrack/Pyscan/Expansion Board 3.0 boards will need to be installed.
|
||||
|
||||
### Download
|
||||
|
||||
Please download the driver software from the link below.
|
||||
|
||||
[Pysense/Pytrack/Pyscan/Expansion Board 3.0 Serial Driver (save the file to your computer)](https://raw.githubusercontent.com/pycom/pycom-documentation/master/pytrackpysense/installation/pycom.inf)
|
||||
|
||||
### Installation
|
||||
|
||||
First navigate open the Windows start menu and search/navigate to \`Device Manager. You should see your Pytrack/Pysense in the dropdown under **other devices**.
|
||||
|
||||

|
||||
|
||||
Right click the device and select `Update Driver Software`.
|
||||
|
||||

|
||||
|
||||
Select the option to **Browse my computer for driver software**.
|
||||
|
||||

|
||||
|
||||
Next you will need to navigate to where you downloaded the driver to \(e.g. **Downloads** Folder\).
|
||||
|
||||

|
||||
|
||||
Specify the folder in which the drivers are contained. If you haven't extracted the `.zip` file, please do this before selecting the folder.
|
||||
|
||||

|
||||
|
||||
You may receive a warning, suggesting that Windows can't verify the publisher of this driver. Click `Install this driver software anyway` as this link points to our official driver.
|
||||
|
||||

|
||||
|
||||
If the installation was successful, you should now see a window specifying that the driver was correctly installed.
|
||||
|
||||

|
||||
|
||||
To confirm that the installation was correct, navigate back to the `Device Manager` and click the dropdown for other devices. The warning label should now be gone and Pytrack/Pysense should be installed.
|
||||
|
||||

|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# Updating Firmware
|
||||
|
||||
We strongly recommend you to upgrade your firmware to the latest version as we are constantly making improvements and adding new features to the devices.
|
||||
|
||||
Here are the download links to the update tool. Please download the appropriate one for your OS and follow the instructions on the screen.
|
||||
|
||||
* [Windows](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=win32&redirect=true)
|
||||
* [macOS](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=macos&redirect=true) \(10.11 or Higher\)
|
||||
* [Linux](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=unix&redirect=true) \(requires `dialog` and `python-serial` package\)
|
||||
|
||||
{% hint style="info" %}
|
||||
Previous versions of firmware are available for download [**here**](../../advance/downgrade.md).
|
||||
{% endhint %}
|
||||
|
||||
## Updating Device Firmware
|
||||
|
||||
The basic firmware upgrade procedure can be found below, please follow these steps carefully:
|
||||
|
||||
After you’re done with upgrading, you can use the Pymakr Plugins to upload and run programs in your device.
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Expansion Board 2.0" %}
|
||||
1. Disconnect your device from your computer
|
||||
2. Insert module into the Expansion Board
|
||||
3. Connect a jumper cable or wire between `G23` and `GND`
|
||||
4. Reconnect the board via USB to your computer, this puts the device in ‘firmware update mode’.
|
||||
5. Run the Firmware Upgrade tool
|
||||
|
||||

|
||||
|
||||
6. Remove the `G23` to `GND` jumper cable/wire
|
||||
|
||||
7. Reboot the device \(button or power off then on\), your device is now ready to use
|
||||
|
||||
If you are having any issues, make sure the **TX and RX jumpers** are present on your Expansion Board, as the jumpers sometimes come loose in the box during transport. Without these jumpers, the updater will fail.
|
||||
{% endtab %}
|
||||
|
||||
{% tab title=" Pysense/Pytrack/Pyscan/Expansion Board 3.0" %}
|
||||
{% hint style="info" %}
|
||||
When using a Pysense/Pytrack/Pyscan/Expansion Board 3.0 to update your module you are not required to make a connection between `G23` and `GND`, the Pysense/Pytrack/Pyscan/Expansion Board 3.0 will do this automatically.
|
||||
{% endhint %}
|
||||
|
||||
1. Before connecting your module to a Pysense/Pytrack board, you should update the firmware on the Pysense/Pytrack. Instructions on how to do this can be found [here](../../pytrackpysense/installation/firmware.md).
|
||||
2. Disconnect your device from your computer
|
||||
3. Insert module into Expansion Board
|
||||
4. Reconnect the board via USB to your computer
|
||||
5. Run the Firmware Upgrade tool
|
||||
|
||||

|
||||
|
||||
6. Disconnect the USB cable from the board and reconnect it, your device is now ready to use
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
After you’re done with upgrading, you can use the Pymakr Plugins to upload and run programs in your device.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# Pymakr
|
||||
|
||||

|
||||
|
||||
## Pymakr Plugins {#pymakr-plugins}
|
||||
|
||||
To make it as easy as possible Pycom has developed a plugin for two popular text editors, called Pymakr. These plugins have been built and are available for the following platforms:
|
||||
|
||||
{% page-ref page="../../pymakr/installation/atom.md" %}
|
||||
|
||||
{% page-ref page="../../pymakr/installation/vscode.md" %}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
So, you've decided to order a Pycom development module. Firstly we would like to congratulate you in making an excellent decision. If you haven't yet placed your order we highly recommend you check out the [products](../products.md) page before you place your order to ensure you know which accessories you might require.
|
||||
|
||||

|
||||
|
||||
## [Step 1: Setting up the hardware](connection/)
|
||||
|
||||
In the first part of this getting started guide, we will take you through setting up your device. Firstly we will cover how to connect the module to your computer either via USB or WiFi. Secondly we will explain how to connect various accessories such as antennas or SIM cards to your module.
|
||||
|
||||
## [Step 2: Setting up your computer](installation/)
|
||||
|
||||
Now that your module is successfully connected, you will need to install some software on your computer to interface with it. The second part of this guide will guide you through installing drivers; performing firmware updates for your module/accessories to ensure you have the most stable and feature packed version; and how to setup the software use to program the device.
|
||||
|
||||
## [Step 3: Using your module](programming/)
|
||||
|
||||
Now that you have a connected module and all the required software installed it is time to begin programming your device. This part of the guide will get you started with a basic example and point you in the right direction for getting your device connected to your chosen network.
|
||||
|
||||
## [Step 4: Connecting to a network](registration/)
|
||||
|
||||
Now that you familiar with programming your device you will no doubt be keen to get it connected to one of the advertised wireless networks. This usually requires some registration. This step will detail how to get registered and connected to various wireless networks.
|
||||
|
||||
{% hint style="info" %}
|
||||
You can navigate through this guide using the arrow buttons at the bottom of the page.
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Programming the modules
|
||||
|
||||
Now that you have connected and updated your pycom module and installed all the required software on your computer, we can begin programming your Pycom module.
|
||||
|
||||
If this is your first time using a Pycom module we highly recommend you read through the following pages:
|
||||
|
||||
* [**Introduction to MicroPython:**](micropython.md) This page will explain what Micropython is and its relation to Python.
|
||||
* [**MicroPython Examples:**](examples.md) We also recommend you browse these short MicroPython examples to familiarise yourself with its syntax. This is not meant as a comprehensive guide to MicroPython programming but rather a reference to those who already know programming. If you are new to python, or programming all together, we highly recommend searching the internet for Python tutorials. There are many very good tutorials available for free and the skills you learn will be easily transferable to our platform.
|
||||
* [**Your first Pymakr project:**](first-project.md) Once you understand what MicroPython is, this guide will take you through setting up your first Pymakr project to blink the on-board RGB LED. This guide will explain the structure of a MicroPython project as well as how to upload it to your module.
|
||||
|
||||
Once you are familiar with MicroPython and Pymakr, the recommended way of uploading code to your module, you can explore the pages below. These will discuss in greater detail the various mechanisms for running code on your device as well as how to recover it if something goes wrong.
|
||||
|
||||
* [**REPL:**](repl/) The REPL \(Read Evaluate Print Loop\) is an interactive terminal that allows you to type in and test your code directly on the device, just like interactive python interpreter. It can be accessed via [UART](repl/serial.md) or [Telnet](repl/telnet.md). This is accessed easiest by using Pymakr but if you wish to use other tools, this page will explain how.
|
||||
* [**FTP:**](ftp.md) All Pycom modules start up with a WiFi access point enabled, and a simple FTP server running on it. Once connected to the WiFi network, you can use FTP to transfer files over to your device wirelessly. This can be very useful if you do not have physical access to your device.
|
||||
* [**Safe Boot:**](safeboot.md) It is possible that some code you upload to your module will prevent you accessing the REPL or FTP server, preventing you from updating your scripts. This guide will detail how to safe boot your module and how to remove the offending scripts from it.
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
# MicroPython Examples
|
||||
|
||||
To get you started with Python \(MicroPython\) syntax, we've provided you with a number of code examples.
|
||||
|
||||
## Variable Assignment
|
||||
|
||||
As with Python 3.5, variables can be assigned to and referenced. Below is an example of setting a variable equal to a string and then printing it to the console.
|
||||
|
||||
```python
|
||||
variable = "Hello World"
|
||||
print(variable)
|
||||
```
|
||||
|
||||
## Conditional Statements
|
||||
|
||||
Conditional statements allow control over which elements of code run depending on specific cases. The example below shows how a temperature sensor might be implemented in code.
|
||||
|
||||
```python
|
||||
temperature = 15
|
||||
target = 10
|
||||
if temperature > target:
|
||||
print("Too High!")
|
||||
elif temperature < target:
|
||||
print("Too Low!")
|
||||
else:
|
||||
print("Just right!")
|
||||
```
|
||||
|
||||
## Loops \(For & While loop\)
|
||||
|
||||
Loops are another important feature of any programming language. This allows you to cycle your code and repeat functions/assignments/etc.
|
||||
|
||||
`for` loops allow you to control how many times a block of code runs for within a range.
|
||||
|
||||
```python
|
||||
x = 0
|
||||
for y in range(0, 9):
|
||||
x += 1
|
||||
print(x)
|
||||
```
|
||||
|
||||
`while` loops are similar to `for` loops, however they allow you to run a loop until a specific conditional is `true/false`. In this case, the loop checks if `x` is less than `9` each time the loop passes.
|
||||
|
||||
```python
|
||||
x = 0
|
||||
while x < 9:
|
||||
x += 1
|
||||
print(x)
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
Functions are blocks of code that are referred to by name. Data can be passed into it to be operated on \(i.e. the parameters\) and can optionally return data \(the return value\). All data that is passed to a function is explicitly passed.
|
||||
|
||||
The function below takes two numbers and adds them together, outputting the result.
|
||||
|
||||
```python
|
||||
def add(number1, number2):
|
||||
return number1 + number2
|
||||
|
||||
add(1, 2) # expect a result of 3
|
||||
```
|
||||
|
||||
The next function takes an input name and returns a string containing a welcome phrase.
|
||||
|
||||
```python
|
||||
def welcome(name):
|
||||
welcome_phrase = "Hello, " + name + "!"
|
||||
print(welcome_phrase)
|
||||
|
||||
welcome("Alex") # expect "Hello, Alex!"
|
||||
```
|
||||
|
||||
## Data Structures
|
||||
|
||||
Python has a number of different data structures for storing and manipulating variables. The main difference \(regarding data structures\) between C and Python is that Python manages memory for you. This means there’s no need to declare the sizes of lists, dictionaries, strings, etc.
|
||||
|
||||
### Lists
|
||||
|
||||
A data structure that holds an ordered collection \(sequence\) of items.
|
||||
|
||||
```python
|
||||
networks = ['lora', 'sigfox', 'wifi', 'bluetooth', 'lte-m']
|
||||
print(networks[2]) # expect 'wifi'
|
||||
```
|
||||
|
||||
### Dictionaries
|
||||
|
||||
A dictionary is like an address-book where you can find the address or contact details of a person by knowing only his/her name, i.e. keys \(names\) are associate with values \(details\).
|
||||
|
||||
```python
|
||||
address_book = {'Alex':'2604 Crosswind Drive','Joe':'1301 Hillview Drive','Chris':'3236 Goldleaf Lane'}
|
||||
print(address_book['Alex']) # expect '2604 Crosswind Drive'
|
||||
```
|
||||
|
||||
### Tuple
|
||||
|
||||
Similar to lists but are immutable, i.e. you cannot modify tuples after instantiation.
|
||||
|
||||
```python
|
||||
pycom_devices = ('wipy', 'lopy', 'sipy', 'gpy', 'fipy')
|
||||
print(pycom_devices[0]) # expect 'wipy'
|
||||
```
|
||||
|
||||
{% hint style="info" %}
|
||||
For more Python examples, check out these [tutorials](https://www.tutorialspoint.com/python3/). Be aware of the implementation differences between MicroPython and Python 3.5.
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
# Your first Pymakr project
|
||||
|
||||
This guide will take you through how to setup your first project with Pymakr and make the on-board RGB LED flash various colours.
|
||||
|
||||
## Creating a project in Pymakr
|
||||
|
||||
1. Firstly you will need to create a new, empty, directory on your computer.
|
||||
|
||||
For this example we will create one called `RGB-Blink`.
|
||||
|
||||
2. Next you will need to open either Atom or Visual Studio Code depending on
|
||||
|
||||
which you setup previously.
|
||||
|
||||
3. Once the text editor has loaded you will need to click `File` > `Open`, and open the directory you created in step 1
|
||||
|
||||
{% hint style="info" %}
|
||||
If you are using Atom, it is important to check at this point that Atom has successfully identified the project. The name of the directory you created in step 1 \(`RGB-Blink` in this case\) should be shown in the Pymakr pane like so:
|
||||
|
||||

|
||||
|
||||
If this is not the case you can press `alt-ctrl-r` on Windows/Linux or `ctrl-alt-cmd-l` on macOS, in order to reload Atom and fix the issue.
|
||||
{% endhint %}
|
||||
|
||||
4. Now that you have a project created, we need to add some files to it. A standard MicroPython project has the following structure:
|
||||
|
||||
```text
|
||||
RGB-Blink
|
||||
|-lib
|
||||
| |- some_library.py
|
||||
|-boot.py
|
||||
|-main.py
|
||||
```
|
||||
|
||||
* `boot.py` This is the first script that runs on your module when it
|
||||
|
||||
turns on. This is often used to connect a module a a WiFi network so that
|
||||
|
||||
Telnet and FTP can be used without connecting to the WiFi AP created by the
|
||||
|
||||
module and not cluttering up the `main.py` file. As a beginner you do not
|
||||
|
||||
need to use a `boot.py`.
|
||||
|
||||
* `main.py` This script runs directly after `boot.py` and should contain
|
||||
|
||||
the main code you wish to run on your device.
|
||||
|
||||
* `lib` It is often a good idea to split out re-usable code into libraries.
|
||||
|
||||
If you want to create or use libraries created by others, you will need to
|
||||
|
||||
create a `lib` directory and put the library files in this. It is important
|
||||
|
||||
that you put `.py` files directly into `lib` rather than creating a directory
|
||||
|
||||
tree. By default MicroPython will not detect any libraries within
|
||||
|
||||
sub-directories.
|
||||
|
||||
For this example, you will just need to create a `main.py` file.
|
||||
|
||||
Now that the project structure is setup, you may wish to configure project specific settings for Pymakr e.g. Which serial port to use. On Atom you need to click the `^` button on the Pymakr pane, then click `Project Settings`. On Visual Studio Code you need to click the `All commands` button on the bottom of the windows, then click `Pymakr > Project Settings`. This creates a file called `pymakr.conf` inside your project and populates it with default settings copied over from your global settings. A detailed explanation of these settings can be found [here](../../pymakr/settings.md).
|
||||
|
||||
## Controlling the on-board LED
|
||||
|
||||
Now that you have setup and configured your project, we can move on to programming your module. The first thing we will need to do is import some libraries in order to interact with the on-board LED. The Pycom firmware comes with a large amount of libraries for standard functionality built-in. You can find out more about these in the [API documentation](../../firmwareapi/introduction.md). For this example you will need to open the `main.py` file and add the following code:
|
||||
|
||||
```python
|
||||
import pycom
|
||||
import time
|
||||
```
|
||||
|
||||
This will import two libraries, `Pycom` which is responsible for Pycom specific features, such as the on-board LED and `time` which is a standard library used timing and delays.
|
||||
|
||||
You may have noticed that when you power up your Pycom module, the on-board LED blinks blue on a regular basis. This "heartbeat" is used as a way of know that your module has powered up and started correctly. Before we can change the colour of this LED we need to disable this heart beat. Below your imports you will need to add the following:
|
||||
|
||||
```python
|
||||
pycom.heartbeat(False)
|
||||
```
|
||||
|
||||
Now it's time to test your code. On the Pymakr pane/bottom of the window you will see a `run` button. \(If you haven't connected to your device yet, you will need to do that first\). When you click the run button, the code in the currently open file will be executed on the device, but it won't copy it to the device. After running this code, you should see that that on-board LED stops blinking blue.
|
||||
|
||||
Now that we can confirm the device is connected and Pymakr is able to run code on it, we can complete our script to blink the LED like so:
|
||||
|
||||
```python
|
||||
import pycom
|
||||
import time
|
||||
|
||||
pycom.heartbeat(False)
|
||||
|
||||
while True:
|
||||
pycom.rgbled(0xFF0000) # Red
|
||||
time.sleep(1)
|
||||
pycom.rgbled(0x00FF00) # Green
|
||||
time.sleep(1)
|
||||
pycom.rgbled(0x0000FF) # Blue
|
||||
time.sleep(1)
|
||||
```
|
||||
|
||||
Once you run the above script, it will run forever. You will notice this prevents you from accessing the interactive REPL on the device \(You cannot see the `>>>` prompt\). In order to stop the script, click onto the Pymakr terminal, and press `ctrl-c` on your keyboard. This should stop the script running and return you to the interactive REPL.
|
||||
|
||||
## Uploading to your module
|
||||
|
||||
In the previous section we got code running on on your Pycom module using the `run` feature of Pymakr. This is useful for quick testing but has a couple of drawbacks. Firstly the code does not remain on the device permanently. If you reboot the device, it will no longer be running your code. Secondly, it will only work if you are using libraries built into the firmware. If you need any extra libraries, these need to be copied to the device first. This is where the `upload` feature comes in. If instead of `run` you click `upload`, Pymakr will upload all the files in the project \(so long as their type is in the `sync_file_types` setting for your project\). These then persist on your device even between reboots, and allows you to use libraries from the `lib` folder in your project.
|
||||
|
||||
If you need to remove files from your device you have two options, either connect via FTP and manage your files that way or format the device's internal flash like so:
|
||||
|
||||
```python
|
||||
import os
|
||||
os.mkfs('/flash')
|
||||
```
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# FTP
|
||||
|
||||
There is a small internal file system accessible with each Pycom device, called `/flash`. This is stored within the external serial flash memory. If a microSD card is also connected and mounted, it will be available as well. When the device starts up, it will always boot from the `boot.py` located in the `/flash` file system.
|
||||
|
||||
The file system is accessible via the native FTP server running on each Pycom device. Open an FTP client and connect to:
|
||||
|
||||
* url: `ftp://192.168.4.1`
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
|
||||
See [network.server](../../firmwareapi/pycom/network/server.md) for information on how to change the defaults. The recommended clients are:
|
||||
|
||||
* macOS/Linux: default FTP client
|
||||
* Windows: Filezilla and FireFTP
|
||||
|
||||
For example, from a macOS/Linux terminal:
|
||||
|
||||
```bash
|
||||
$ ftp 192.168.4.1
|
||||
```
|
||||
|
||||
The FTP server doesn’t support active mode, only passive mode. Therefore, if using the native unix FTP client, immediately after logging in, run the following command:
|
||||
|
||||
```bash
|
||||
ftp> passive
|
||||
```
|
||||
|
||||
The FTP server only supports one connection at a time. If using other FTP clients, please check their documentation for how to limit the maximum allowed connections to one at a time.
|
||||
|
||||
## FileZilla
|
||||
|
||||
If using FileZilla, it's important to configure the settings correctly.
|
||||
|
||||
Do not use the quick connect button. Instead, open the site manager and create a new configuration. Within the `General` tab, ensure that encryption is set to: `Only use plain FTP (insecure)`.
|
||||
|
||||

|
||||
|
||||
In the `Transfer Settings` tab, limit the max number of connections to one. Other FTP clients may behave in a similar ways; visit their documentation for more specific information.
|
||||
|
||||

|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Introduction to MicroPython
|
||||
|
||||
Our boards work with [MicroPython](https://micropython.org/); a Python 3.5 implementation that is optimised to run on micro controllers. This allows for much faster and more simple development process than using C.
|
||||
|
||||

|
||||
|
||||
## Booting into MicroPython
|
||||
|
||||
When booting, two files are executed automatically: first `boot.py` and then `main.py`. These are placed in the `/flash` folder on the board. Any other files or libraries can be placed here as well, and can be included or used from `boot.py` or `main.py`.
|
||||
|
||||
The folder structure in `/flash` looks like the picture below. The files can be managed either using FTP or using the Pymakr Plugin.
|
||||
|
||||

|
||||
|
||||
## Tips & Tricks
|
||||
|
||||
Micropython shares majority of the same syntax as Python 3.5. The intention of this design is to provide compatibility upwards from Micropython to Python 3.5, meaning that code written for Micropython should work in a similar manner in Python 3.5. There are some minor variations and these should taken viewed as implementation differences.
|
||||
|
||||
Micropython also has a number of Micropython specific libraries for accessing hardware level features. Specifics relating to those libraries can be found in the Firmware API Reference section of this documentation.
|
||||
|
||||
{% hint style="info" %}
|
||||
Micropython, unlike C/C++ or Arduino, **does not use braces {} to indicate blocks of code** specified for class and function definitions or flow control. Blocks of code are denoted by line indentation, which is strictly enforced.
|
||||
|
||||
The number of spaces in the indentation is variable but all statements within a block must be indented the same amount.
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# REPL
|
||||
|
||||
REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython prompt that is accessible on the Pycom devices. Using the REPL is by far the easiest way to test out Python code and run commands. You can use the REPL in addition to writing scripts in `main.py`.
|
||||
|
||||
The following pages will explain how to use the REPL with both Serial USB and Telnet connections.
|
||||
|
||||
The REPL includes the following features:
|
||||
|
||||
* Input history: use arrow up and arrow down to scroll through the history
|
||||
* Tab completion: press tab to auto-complete variables or module names
|
||||
* Halt any executing code: with `Ctrl-C`
|
||||
* Copy/paste code or output: `Ctrl-C` and `Ctrl-V`
|
||||
|
||||
{% hint style="info" %}
|
||||
There are a number of useful shortcuts for interacting with the MicroPython REPL. See below for the key combinations;
|
||||
|
||||
* `Ctrl-A` on a blank line will enter raw REPL mode. This is similar to permanent paste mode, except that characters are not echoed back.
|
||||
* `Ctrl-B` on a blank like goes to normal REPL mode.
|
||||
* `Ctrl-C` cancels any input, or interrupts the currently running code.
|
||||
* `Ctrl-D` on a blank line will do a soft reset.
|
||||
* `Ctrl-E` enters ‘paste mode’ that allows you to copy and paste chunks of text. Exit this mode using `Ctrl-D`.
|
||||
* `Ctrl-F` performs a "safe-boot" of the device that prevents `boot.py` and `main.py` from executing
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Serial USB \(UART\)
|
||||
|
||||
To use the REPL, a Pycom device must be connected to the host computer with a USB connection either to an Expansion Board or to serial converter \(a diagram of how to do this can be found the the [getting started](../../introduction.md) page for your module\).
|
||||
|
||||
In order to connect to the REPL over USB serial, there are multiple methods. Detailed below are the explanations of how to do it in MacOS, Linux and Windows.
|
||||
|
||||
## All platforms
|
||||
|
||||
By far the easiest way to access the USB UART REPL is via the our [Pymakr plug-in](../../../pymakr/installation/) for Atom and Visual Studio Code. This adds a pane to the bottom of the editors that allows you to directly access the REPL and any output from the device. Detailed instructions on how to setup Pymakr can be found [here](../../../pymakr/installation/).
|
||||
|
||||
## macOS and Linux
|
||||
|
||||
To open a serial USB connection from macOS, any serial tool may be used; in this example, the terminal tool `screen` will be used.
|
||||
|
||||
Open a terminal instance and run the following commands:
|
||||
|
||||
```bash
|
||||
$ screen /dev/tty.usbmodem* 115200
|
||||
```
|
||||
|
||||
Upon exiting `screen`, press `CTRL-A CTRL-\`. If the keyboard does not support the `\`-key \(i.e. an obscure combination for `\` like `ALT-SHIFT-7` is required\), the key combination can be remapped for the `quit` command:
|
||||
|
||||
* create `~/.screenrc`
|
||||
* add bind `q` to the `exit` command
|
||||
|
||||
This will allow screen to exited by pressing `CTRL-A Q`.
|
||||
|
||||
{% hint style="info" %}
|
||||
On Linux, `picocom` or `minicom` may be used instead of `screen`. The usb serial address might also be listed as `/dev/ttyUSB01` or a higher increment for `ttyUSB`. Additionally, the elevated permissions to access the device \(e.g. group uucp/dialout or use `sudo`\) may be required.
|
||||
{% endhint %}
|
||||
|
||||
## Windows
|
||||
|
||||
A terminal emulator is needed to open the connection from Windows; the easiest option is to download the free program, [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html).
|
||||
|
||||
### COM Port
|
||||
|
||||
To use PuTTY the serial port \(COM port\) in which the Pycom device is connected, must be located. In Windows, this information can be found from the 'Device Manager' program.
|
||||
|
||||
1. Open the Windows start menu and search for 'Device Manager'
|
||||
2. The COM port for the Pycom device will be listed as 'USB Serial Device' or a similar name
|
||||
3. Copy/Write down the associated COM port \(e.g. `COM4`\)
|
||||
|
||||
### Using Putty
|
||||
|
||||
1. With PuTTY open, click on `Session` in the left-hand panel
|
||||
2. Next click the `Serial` radio button on the right and enter the associated
|
||||
|
||||
COM port \(e.g. `COM4`\) in the `Serial Line` box
|
||||
|
||||
3. Finally, click the `Open` button
|
||||
|
||||

|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# Telnet REPL
|
||||
|
||||
Pycom devices also support a connection via `telnet`, using the device's on board WiFi/WLAN. Connect to the device's WiFi Access Point \(AP\) and using the following credentials to connect to the AP. The WiFi `SSID` will appear upon powering on a Pycom Device for the first time \(e.g. `lopy-`\). To re-enable this feature at a later date, please see [network.WLAN](../../../firmwareapi/pycom/network/wlan.md).
|
||||
|
||||
* password: `www.pycom.io`
|
||||
|
||||
## Telnet Server
|
||||
|
||||
Additionally, to use the MircoPython REPL over telnet, further authentication is required. The default credentials for the telnet server are:
|
||||
|
||||
* username: `micro`
|
||||
* password: `python`
|
||||
|
||||
See [network.server](../../../firmwareapi/pycom/network/server.md) for info on how to change the default authentication.
|
||||
|
||||
## All platforms
|
||||
|
||||
By far the easiest way to access the Telnet REPL is via the our [Pymakr plug-in](../../../pymakr/installation/) for Atom and Visual Studio Code. This adds a pane to the bottom of the editors that allows you to directly access the REPL and any output from the device. Detailed instructions on how to setup Pymakr can be found [here](../../../pymakr/installation/).
|
||||
|
||||
## macOS and Linux
|
||||
|
||||
Once the host machine is connected to the Pycom device's Access Point, a telnet connection may be opened from a terminal instance.
|
||||
|
||||
```bash
|
||||
$ telnet 192.168.4.1
|
||||
```
|
||||
|
||||
Upon connection, the telnet program will prompt for the `username` and `password` in the section above.
|
||||
|
||||
## Windows
|
||||
|
||||
A terminal emulator is needed to open a telnet connection from Windows; the easiest option is to download the free program, [PuTTY](http://www.putty.org/).
|
||||
|
||||
1. With PuTTY open, select telnet as connection type and leave the default port \(`23`\)
|
||||
2. Next enter the IP address of the Pycom device \(e.g. `192.168.4.1`\)
|
||||
3. Finally click `Open`
|
||||
|
||||
{% hint style="info" %}
|
||||
When using a Pycom device with a personal, home or office WiFi access point, the telnet connection may still be used. In this instance, the user will need to determine the Pycom device's local IP address and substitute this for `192.168.4.1`, referred to in the earlier sections.
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# Safe boot
|
||||
|
||||
If powering up normally or upon pressing the reset button, a Pycom module will boot into standard mode; the `boot.py` file will be executed first, followed by `main.py`. It is possible to alter the boot procedure of the module by tying certain pins `high` or `low` when the module boots.
|
||||
|
||||
## Bootloader
|
||||
|
||||
If you updated your device before using it, you have already put the device into bootloader mode. This is achieved by connecting `G23` to `GND` while the device boots. If you used a Pysense/Pytrack to update, it did this automatically for you. You only need to put your Pycom module into bootloader mode if you are updating its firmware, or are programming your own low level code. This is not required if you are updating your MicroPython code.
|
||||
|
||||
## Safe Boot
|
||||
|
||||
Some times the code you have written will prevent you gaining access to the REPL or prevent you updating your code. Some example may be:
|
||||
|
||||
* You disabled the WiFi/UART
|
||||
* Your code gets stuck before reaching the REPL
|
||||
* You set a socket as blocking but never receive any data
|
||||
|
||||
In order to fix this you can safe boot your module. This will prevent `boot.py` and `main.py` from being executed and will drop you straight into the interactive REPL. After reset, if `P12` pin is held `high` \(i.e. connect it to the `3V3` output pin\), the heartbeat LED will begin flashing orange slowly. If after 3 seconds the pin is still held high, the LED will start blinking faster. In this mode the module will do the same as previously explained but it will also select the previous OTA image to boot if you have updated the module via the OTA update procedure \(updates performed via the firmware update tool do not count\). This is useful if you flashed a OTA update that breaks the device.
|
||||
|
||||
Pin `P12` released during:
|
||||
|
||||
| 1st 3 secs window | 2nd 3 secs window |
|
||||
| :--- | :--- |
|
||||
| Disable `boot.py` and `main.py` | Same as previous but using previous OTA firmware |
|
||||
|
||||
The selection made during safe boot is not persistent, therefore after the next normal reset, the latest firmware will proceed to run again.
|
||||
|
||||
If problems occur within the filesystem or you wish to factory reset your module to remove your code, run following code in the REPL:
|
||||
|
||||
```python
|
||||
>>> import os
|
||||
>>> os.mkfs('/flash')
|
||||
```
|
||||
|
||||
{% hint style="danger" %}
|
||||
Be aware, resetting the flash filesystem will delete all files inside the internal device storage \(not the SD card\) and they cannot be recovered.
|
||||
{% endhint %}
|
||||
|
||||
## Reset
|
||||
|
||||
Pycom devices support both soft and hard resets. A soft reset clears the state of the MicroPython virtual machine but leaves hardware peripherals unaffected. To do a soft reset, press `Ctrl+D` on the REPL or from within a script, run:
|
||||
|
||||
```python
|
||||
>>> import sys
|
||||
>>> sys.exit()
|
||||
```
|
||||
|
||||
A hard reset is the same as performing a power cycle to the device. In order to hard reset the device, press the `reset` switch or run:
|
||||
|
||||
```python
|
||||
>>> import machine
|
||||
>>> machine.reset()
|
||||
```
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Device Registration
|
||||
|
||||
Some of our devices require registration before you can utilise specific features such as certain types of networking. Please see the list below for setup guides to ensure that your device is registered and activated on the various platforms required to access all of the available features.
|
||||
|
||||
[](sigfox.md)
|
||||
|
||||
[](lora/)
|
||||
|
||||
[](cellular.md)
|
||||
|
||||
[](cellular.md)
|
||||
|
||||
{% hint style="info" %}
|
||||
**Not all Pycom devices require activation**; most features work immediately out of the box!
|
||||
{% endhint %}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# Cellular
|
||||
|
||||
In order to use your GPy/FiPy on a cellular network you are required to get a SIM card from a local provider.
|
||||
|
||||
_Note: This might differ from a standard SIM you can buy in a store, our devices do not support standard LTE._
|
||||
|
||||
Currently we are not able to provide any specific details about how to get such a SIM card and how to register it as most deployments are closed trials, each carrier has it’s own rules \(for example, whether they require special SIMs or not\).
|
||||
|
||||
We recommend contacting your local cellular providers to check their plans surrounding LTE CAT-M1 and NB-IoT. By contacting them, you will show the carriers that there is local interest in deploying such networks.
|
||||
|
||||
You can find a map of deployed networks and open labs [here](https://www.gsma.com/iot/deployment-map/#deployments).
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# LoRaWAN
|
||||
|
||||
## Raw LoRa
|
||||
|
||||
When using raw LoRa, you do not have to register your module in any way. The modules can talk to each other directly.
|
||||
|
||||
## LoRaWAN
|
||||
|
||||
In order to connect your LoRa capable Pycom module to a LoRaWAN network you will have to register your device with the desired network. We are unable to provide instructions for all LoRaWAN networks but below you will find some generic instructions, along with links to any specific guides we are aware of.
|
||||
|
||||
### Generic instructions
|
||||
|
||||
Firstly you will need to get your modules `Device EUI`, this can be achieved using the following code:
|
||||
|
||||
```python
|
||||
from network import LoRa
|
||||
import ubinascii
|
||||
|
||||
lora = LoRa(mode=LoRa.LORAWAN)
|
||||
print(ubinascii.hexlify(lora.mac()).upper().decode('utf-8'))
|
||||
```
|
||||
|
||||
The output will be a hex string like: `70B3D5499585FCA1`. Once you have this you will need to provide it to your LoRaWAN network which will then provide you with the details need to connect via Over-the-Air Activation \(OTAA\) or Activation by Personalisation \(ABP\)
|
||||
|
||||
#### OTAA
|
||||
|
||||
If you wish to connect via OTAA \(which is the recommended method\) the network will provide you with an `Application EUI` and `Application Key`. The former identifies what application your device is connecting to, the latter is a shared secret key unique to your device to generate the session keys that prove its identity to the network. Once you have these you can use the [LoRaWAN OTAA example](../../../tutorials/lora/lorawan-otaa.md) code to connect to the network.
|
||||
|
||||
#### ABP
|
||||
|
||||
With ABP the encryption keys enabling communication with the network are preconfigured in the device. The network will need to provide you with a `Device Address`, `Network Session Key` and `Application Session Key`. Once you have these you can use the [LoRaWAN ABP example](../../../tutorials/lora/lorawan-abp.md) code to connect to the network.
|
||||
|
||||
### Networks
|
||||
|
||||
[](ttn.md)
|
||||
|
||||
[](senet.md)
|
||||
|
||||
|
||||
{% hint style="info" %}
|
||||
If you cannot find your favourite LoRaWAN network in the list above, please consider writing a tutorial for how to connect a Pycom module with it and contribute it to this documentation via a [GitHub pull request](https://github.com/pycom/pycom-documentation).
|
||||
{% endhint %}
|
||||
@@ -1,73 +0,0 @@
|
||||

|
||||
|
||||
|
||||
# The Senet Developer Portal
|
||||
|
||||
Connecting your device begins by creating an account on the Senet Developer Portal. This will grant you free access for up to 10 devices and 5 gateways to support application development activities. [Sign-Up](https://portal.senetco.io/)
|
||||
|
||||
Complete Senet Developer Portal documentation is available on line at [Docs](https://docs.senetco.io/docs).
|
||||
|
||||
Once your account has been activated, you may want to onboard a gateway, if Senet public network access in unavailable. Onboarding your device consists of registering the device through your portal account and then provisioning your device with the information provided at the completion of the registration process. Senet supports both Over-The-Air-Activation (OTAA) and Activation-By-Personalization (ABP). As ABP is useful only in a very narrow set of use-cases, this tutorial will walk you through OTAA registration and provisioning.
|
||||
|
||||
# Device Identity and Security Elements
|
||||
|
||||
All LoRaWAN 1.0.x end-devices require three provisioning elements to join a network. Devices typically come from the factory with a unique, 64-bit EUI (called a DevEUI) which is the device's globally unique identifier. In the case of the Senet Developer Portal, the two additional elements (The Application EUI or AppEUI and Application Key or AppKey) will be generated and provided to you after registration (in typical production environments, these additional elements are also provided during manufacturing and provisioned into the network backend).
|
||||
|
||||
* Device EUI (DevEUI)
|
||||
* Application EUI (AppEUI)
|
||||
* Application Key (AppKey)
|
||||
|
||||
## Device EUI
|
||||
|
||||
This comes from the device itself and can be obtained from `lora.mac()`.
|
||||
To obtain the required hexadecimal representation you can run the following code on your LoPy:
|
||||
|
||||
```python
|
||||
from network import LoRa
|
||||
import ubinascii
|
||||
|
||||
lora = LoRa()
|
||||
print("DevEUI: %s" % (ubinascii.hexlify(lora.mac()).decode('ascii')))
|
||||
```
|
||||
|
||||
Use this value during the first step of device registration.
|
||||
|
||||

|
||||
|
||||
## Application EUI and Application Key
|
||||
|
||||
The Application EUI uniquely identifies the security broker (called a Join Server in LoRaWAN terminology) which is interogated by the network when the device attempts to join the network. The Application Key is the shared secret (between the end-device and the Join-Server) which forms the basis for LoRaWAN security and is used to generate the application and network session keys used for privacy and message integrity.
|
||||
|
||||
At the completion of your device registration process on the Senet Developer Portal, you will be presented with the Application EUI and the Application Key which you will need to provision in your device. This information is always available after the fact in the device details screen.
|
||||
|
||||

|
||||
|
||||
# Provisioning the LoPy or FiPy
|
||||
|
||||
After device registration is complete, configure the device for optimal operation and provision the AppEUI and AppKey.
|
||||
|
||||
```python
|
||||
from network import LoRa
|
||||
import socket
|
||||
import time
|
||||
import ubinascii
|
||||
|
||||
# Initialise LoRa in LORAWAN mode.
|
||||
# Please pick the region that matches where you are using the device:
|
||||
# Asia = LoRa.AS923
|
||||
# Australia = LoRa.AU915
|
||||
# Europe = LoRa.EU868
|
||||
# United States = LoRa.US915
|
||||
lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.US915)
|
||||
|
||||
# create an OTAA authentication parameters
|
||||
app_eui = ubinascii.unhexlify('00250C0000010001')
|
||||
app_key = ubinascii.unhexlify('00112233445566778899AABBCCDDEEFF')
|
||||
|
||||
# initialize LoRa
|
||||
lora.init(mode=LoRa.LORAWAN, adr=True, public=True)
|
||||
|
||||
# join a network using OTAA (Over the Air Activation)
|
||||
lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), dr=0, timeout=0)
|
||||
```
|
||||
You are now ready to start sending messages from your device! Each device may be provisioned to stream the datagrams to the backend service of your choice in a variety of standard and custom formats.
|
||||
@@ -1,78 +0,0 @@
|
||||
# The Things Network
|
||||
|
||||
In order to use The Things Network \(TTN\) you should navigate to their website and create/register an account. Enter a username and an email address to verify with their platform.
|
||||
|
||||

|
||||
|
||||
Once an account has been registered, you can register your Pycom module as either a node or a nano-gateway. The steps below will detail how to do this.
|
||||
|
||||
## Create an application
|
||||
|
||||
In order to register your device to connect to the things network, you must first create an application for these devices to belong to. This way the Network will know where to send the devices data to.
|
||||
|
||||
Selecting the `Applications` tab at the top of the TTN console, will bring up a screen for registering applications. Click register and a new page, similar to the one below, will open.
|
||||
|
||||

|
||||
|
||||
Enter a unique `Application ID` as well as a Description & Handler Registration.
|
||||
|
||||
Now the Pycom module nodes can be registered to send data up to the new Application.
|
||||
|
||||
## Register a Device
|
||||
|
||||
To connect nodes to a things network gateway, devices need to be added to the application. To do this, navigate to the `Devices` tab on the `Application` home page and click the `Register Device` button.
|
||||
|
||||

|
||||
|
||||
In the `Register Device` panel, complete the forms for the `Device ID` and the `Device EUI`. The `Device ID` is user specified and is unique to the device in this application. The `Device EUI` should be a globally unique identifier for the device. You can run the following on you Pycom module to retrieve its EUI.
|
||||
|
||||
```python
|
||||
from network import LoRa
|
||||
import ubinascii
|
||||
|
||||
lora = LoRa()
|
||||
print("DevEUI: %s" % (ubinascii.hexlify(lora.mac()).decode('ascii')))
|
||||
```
|
||||
|
||||
Once the device has been added, change the `Activation Method` between `OTAA` and `ABP` depending on user preference. This option can be found under the `Settings` tab.
|
||||
|
||||
## Register a Nano-Gateway
|
||||
|
||||
You can also setup your Pycom module to act as a gateway with The Things Network. The code required to do this can be found [here](../../../tutorials/lora/lorawan-nano-gateway.md).
|
||||
|
||||
Inside the TTN Console, there are two options, `Applications` and `Gateways`. Select `Gateways` and then click on `register Gateway`. This will allow for the set up and registration of a new nano-gateway.
|
||||
|
||||

|
||||
|
||||
On the Register Gateway page, you will need to set the following settings:
|
||||
|
||||

|
||||
|
||||
These are unique to each gateway, location and country specific frequency. Please verify that correct settings are selected otherwise the gateway will not connect to TTN.
|
||||
|
||||
**You need to tick the "I'm using the legacy packet forwarder" to enable the right settings.** This is because the Nano-Gateway uses the 'de facto' standard Semtech UDP protocol.
|
||||
|
||||
| Option | Value |
|
||||
| :--- | :--- |
|
||||
| Protocol | Packet Forwarder |
|
||||
| Gateway EUI | User Defined \(must match `config.py`\) |
|
||||
| Description | User Defined |
|
||||
| Frequency Plan | Select Country \(e.g. EU - 868 MHz\) |
|
||||
| Location | User Defined |
|
||||
| Antenna Placement | Indoor or Outdoor |
|
||||
|
||||
Most LoRaWAN network servers expect a Gateway ID in the form of a unique 64-bit hexadecimal number \(called a EUI-64\). The recommended practice is to produce this ID from your board by expanding the WiFi MAC address \(a 48-bit number, called MAC-48\). You can obtain that by running this code prior to configuration:
|
||||
|
||||
```python
|
||||
from network import WLAN
|
||||
import binascii
|
||||
wl = WLAN()
|
||||
binascii.hexlify(wl.mac())[:6] + 'FFFE' + binascii.hexlify(wl.mac())[6:]
|
||||
```
|
||||
|
||||
Once these settings have been applied, click `Register Gateway`. A Gateway Overview page will appear, with the configuration settings showing. Next click on the `Gateway Settings` and configure the Router address to match that of the gateway \(default: `router.eu.thethings.network`\).
|
||||
|
||||

|
||||
|
||||
The `Gateway` should now be configured.
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# Sigfox
|
||||
|
||||
Before you start, update your device to the latest firmware. Select _stable_ firmware in Firmware updater. After firmware update is done, _Sigfox ID_ and _Sigfox PAC_ were assigned to your device.
|
||||
|
||||
Copy _Sigfox ID_ and _Sigfox PAC_ from the last screen of firmware updater.
|
||||
|
||||

|
||||
|
||||
_Sigfox ID_ and _Sigfox Pac_ is assigned to your device just once during the first update process. _Sigfox ID_ and _Sigfox Pac_ will not change after successive firmware updates.
|
||||
|
||||
After first firmware update you can also get your _Sigfox ID_ and _Sigfox PAC_ through a couple of commands via the REPL.
|
||||
|
||||
```python
|
||||
from network import Sigfox
|
||||
import binascii
|
||||
|
||||
# initalise Sigfox for RCZ1 (You may need a different RCZ Region)
|
||||
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)
|
||||
|
||||
# print Sigfox Device ID
|
||||
print(binascii.hexlify(sigfox.id()))
|
||||
|
||||
# print Sigfox PAC number
|
||||
print(binascii.hexlify(sigfox.pac()))
|
||||
```
|
||||
|
||||
## Creating account at Sigfox backend
|
||||
|
||||
You need to register to the Sigfox Backend. Navigate to [https://backend.sigfox.com/activate](https://backend.sigfox.com/activate)
|
||||
|
||||

|
||||
|
||||
Find the specific country country where the device will be activated. Enter the device's _Sigfox ID_ and _Sigfox PAC_.
|
||||
|
||||
You should see green microchip if you entered correct _Sigfox ID_ and _Sigfox PAC_
|
||||
|
||||

|
||||
|
||||
Then provide the required information including email address and complete registration.
|
||||
|
||||
{% hint style="info" %}
|
||||
When registering your other devices \(not your first device\), you already have created Sigfox Account before. Be sure you are login with your Sigfox account. In that way all of your devices will be added to same Sigfox Account.
|
||||
{% endhint %}
|
||||
|
||||

|
||||
|
||||
After registration, you will receive confirmation email with _password_ to Sigfox backend [https://backend.sigfox.com/auth/login](https://backend.sigfox.com/auth/login)
|
||||
|
||||
Use your email and password to login to Sigfox backend.
|
||||
|
||||

|
||||
|
||||
If you enter correct credentials then you should be able to login to Sigfox backend.
|
||||
|
||||
## Transferring your device to new Sigfox account
|
||||
|
||||
You may want to transfer your devices to new Sigfox account.
|
||||
|
||||
Once you register your device on Sigfox backend, then your Sigfox PAC was used, and is not valid anymore. You need to get new Sigfox PAC. We don't update Sigfox PAC assigned to your device \(which can be seen on last page of Firmware updater or read from device\).
|
||||
|
||||
To get new Sigfox PAC navigate to your device on Sigfox backend. On _device_ click on Sigfox Id of device you want to transfer.
|
||||
|
||||

|
||||
|
||||
Now you can see your new Sigfox PAC.
|
||||
|
||||

|
||||
|
||||
Once you know your new Sigfox PAC go to [https://backend.sigfox.com/activate](https://backend.sigfox.com/activate) and register device with different account.
|
||||
|
||||
Reference in New Issue
Block a user