Code Monkey home page Code Monkey logo

pymakr-atom's Introduction

Pymakr Atom Package

Pymakr enables you to communicate to your Pycom board using the build in command line REPL. Run a single file to your board, sync your entire project or directly type and execute commands.

  • Works with Mac OSX, Linux and windows.
  • Connects to any Pycom board: WiPy, WiPy2.0, LoPy and any newer board.
  • Works best with firmware 1.6.11.b1 and higher. Earlier firmware might have unexpected behaviour when synchronizing files over serial.

More info and documentation can be found on https://docs.pycom.io/

Usage

The commandline will open by default after the package is installed. Use the 'settings' button on the right to setup the board. After changing the settings, press the 'connect' button to connect using the new settings.

At any time, use the 'close' button on the far right to close the commandline. The connection to the devices will always be closed when the terminal closes. Resetting a connection is done by clicking the 'Reconnect' button.

Useful keymaps:

  • ctrl-opt/alt-c: (Re)connect
  • ctrl-opt/alt-t: Toggle terminal
  • ctrl-opt/alt-s: Synchronize project
  • ctrl-opt/alt-r: Run current file

Settings

To connect to your board, use the 'settings' button on the right top of the terminal to go to the plugin settings. You can also use cmd-, (ctrl-, on windows and linux) and navigate to the Pymakr package settings.

Fill in the correct IP address or comport for your device. If you changed your username and password to something else than 'micro' and 'python', please update them accordingly if you connect over IP. Username and password are not required when using serial.

If you want to synchronize a subfolder of your project instead of the entire project, enter the name of the subfolder in the 'sync folder' field (for more info, see the Sync chapter below)

REPL

Using the REPL is easy and works the same way as your commandline based telnet or serial connection to your board. Type any micro-python command, use tab to auto-complete, arrow keys to go back in history and any of the following commands:

  • CTRL-B: Enter friendly REPL
  • CTRL-C: Stop any running code
  • CTRL-D: Soft reset
  • CTRL-E: Paste mode

Ctrl-C and Ctrl-V (or cmd-c/cmd-v on mac) can also be used to copy and paste in the console.

Run

The 'run' button on the right top of the commandline will run the code from the currently open file to the connected board. Any print output or exceptions from this code will appear in the commandline

Sync

The 'sync' button will synchronize all files in your project to the board. Make sure you have a main.py and boot.py file in your project if you want to make sure your board will run properly. After synchronizing, the board will be reset. it might take a few seconds to reconnect if you are using a telnet connection.

If you want to sync only a certain folder in your project, use the 'Sync folder' field in the settings and add the folder name.

By default, only the following file types are synchronized: py, txt, log, json and xml. This can be changed using the 'Sync file types' field in the settings.

The sync limit is set to 350kb. If you sync folder contains more than that, the terminal will refuse to sync.

Manual install

To manually install the plugin, follow these steps

  • Delete any existing installation of the plugin
  • Download the code from github
  • Override all files in the ~/.atom/packages/Pyakr folder
  • If you haven't installed Pymakr before, place the files in any folder and run apm link
  • Run the commands apm install (or npm install if apm is not available) from package folder
  • Restart atom

Common issues

Failed to load package: Cannot find module 'serialport'

In some cases this is caused by the atom package manager (apm) using python 3.x, while node-gyp (used for compiling the serialport lib) needs python 2.x. To confirm this, apm --version can be run to check which python version apm is using.

Solution: Tell the package manager to use python 2 instead. Running the following command switches apm to 2.7:

echo "python=/usr/bin/python2.7" >> ~/.atom/.apmrc

Now reinstall Pymakr or run apm install from the Pymakr package located in ~/.atom/packages/Pymakr

Synchronizing a project results in 'Failed to allocate memory' error

Synchronizing takes a bit of memory, so this error can occur when code running on the board already is taking a substantial amount of memory.

Solution: Run the board in safe mode when synchronizing

pymakr-atom's People

Contributors

ralphhogenbirk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.