mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 07:06:20 +01:00
added information about pymakr online
This commit is contained in:
@@ -1174,12 +1174,19 @@ theme = "doc-theme"
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
name = "Visualise data"
|
||||
name = "Visualise signals"
|
||||
url = "/pybytes/dashboard/"
|
||||
identifier = "pybytes@dashboard"
|
||||
parent = "pybytes"
|
||||
weight = 15
|
||||
|
||||
[[menu.main]]
|
||||
name = "Pymakr Online"
|
||||
url = "/pybytes/pymakr-online/"
|
||||
identifier = "pybytes@pymakr-online"
|
||||
parent = "pybytes"
|
||||
weight = 17
|
||||
|
||||
[[menu.main]]
|
||||
name = "Pybytes library API"
|
||||
url = "/pybytes/api/"
|
||||
|
||||
90
content/pybytes/pymakr-online/_index.md
Normal file
90
content/pybytes/pymakr-online/_index.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: "Pymakr Online"
|
||||
aliases:
|
||||
- pymakr-online/introduction
|
||||
---
|
||||
|
||||
On this page, we discuss the functionality of Pymakr Online.
|
||||
|
||||
## What is Pymakr Online?
|
||||
|
||||
Pymakr Online is an online IDE for your MicroPython projects. We brought our Pymakr Plugin for Atom and Visual Studio code into Pybytes as an IDE, so you won't necessarily need to have those code editors installed anymore in order to work with your Pycom devices.
|
||||
|
||||
## What does Pymakr Online offer you?
|
||||
|
||||
* Everything you would expect from a code editor: syntax highlighting, auto complete, multi tabs, file tree, search box etc.
|
||||
* REPL terminal
|
||||
* Import from multiple sources (blank/device/project/Github repository), export to a zip file/device/project
|
||||
* Device activity indicator: track what's going between Pymakr Online and your device.
|
||||
|
||||
## Let's get started!
|
||||
|
||||
There are two ways in which you can use Pymakr online.
|
||||
1. Go to [your device](https://pybytes.pycom.io/devices) and select the `Pymakr Online` tab. This method allows you to make quick changes to the Python code on your device and upload it.
|
||||
|
||||

|
||||
|
||||
2. Start a new project on the [Pymakr](https://pybytes.pycom.io/pymakr) tab in Pybytes. There are several different types you can choose from, including a link to your Github repository! Later, we can link the project to a release.
|
||||
|
||||

|
||||
|
||||
## Using Pymakr Online
|
||||
|
||||
1. When you open Pymakr Online, you will see the following
|
||||
|
||||

|
||||
|
||||
|
||||
* On the left we see the files. Depending on where you started, the online environment will first load with the files you last used. If the device is online, it will automatically try to `Refresh Hierarcy` and synchronise the content. You can click the `Refresh Hierarcy` icon next to your device name to manually update the online filestructure. The online editor will automatically try to connect.
|
||||
* In the top right, the connection status is displayed. Every so often, you will see a ping being sent out to the device to check if it is still connected.
|
||||
* And finally, on the bottom, the REPL is displayed, this works exactly the same as the REPL you are used to in VSCode or Atom. Everything you type in there will be duplicated to the REPL over USB.
|
||||
|
||||
2. Open the `main.py` file, or, when not available, create one by right clicking on the device name to `Create File`. Here, we can write our own python code in the main editor. You can use the example we added below to try it out.
|
||||
|
||||

|
||||
|
||||
```python
|
||||
import pycom
|
||||
import time
|
||||
pycom.heartbeat(False)
|
||||
while(True):
|
||||
pycom.rgbled(0xAA0000)
|
||||
time.sleep(0.5)
|
||||
pycom.rgbled(0xAA00AA)
|
||||
time.sleep(0.5)
|
||||
pycom.rgbled(0x00AA00)
|
||||
time.sleep(0.5)
|
||||
```
|
||||
3. After adding the code, a `Save and Upload` button will appear, allowing you to upload code to the device. Clicking this will upload and reboot the device. The device will restart and go offline for a second. Then come back online and show the RGB LED blinking in three different colors.
|
||||
|
||||

|
||||
|
||||
>Note that if you make a syntax error, the device will come back online but not throw any error in the REPL.
|
||||
|
||||
4. Now that you know how to use the Pymakr Online environment, we can creat a project.
|
||||
|
||||
## The differences between the two ways of opening Pymakr online
|
||||
|
||||
### From the device page
|
||||
|
||||

|
||||
|
||||
If you have opened Pymakr Online from a device page, you may notice:
|
||||
|
||||
1. Device activity indicator. To track what's going on between the Pymakr Online and the linked device.
|
||||
2. REPL terminal.
|
||||
3. Save and upload current file. That will save that file on the cloud and upload it to your device.
|
||||
4. Refresh hierarchy. That will request the device its hierarchy, in case the files structure has been changed.
|
||||
5. Download file. That will request the file from the device, forcing the download of it. Warning: that will override your changes in case you haven't uploaded the file to the device.
|
||||
|
||||
### From the Pymakr initial page
|
||||
|
||||

|
||||
|
||||
1. Save/export button.
|
||||
|
||||
Since there's no device linked in this way of opening Pymakr Online, there are no device related actions here (download file, device activity indicator etc). Instead, you decide what you are going to do with your code:
|
||||
|
||||

|
||||
|
||||
*Modal opened after clicking on Save/Export button*
|
||||
48
content/pybytes/pymakr-online/how-to-open.md
Normal file
48
content/pybytes/pymakr-online/how-to-open.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "How to Open Pymakr Online"
|
||||
aliases:
|
||||
- pymakr-online/how-to-open.html
|
||||
- pymakr-online/how-to-open.md
|
||||
- pymakr-online/how-to-open
|
||||
---
|
||||
|
||||
## The two different ways of opening Pymakr Online
|
||||
|
||||
Pymakr Online can be opened in two different ways:
|
||||
|
||||
### 1. from the device page, which will open Pymakr Online linked to that device
|
||||
|
||||

|
||||
|
||||
### 2. from Pymakr Online initial page, which is accessible from the side bar menu.
|
||||
|
||||

|
||||

|
||||
|
||||
*Pymakr Online initial page*
|
||||
|
||||
## The differences between the two ways of opening Pymakr online
|
||||
|
||||
### From the device page
|
||||
|
||||

|
||||
|
||||
If you have opened Pymakr Online from a device page, you may notice:
|
||||
|
||||
1. Device activity indicator. To track what's going on between the Pymakr Online and the linked device.
|
||||
2. REPL terminal.
|
||||
3. Save and upload current file. That will save that file on the cloud and upload it to your device.
|
||||
4. Refresh hierarchy. That will request the device its hierarchy, in case the files structure has been changed.
|
||||
5. Download file. That will request the file from the device, forcing the download of it. Warning: that will override your changes in case you haven't uploaded the file to the device.
|
||||
|
||||
### From the Pymakr initial page
|
||||
|
||||

|
||||
|
||||
1. Save/export button.
|
||||
|
||||
Since there's no device linked in this way of opening Pymakr Online, there are no device related actions here (download file, device activity indicator etc). Instead, you decide what you are going to do with your code:
|
||||
|
||||

|
||||
|
||||
*Modal opened after clicking on Save/Export button*
|
||||
185
content/pybytes/pymakr-online/toolsfeatures.md
Normal file
185
content/pybytes/pymakr-online/toolsfeatures.md
Normal file
@@ -0,0 +1,185 @@
|
||||
---
|
||||
title: "Tools/Features"
|
||||
aliases:
|
||||
- pymakr/toolsfeatures.html
|
||||
- pymakr/toolsfeatures.md
|
||||
- chapter/pymakr/toolsfeatures
|
||||
---
|
||||
|
||||
There are two different ways of opening Pymakr Online. Each way has some differences on the features and purposes. Read more at [How to Open Pymakr Online](/pymakr-online/how-to-open)
|
||||
|
||||
# Pymakr Online linked to a device
|
||||
|
||||
If you open Pymakr Online from a device page, Pymakr will be linked to that device.
|
||||
|
||||
_**Note: Your device needs to be online in order to be reachable by Pymakr Online**_
|
||||
|
||||
## Terminal
|
||||
|
||||
Just like Pymakr Plugin, Pymakr Online also has a REPL (Read Evaluate Print Line) terminal. The REPL allows you to run code on your device, line by line. To begin coding, open Pymakr from a device (device's page > pymakr tab > open Pymakr button), go to the terminal and start typing your code.
|
||||
|
||||
|
||||
## Download a file
|
||||
|
||||
When Pymakr is loaded, the IDE will request the device its hierarchy (the folder structure). If you open a file that has never been opened in Pymakr Online before, that file's content will be downloaded and saved on the cloud, so the next time you open that same file, the content download won't be necessary, unless you want to. Maybe you changed that file's content in somewhere else and want to force a download to get the current content which is in the device.
|
||||
|
||||
To download the file from the linked device, click on the download icon next to the file name at file tree.
|
||||
|
||||

|
||||
|
||||
That will download the file content from the device and save it into the cloud.
|
||||
|
||||

|
||||
|
||||
*In this case, that file has been updated yesterday.*
|
||||
|
||||

|
||||
|
||||
*After downloading the main.py content from the device.*
|
||||
|
||||
## Upload a file
|
||||
|
||||
After making any changes in a file, you will be able to upload it into your device by clicking on "Save and Upload" link.
|
||||
|
||||

|
||||
|
||||
|
||||
_**Note: That will upload only the current file.**_
|
||||
|
||||
After downloading or uploading a file, its content is stored on the cloud.
|
||||
|
||||
## Update Hierarchy
|
||||
|
||||
If you want to refresh your device's hierarchy in Pymakr, you should click on Refresh Hierarchy icon next to your device name. That will request the hierarchy from the device, creating or deleting folders according to your device's file hierarchy.
|
||||
|
||||

|
||||
|
||||
|
||||
# Pymakr Online not linked to a device
|
||||
|
||||
Pymakr Online can be opened without being linked to a device, from [Pymakr Online](https://www.pybytes.pycom.io/pymakr) initial page.
|
||||
|
||||
Since there's no device linked in this way of opening Pymakr Online, there are no device related actions here (download file, device activity indicator etc). Instead, you decide what you are going to do with your code: upload to a project, download a zip file or upload to a device.
|
||||
|
||||
Before exporting your project, you first need to import a project into Pymakr or start with a blank project:
|
||||
|
||||
## Import code into Pymakr Online
|
||||
|
||||

|
||||
|
||||
*Pymakr Online initial page*
|
||||
|
||||
### 1. Blank project
|
||||
|
||||
This will open Pymakr Online with the essential files of MicroPython project (main.py and boot.py).
|
||||
|
||||
### 2. Project/Release
|
||||
|
||||
1. After clicking on Project button, you will see this page, where you must choose one project:
|
||||
|
||||

|
||||
|
||||
2. And finally, choose the release you want to work with. That will open Pymakr with the files of the selected release.
|
||||
|
||||

|
||||
|
||||
### 3. Device
|
||||
|
||||
At this section you can import the code from a device and work with it in Pymakr Online. Note this won't have any connection to any device once it's loaded.
|
||||
|
||||
1. Choose the device you want to work with:
|
||||
|
||||

|
||||
|
||||
2. If you already worked with that device in Pymakr Online, you can use the latest saved code on the cloud, so the device doesn't need to be online, or even turned on. That will instantly open Pymakr with that code.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
If you want the current files from the device and you are not sure if the saved code on the cloud is up to date, you can download those files from the device by clicking on "Request files from device" button. That will bring you to another modal, which will show you the download progress.
|
||||
|
||||

|
||||
|
||||
Once the download has been completed, you can now work with the device's files in Pymakr Online:
|
||||
|
||||
!
|
||||
|
||||
|
||||
### 4. Zip file
|
||||
|
||||
This feature allows you to upload a zip file of your project into Pymakr Online and start to work with it from there. The zip file can not be bigger than 4MB.
|
||||
|
||||
### 5. Github Repository
|
||||
|
||||
1. Firstly, type the repository name you want to import your code from and press enter:
|
||||
|
||||
!
|
||||
|
||||
2. Then select your repository by clicking on it.
|
||||
|
||||
!
|
||||
|
||||
3. Select the branch
|
||||
|
||||
!
|
||||
|
||||
4. Wait for a few seconds until the download of the files from the selected branch is completed and then you can start working on Pymakr with those files!
|
||||
|
||||
!
|
||||
|
||||
_**Note: There's a usage limit of the Github API. You won't be able to search a lot and select different repositories in the same day. Use this feature with moderation.**_
|
||||
|
||||
|
||||
## Save/Export
|
||||
|
||||
To export your project, ensure that you have opened Pymakr Online from the Pymakr initial page (accessible from the sidebar menu) and not from the device page. For any option here, the size limit is 4MB.
|
||||
|
||||
1. Click on Save/Export button.
|
||||
|
||||

|
||||
|
||||
2. Choose an option:
|
||||
|
||||

|
||||
|
||||
* Upload to a project will be released soon.
|
||||
|
||||
* Create and Download a zip file from all of the files from your project.
|
||||
|
||||

|
||||
|
||||
* You can also export to a device. This modal will open after clicking on "UPLOAD TO DEVICE" button. Note that your device needs to be online in order to receive the files from Pymakr Online.
|
||||
|
||||

|
||||
|
||||
* Wait while Pymakr Online is uploading your project to the selected device.
|
||||

|
||||
|
||||
* Once the upload is done, your device will restart and load the new code.
|
||||

|
||||
|
||||
|
||||
# Create a new file or folder
|
||||
|
||||
To create a file or folder in Pymakr Online, disregarding of how you opened it, you just need to right click on the folder you want to create the file or folder in.
|
||||
|
||||

|
||||
|
||||
In this case, I'm creating a folder called 'new-folder' under the project root. For that, I right clicked on the project name.
|
||||
|
||||
Now type the name of the file/folder:
|
||||

|
||||
|
||||
_**Note: Pymakr Online only supports the formats .py .txt .log .json .html .js .cet .crt**_
|
||||
_**A folder name can not contain dots (.)**_
|
||||
|
||||
If you want to delete a folder or file, right click on the item to be deleted and then click on "Delete file" or "Delete folder".
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
content/tutorials/.DS_Store
vendored
BIN
content/tutorials/.DS_Store
vendored
Binary file not shown.
BIN
static/gitbook/assets/pybytes/pymakr-online/initial.png
Normal file
BIN
static/gitbook/assets/pybytes/pymakr-online/initial.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
BIN
static/gitbook/assets/pybytes/pymakr-online/open-file.png
Normal file
BIN
static/gitbook/assets/pybytes/pymakr-online/open-file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 119 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
BIN
static/gitbook/assets/pybytes/pymakr-online/upload.png
Normal file
BIN
static/gitbook/assets/pybytes/pymakr-online/upload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
Reference in New Issue
Block a user