Merge branch 'publish' into pymakr_online
58
config.toml
@@ -1168,11 +1168,18 @@ theme = "doc-theme"
|
||||
|
||||
[[menu.main]]
|
||||
name = "Getting Started"
|
||||
url = "/pybytes/getstarted/"
|
||||
identifier = "pybytes@getstarted"
|
||||
url = "/pybytes/gettingstarted/"
|
||||
identifier = "pybytes@gettingstarted"
|
||||
parent = "pybytes"
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
name = "Visualise data"
|
||||
url = "/pybytes/dashboard/"
|
||||
identifier = "pybytes@dashboard"
|
||||
parent = "pybytes"
|
||||
weight = 15
|
||||
|
||||
[[menu.main]]
|
||||
name = "Pybytes library API"
|
||||
url = "/pybytes/api/"
|
||||
@@ -1446,13 +1453,6 @@ theme = "doc-theme"
|
||||
parent = "pybytes@networks@lora"
|
||||
weight = 20
|
||||
|
||||
[[menu.main]]
|
||||
name = "Visualise data"
|
||||
url = "/pybytes/dashboard/"
|
||||
identifier = "pybytes@dashboard"
|
||||
parent = "pybytes"
|
||||
weight = 70
|
||||
|
||||
[[menu.main]]
|
||||
name = "Integrations"
|
||||
url = "/pybytes/integrations/"
|
||||
@@ -1466,7 +1466,24 @@ theme = "doc-theme"
|
||||
identifier = "pybytes@pymeshintegration"
|
||||
parent = "pybytes"
|
||||
weight = 90
|
||||
|
||||
[[menu.main]]
|
||||
name = "Example"
|
||||
url = "/pybytes/pymeshintegration/example/"
|
||||
identifier = "pybytes@pymeshintegration@example"
|
||||
parent = "pybytes@pymeshintegration"
|
||||
weight = 10
|
||||
[[menu.main]]
|
||||
name = "Monitoring"
|
||||
url = "/pybytes/pymeshintegration/monitoring/"
|
||||
identifier = "pybytes@pymeshintegration@monitoring"
|
||||
parent = "pybytes@pymeshintegration"
|
||||
weight = 20
|
||||
[[menu.main]]
|
||||
name = "Provisioning"
|
||||
url = "/pybytes/pymeshintegration/provisioning/"
|
||||
identifier = "pybytes@pymeshintegration@provisioning"
|
||||
parent = "pybytes@pymeshintegration"
|
||||
weight = 30
|
||||
[[menu.main]]
|
||||
name = "Machine Learning"
|
||||
url = "/pybytes/mlintegration/"
|
||||
@@ -1474,6 +1491,27 @@ theme = "doc-theme"
|
||||
parent = "pybytes"
|
||||
weight = 100
|
||||
|
||||
[[menu.main]]
|
||||
name = "Device Settings"
|
||||
url = "/pybytes/mlintegration/devicesettings/"
|
||||
identifier = "pybytes@mlintegration@devicesettings"
|
||||
parent = "pybytes@mlintegration"
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
name = "Features"
|
||||
url = "/pybytes/mlintegration/features/"
|
||||
identifier = "pybytes@mlintegration@features"
|
||||
parent = "pybytes@mlintegration"
|
||||
weight = 20
|
||||
[[menu.main]]
|
||||
name = "Model Creation"
|
||||
url = "/pybytes/mlintegration/modelcreation/"
|
||||
identifier = "pybytes@mlintegration@modelcreation"
|
||||
parent = "pybytes@mlintegration"
|
||||
weight = 30
|
||||
|
||||
|
||||
[[menu.main]]
|
||||
name = "Amazon IoT"
|
||||
url = "/pybytes/integrations/amazon-iot/"
|
||||
|
||||
@@ -31,8 +31,9 @@ In a nutshell, Pybytes is an environment designed to optimise your IoT applicati
|
||||
|
||||
## Let's get started!
|
||||
|
||||
* [Getting started with Pybytes](/pybytes/getstarted/)
|
||||
|
||||
* [Getting started with Pybytes](/pybytes/gettingstarted/)
|
||||
* [Connect your Pycom module to Pybytes](/pybytes/connect/)
|
||||
* [Visualise data from your device](/pybytes/dashboard/)
|
||||
* [LoRa Servers](/pybytes/networks/lora/)
|
||||
* [Integrations with external services](/pybytes/integrations/index.html)
|
||||
* [LoRa Servers](/pybytes/lora/)
|
||||
* [Integrations with external services](/pybytes/integrations/)
|
||||
|
||||
@@ -11,18 +11,23 @@ In this section, we will explain to you how to add a device to Pybytes.
|
||||
Go to the *Devices* page in Pybytes:
|
||||
|
||||
1. Click on *Add Device*.
|
||||
|
||||

|
||||
|
||||
1. Select your device (WiPy, LoPy, SiPy, etc.).
|
||||
|
||||

|
||||
|
||||
1. Select your network options. This will be how your device connects to both Pybytes and the internet. For now, choose WiFi.
|
||||
|
||||

|
||||
|
||||
1. Enter a unique name for your device and enter the WiFi credentials (SSID and password). You can save this WiFi, so that it will be remembered for later use when adding further devices.
|
||||
|
||||

|
||||
|
||||
1. At the end of the *Add Device* wizard, Pybytes will show that your device profile was successfully created.
|
||||
|
||||

|
||||
|
||||
## Next step
|
||||
|
||||
@@ -8,7 +8,7 @@ aliases:
|
||||
|
||||
In this section, we explain to you how to connect your device to Pybytes quickly using the Firmware Updater tool.
|
||||
|
||||
### Download Pycom Firmware Updater tool
|
||||
## Download Pycom Firmware Updater tool
|
||||
|
||||
1. At the final step of the "Add Device" process, you can download and install the [Pycom Firmware Updater tool](https://pycom.io/downloads/)).
|
||||

|
||||
@@ -16,36 +16,29 @@ In this section, we explain to you how to connect your device to Pybytes quickly
|
||||
1. Copy the activation token by pressing the Copy button. The activation token is valid for one hour. If your activation token has expired, you can create a new one.
|
||||
|
||||
|
||||
### Flash Pybytes firmware with Pycom Firmware Updater tool
|
||||
## Flash Pybytes firmware with Pycom Firmware Updater tool
|
||||
|
||||
#### Before you start
|
||||
### Before you start
|
||||
* Connect your device to the computer
|
||||
* If your device is already connected, make sure it is not connected to Pymakr
|
||||
|
||||
#### Firmware update process
|
||||
### Firmware update process
|
||||
|
||||
1. Open the Pycom Firmware Updater tool on your computer and click on the Continue button.
|
||||

|
||||
|
||||
1. Click again on the Continue button.
|
||||

|
||||
2. Click again on the Continue button.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
If your device is already connected to your computer, on MacOS serial port will be automatically filled for you.
|
||||
At this step, you can also click on Rescan ports button to update ports listed in the Firmware Updater.
|
||||
{{% /hint %}}
|
||||
3. Check the options "Erase flash file system" and "Force update Pybytes registration";
|
||||
|
||||
1. Check the options "Erase flash file system" and "Force update Pybytes registration";
|
||||

|
||||

|
||||
|
||||
1. Paste your activation token from Pybytes. Firmware Updater should display **Registration successful!**
|
||||

|
||||
4. Paste your activation token from Pybytes. Firmware Updater should display **Registration successful!**
|
||||
|
||||
1. Then press the Continue button. Your device will be flashed with the Pybytes firmware. This should take about a minute.
|
||||

|
||||

|
||||
|
||||
1. After the updating process is done, you will see the final screen. Click on Done to close the Firmware Updater.
|
||||

|
||||
5. Then press the Continue button. Your device will be flashed with the Pybytes firmware. This should take about a minute.
|
||||
|
||||
6. After the updating process is done, you will see the final screen. Click on Done to close the Firmware Updater.
|
||||
|
||||
## Next step: Set up your device's dashboard!
|
||||
|
||||
|
||||
@@ -8,131 +8,55 @@ aliases:
|
||||
|
||||
In this section, we will explain how to create widgets for data visualisation and how to set up your device's dashboard on Pybytes.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
We're assuming that you have already connected your device to Pybytes. In case you haven't, check how to [add your device here](../connect/). After you're done with that, you can proceed to the next example.
|
||||
{{% /hint %}}
|
||||
> We're assuming that you have already connected your device to Pybytes. In case you haven't, check how to [add your device here](../connect/). After you're done with that, you can proceed to the next example.
|
||||
|
||||
## Step 1: Set up your python application
|
||||
## Step 1: Setup a Pymakr Project
|
||||
|
||||
The first step is to have your python application uploaded and running on your Pycom device.
|
||||
1. Create a project in Pymakr called `Pybytes_signals`, and add the following code to `main.py`. This python application will send data every 5 seconds to Pybytes.
|
||||
|
||||
1. Install the [Pymakr](https://atom.io/packages/pymakr) plugin.
|
||||
|
||||
(We highly recommend using Pymakr with Atom, but you can also use Pymakr with [VS Code](https://marketplace.visualstudio.com/items?itemName=pycom.Pymakr)).
|
||||
2. In Atom create a project folder `my-first-wipy` (any other name will work as well).
|
||||
4. In your project folder create the `main.py` file
|
||||
3. Copy and paste the following code into your `main.py`
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Scroll a bit down to see the picture of the project structure in Atom.
|
||||
{{% /hint %}}
|
||||
|
||||
This python application will send data from the array every 5 seconds to Pybytes.
|
||||
|
||||
```python
|
||||
|
||||
# Import what is necessary to create a thread
|
||||
import _thread
|
||||
from time import sleep
|
||||
|
||||
# Increment index used to scan each point from vector sensors_data
|
||||
def inc(index, vector):
|
||||
if index < len(vector)-1:
|
||||
return index+1
|
||||
else:
|
||||
return 0
|
||||
|
||||
# Define your thread's behaviour, here it's a loop sending sensors data every 5 seconds
|
||||
def send_env_data():
|
||||
idx = 0
|
||||
sensors_data = [0, -0.2, -0.5, -0.7, -0.8, -0.9, -0.9, -0.9, -0.8, -0.6, -0.4, -0.2, 0, 0.3, 0.5, 0.7, 0.8, 0.9, 0.9, 0.9, 0.8, 0.6, 0.4, 0.1]
|
||||
```python
|
||||
# Import what is necessary to create a thread
|
||||
import time
|
||||
import math
|
||||
|
||||
# Send data continuously to Pybytes
|
||||
while True:
|
||||
# send one element from array `sensors_data` as signal 1
|
||||
pybytes.send_signal(1, sensors_data[idx])
|
||||
idx = inc(idx, sensors_data)
|
||||
sleep(5)
|
||||
for i in range(0,20):
|
||||
pybytes.send_signal(math.sin(i/10*math.pi))
|
||||
print('sent signal {}'.format(i))
|
||||
time.sleep(10)
|
||||
```
|
||||
|
||||
# Start your thread
|
||||
_thread.start_new_thread(send_env_data, ())
|
||||
```
|
||||
2. Press *Upload* button to upload the code into your device.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
In this code, we're calling the function `pybytes.send_signal(signalNumber, value))` to send data to Pybytes. This function is part of the Pybytes library, and it has two arguments: `signalNumber` and `value`.
|
||||
>Note that if you have a Pytrack or Pysense expansion board, you could also sent sensor data instead!
|
||||
|
||||
* `signalNumber` represents which signal is receiving data:
|
||||
|
||||
**255** different values: **0 ... 254** (signalNumber 255 is reserved for the Pybytes terminal)
|
||||
* `value` is the value being attributed to that particular signal number
|
||||
{{% /hint %}}
|
||||
|
||||
Your example project in Atom (with Pymakr) should look like this.
|
||||
Press *Upload* button to upload the code into your device.
|
||||
|
||||

|
||||
|
||||
By default, Pymakr will upload all files like `*.py` from your project folder (`my-first-wipy` in this case).
|
||||
File `main.py` will be uploaded to `/flash` folder on your device.
|
||||
|
||||
After the upload is done, the device will reboot and start sending data to Pybytes.
|
||||
In the Pymakr terminal, you should see messages send to Pybytes.
|
||||
|
||||

|
||||
|
||||
Every line stands for one message sent every 5 seconds. Line `1 [-0.7]` means signal `1` sent value `-0.7`.
|
||||
|
||||
## Step 2: Add a signal from your device
|
||||
|
||||
Go to Pybytes and on *Devices* page select your device;
|
||||
1. Go to the [Pybytes device](https://pybytes.pycom.io/devices) page select your device.
|
||||
|
||||

|
||||
2. Then go to `Signals` tab and click on *define new signal*
|
||||
|
||||
Then go to `Data` tab and click on the row in the *Undefined signals* table (recommended). Alternatively, you can click on *Define new signal* button.
|
||||
{{% hint style="info" %}}
|
||||
If you don't see your undefined signal in *Undefined signals* table, please reload your browser.
|
||||
{{% /hint %}}
|
||||
|
||||

|
||||
|
||||
Define new signal by entering a signal name, and optionally a unit (If you clicked on "undefined signal row" your signal number `1` will be already pre-filled).
|
||||
|
||||

|
||||
|
||||
Your signal was defined!
|
||||
|
||||

|
||||
|
||||
{{% hint style="info" %}}
|
||||
The name and unit are labels used to identify your signal inside Pybytes (In this example we defined `Sinwave` as the name of the signal and `Rad` as the unit).
|
||||
|
||||
The signal number has to match the signal number that you defined on `pybytes.send_signal` function call, inside your `main.py` code (In this example we defined `signalNumber = 1`);
|
||||
{{% /hint %}}
|
||||

|
||||
|
||||
## Step 3: Add a widget for the signal
|
||||
|
||||
Click on the *"signal card"*.
|
||||
1. Click on the *signal card* of the selected device.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on the *Create a new display* button.
|
||||
2. Click on the *Create a new display* button.
|
||||
|
||||

|
||||
|
||||
3. Select the type of visualisation \(e.g. bar chart or line graph\).
|
||||
3. Select the type of visualisation (e.g. bar chart or line graph).
|
||||
|
||||

|
||||
|
||||
You can adjust the parameters of your widget at `Settings`. After, click on the button `Create`.
|
||||
4. You can adjust the parameters of your widget at `Settings`. After, click on the button `Create`.
|
||||
|
||||

|
||||
|
||||
Your widget was created. Now, add your widget to your device's dashboard. Click on the button `Edit` on your widget.
|
||||
|
||||

|
||||
|
||||
Mark the checkbox `Display on Dashboard` at `Settings`. Finally, click on the button `Save`.
|
||||
|
||||

|
||||
Your widget was created. Now, add your widget to your device's dashboard. Click on the button `Edit` on your widget, and mark the checkbox `Display on Dashboard` at `Settings`. Finally, click on the button `Save`.
|
||||
|
||||
Click on the `Dashboard` tab. Your widget was successfully added there!
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: "Getting Started with Pybytes"
|
||||
aliases:
|
||||
- pybytes/getstarted.html
|
||||
- pybytes/getstarted.md
|
||||
- chapter/pybytes/getstarted/intro
|
||||
---
|
||||
|
||||
Follow these steps to create a Pybytes account:
|
||||
|
||||
## Step 1: Go to the registration page
|
||||
|
||||
1. Go to [https://pybytes.pycom.io](https://pybytes.pycom.io/?utm_source=docs&utm_medium=web&utm_campaign=pybytes-getting-started).
|
||||
2. Enter your full name, email address and set a password for your account.
|
||||
3. Confirm the verification message sent to your email address.
|
||||
4. Click on the link and complete your login.
|
||||
|
||||
## Go Invent!
|
||||
|
||||
Now it's time to explore Pybytes. You can start by [connecting your Pycom board to Pybytes](../connect).
|
||||
72
content/pybytes/gettingstarted.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: "Getting Started with Pybytes"
|
||||
aliases:
|
||||
- pybytes/getstarted.html
|
||||
- pybytes/getstarted.md
|
||||
- chapter/pybytes/getstarted/intro
|
||||
---
|
||||
|
||||
If you did not get started with our devices yet, please follow [this guide ](/gettingstarted/) first.
|
||||
|
||||
## Step 1: Create a Pybytes Account
|
||||
|
||||
If you already have a Forum or Webshop account, you can use the same credentials to log into [Pybytes](https://pybytes.pycom.io/)
|
||||
|
||||
Else, go to [Pybytes](https://pybytes.pycom.io) and create an account
|
||||
|
||||
## Step 2: Create a device
|
||||
1. Click on [Add Device](https://pybytes.pycom.io/devices). You can either add a device using USB, or the Pybytes App for [iPhone](https://apps.apple.com/us/app/pybytes/id1465696479) or [Android](https://play.google.com/store/apps/details?id=io.pycom.pybytes_android&hl=en). In this guide, we will describe the process using USB.
|
||||

|
||||
|
||||
2. Select your device (WiPy, LoPy, SiPy, etc.).
|
||||

|
||||
|
||||
3. Select your network options. This will be how your device connects to both Pybytes and the internet. For now, we will choose WiFi. This will show a subwindow where you enter your WiFi credentials. This will only be used to connect your device with a WiFi network to access pybytes.
|
||||

|
||||
|
||||
4. Enter a unique name for your device and hit save!
|
||||
|
||||

|
||||
|
||||
5. At the end, Pybytes will show that your device profile was successfully created.
|
||||
|
||||

|
||||
|
||||
## Step 3: Provision your device
|
||||
|
||||
After creation, you will land on the provisioning page. This is where we 'inform' the device about the Pybytes connection and how to set it up. The first time you set up the device for use with Pybytes, you will need to provision it using the Firmware Updater Tool. This is a good moment to become familiar with the tool [here](/updatefirmware/device/).
|
||||
|
||||
1. Open the tool, select your board and select the bottom two checkboxes on this page
|
||||
|
||||

|
||||
|
||||
2. This will ask for a `Pybytes activation token`. Generate a token from pybytes and paste it in the Firmware Updater tool. This will instantly generate a success message in Pybytes.
|
||||
|
||||

|
||||
|
||||
3. Continue with the firmware update to the device.
|
||||
|
||||
## Step 4: Your first signal
|
||||
|
||||
1. Reset your Pycom device using the reset button. This will reboot the device and activate the Pybytes connection automatically. The output will look similar to this. You should see the `Last Connection` status in Pybytes change from `Never` to `Seconds ago`
|
||||
|
||||
> If you get any kind of error message, check the WiFi credentials you entered are correct and that you are in range of this WiFi network
|
||||
|
||||
2. Now, in the REPL, you can type:
|
||||
```python
|
||||
>>> pybytes.send_signal(1, "hello world")
|
||||
```
|
||||
And it will show up on Pybytes in the `signals` tab:
|
||||
|
||||

|
||||
|
||||
You can continue to [display data from your device into the Pybytes dashboard](/pybytes/dashboard/)
|
||||
|
||||
## Final remarks
|
||||
If you wish to disable Pybytes, you can use `pycom.pybytes_on_boot(False)`. It is also possible to start Pybytes in a later stage (not on boot) by importing the module:
|
||||
```python
|
||||
from _pybytes import Pybytes
|
||||
pybytes = Pybytes
|
||||
```
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 106 KiB |
BIN
static/gitbook/assets/pybytes/add-device/define-signal.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 185 KiB |
BIN
static/gitbook/assets/pybytes/add-device/send-signal.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 372 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 149 KiB |
BIN
static/gitbook/assets/pybytes/dashboard/device-send-messages.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 207 KiB |
|
Before Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 672 KiB After Width: | Height: | Size: 158 KiB |