Merge pull request #261 from pycom/pymakr-online

Pymakr Online
This commit is contained in:
Pedro Knup
2020-05-06 10:59:46 +02:00
committed by GitHub
35 changed files with 280 additions and 46 deletions

View File

@@ -0,0 +1,24 @@
---
title: "Pymakr Online"
aliases:
- pymakr-online/introduction
---
![](/gitbook/assets/pymakr-online/pymakr-online.jpg)
## 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!
* [How to Open Pymakr Online](/pymakr-online/how-to-open)
* [Tools and features](/pymakr-online/toolsfeatures)

View 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
![](/gitbook/assets/pymakr-online/pymakr-online-device.jpg)
### 2. from Pymakr Online initial page, which is accessible from the side bar menu.
![](/gitbook/assets/pymakr-online/pymakr-online-sidebar.jpg)
![](/gitbook/assets/pymakr-online/pymakr-online-initial-page.jpg)
*Pymakr Online initial page*
## The differences between the two ways of opening Pymakr online
### From the device page
![](/gitbook/assets/pymakr-online/pymakr-linked.jpg)
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
![](/gitbook/assets/pymakr-online/pymakr-no-device.jpg)
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:
![](/gitbook/assets/pymakr-online/pymakr-export-modal.png)
*Modal opened after clicking on Save/Export button*

View 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.
![](/gitbook/assets/pymakr-online/pymakr-download-icon.jpg)
That will download the file content from the device and save it into the cloud.
![](/gitbook/assets/pymakr-online/last-update-one-day-ago.jpg)
*In this case, that file has been updated yesterday.*
![](/gitbook/assets/pymakr-online/last-update-few-seconds-ago.jpg)
*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.
![](/gitbook/assets/pymakr-online/save-upload.jpg)
_**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.
![](/gitbook/assets/pymakr-online/pymakr-hierarchy.jpg)
# 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
![](/gitbook/assets/pymakr-online/pymakr-online-initial-page.jpg)
*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:
![](/gitbook/assets/pymakr-online/pymakr-projects.jpg)
2. And finally, choose the release you want to work with. That will open Pymakr with the files of the selected release.
![](/gitbook/assets/pymakr-online/pymakr-releases.jpg)
### 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:
![](/gitbook/assets/pymakr-online/pymakr-devices.jpg)
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.
![](/gitbook/assets/pymakr-online/pymakr-device-import-1.jpg)
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.
![](/gitbook/assets/pymakr-online/pymakr-device-import-2.jpg)
Once the download has been completed, you can now work with the device's files in Pymakr Online:
![](/gitbook/assets/pymakr-online/pymakr-device-import-3.jpg)!
### 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:
![](/gitbook/assets/pymakr-online/pymakr-github-import-1.jpg)!
2. Then select your repository by clicking on it.
![](/gitbook/assets/pymakr-online/pymakr-github-import-2.jpg)!
3. Select the branch
![](/gitbook/assets/pymakr-online/pymakr-github-import-3.jpg)!
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!
![](/gitbook/assets/pymakr-online/pymakr-github-import-4.jpg)!
_**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.
![](/gitbook/assets/pymakr-online/pymakr-export.jpg)
2. Choose an option:
![](/gitbook/assets/pymakr-online/pymakr-export-modal.png)
* Upload to a project will be released soon.
* Create and Download a zip file from all of the files from your project.
![](/gitbook/assets/pymakr-online/pymakr-download-zip.jpg)
* 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.
![](/gitbook/assets/pymakr-online/pymakr-devices-list.jpg)
* Wait while Pymakr Online is uploading your project to the selected device.
![](/gitbook/assets/pymakr-online/pymakr-upload.jpg)
* Once the upload is done, your device will restart and load the new code.
![](/gitbook/assets/pymakr-online/pymakr-download-completed.jpg)
# 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.
![](/gitbook/assets/pymakr-online/pymakr-create-folder.jpg)
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:
![](/gitbook/assets/pymakr-online/pymakr-create-folder-1.jpg)
_**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".
![](/gitbook/assets/pymakr-online/pymakr-create-folder-2.jpg)

View File

@@ -1,44 +0,0 @@
---
title: "Settings"
aliases:
- pymakr/settings.html
- pymakr/settings.md
- chapter/pymakr/settings
---
Below you will find a description of the various settings available for Pymakr.
## address
This is the address of the Pycom module you want Pymakr can connect to. This can be either a serial port (e.g `COM1` on windows or `/dev/cu.usbserial-DQ0054ES` on Linux/macOS) or an IP address (Telnet) (e.g. `192.168.4.1` if connected to the AP created by the Pycom module).
## username
If a IP address was provided for the `address` therefore Pymakr is connecting via Telnet, you will also need to provide a username, the default is `micro`.
## password
If an IP address was provided for the address, Pymakr is connecting via Telnet. You will also need to provide a password, the default is `python`.
## sync\_folder
If left blank, all directories inside the project will be synced to the device when the user clicks `upload`. If directories are specified, only these directories will be synced, all others will be ignored
## open\_on\_start
If set to `true`, the Pymakr console will open and try to connect when the editor is started, or a project is opened.
## safe\_boot\_on\_upload
If set to `true`, Pymakr will reboot the connected device into safe-mode before uploading. This is useful if your code uses a lot of RAM causing issues with the upload procedure.
This feature is only available on modules running firmware version `1.17.0.b1` or higher.
## sync\_file\_types
Only files ending with the extensions listed in this setting will be synced to the device when performing an upload. All other files are ignored. By default this is set to include: `py, txt, log, json, xml`
## ctrl\_c\_on\_connect
If set to `true`, Pymakr will sent the `ctrl-c` signal to the connected module before uploading. This should stop the script currently running on the device and improve the reliability of the upload process.