| Ligne 45 : |
Ligne 45 : |
| | error message something like this: | | error message something like this: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | >./rshell.py | | >./rshell.py |
| | rshell needs MicroPython firmware with ubinascii.unhexlify | | rshell needs MicroPython firmware with ubinascii.unhexlify |
| | + | </nowiki> |
| | | | |
| | Installation | | Installation |
| Ligne 55 : |
Ligne 55 : |
| | You can install rshell using the command: | | You can install rshell using the command: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | sudo pip3 install rshell | | sudo pip3 install rshell |
| | + | </nowiki> |
| | | | |
| | If you use a virtualenv, then you don't need the sudo. rshell needs Python3. | | If you use a virtualenv, then you don't need the sudo. rshell needs Python3. |
| Ligne 64 : |
Ligne 64 : |
| | Debian/Ubuntu users can get pip3 using: | | Debian/Ubuntu users can get pip3 using: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | sudo apt-get install python3-pip | | sudo apt-get install python3-pip |
| | + | </nowiki> |
| | | | |
| | Sample Session | | Sample Session |
| Ligne 74 : |
Ligne 74 : |
| | entering the repl and importing it. | | entering the repl and importing it. |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | >rshell | | >rshell |
| | Welcome to rshell. Use Control-D to exit. | | Welcome to rshell. Use Control-D to exit. |
| Ligne 102 : |
Ligne 101 : |
| | >>> | | >>> |
| | /home/dhylands/Dropbox/micropython/rshell> | | /home/dhylands/Dropbox/micropython/rshell> |
| | + | </nowiki> |
| | | | |
| | Command Line Options | | Command Line Options |
| Ligne 112 : |
Ligne 112 : |
| | following displayed: | | following displayed: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | usage: rshell [options] [command] | | usage: rshell [options] [command] |
| | | | |
| Ligne 142 : |
Ligne 141 : |
| | You can specify the default serial port using the RSHELL_PORT environment | | You can specify the default serial port using the RSHELL_PORT environment |
| | variable. | | variable. |
| | + | </nowiki> |
| | | | |
| | -b BAUD, --baud BAUD | | -b BAUD, --baud BAUD |
| Ligne 235 : |
Ligne 235 : |
| | exit. Examples: | | exit. Examples: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | rshell cp somefile.py /flash | | rshell cp somefile.py /flash |
| | rshell repl ~ pyb.bootloader() ~ | | rshell repl ~ pyb.bootloader() ~ |
| | + | </nowiki> |
| | | | |
| | File System | | File System |
| Ligne 266 : |
Ligne 266 : |
| | ---- | | ---- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | args [arguments...] | | args [arguments...] |
| | + | </nowiki> |
| | | | |
| | Debug function for verifying argument parsing. This function just prints | | Debug function for verifying argument parsing. This function just prints |
| Ligne 276 : |
Ligne 276 : |
| | ------ | | ------ |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | boards | | boards |
| | + | </nowiki> |
| | | | |
| | Lists all of the boards that rshell is currently connected to, their | | Lists all of the boards that rshell is currently connected to, their |
| Ligne 286 : |
Ligne 286 : |
| | --- | | --- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | cat FILENAME... | | cat FILENAME... |
| | + | </nowiki> |
| | | | |
| | Concatinates files and sends to stdout. | | Concatinates files and sends to stdout. |
| Ligne 295 : |
Ligne 295 : |
| | -- | | -- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | cd DIRECTORY | | cd DIRECTORY |
| | + | </nowiki> |
| | | | |
| | Changes the current directory. ~ expansion is supported, and cd - goes | | Changes the current directory. ~ expansion is supported, and cd - goes |
| Ligne 305 : |
Ligne 305 : |
| | ------- | | ------- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | connect TYPE TYPE_PARAMS | | connect TYPE TYPE_PARAMS |
| | connect serial port [baud] | | connect serial port [baud] |
| | connect telnet ip-address-or-name | | connect telnet ip-address-or-name |
| | + | </nowiki> |
| | | | |
| | Connects a pyboard to rshell. rshell can be connected to multiple | | Connects a pyboard to rshell. rshell can be connected to multiple |
| Ligne 317 : |
Ligne 317 : |
| | -- | | -- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | cp SOURCE DEST | | cp SOURCE DEST |
| | cp SOURCE... DIRECTORY | | cp SOURCE... DIRECTORY |
| | + | </nowiki> |
| | | | |
| | Copies the SOURCE file to DEST. DEST may be a filename or a directory | | Copies the SOURCE file to DEST. DEST may be a filename or a directory |
| Ligne 329 : |
Ligne 329 : |
| | ---- | | ---- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | echo TEXT... | | echo TEXT... |
| | + | </nowiki> |
| | | | |
| | Display a line of text. | | Display a line of text. |
| Ligne 338 : |
Ligne 338 : |
| | ---- | | ---- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | edit filename | | edit filename |
| | + | </nowiki> |
| | | | |
| | If the file is on a pyboard, it copies the file to host, invokes an | | If the file is on a pyboard, it copies the file to host, invokes an |
| Ligne 354 : |
Ligne 354 : |
| | -------- | | -------- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | filesize FILE | | filesize FILE |
| | + | </nowiki> |
| | | | |
| | Prints the size of the file, in bytes. This function is primarily | | Prints the size of the file, in bytes. This function is primarily |
| Ligne 364 : |
Ligne 364 : |
| | -------- | | -------- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | filetype FILE | | filetype FILE |
| | + | </nowiki> |
| | | | |
| | Prints the type of file (dir or file). This function is primarily for | | Prints the type of file (dir or file). This function is primarily for |
| Ligne 374 : |
Ligne 374 : |
| | ---- | | ---- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | help [COMMAND] | | help [COMMAND] |
| | + | </nowiki> |
| | | | |
| | List available commands with no arguments, or detailed help when a | | List available commands with no arguments, or detailed help when a |
| Ligne 384 : |
Ligne 384 : |
| | -- | | -- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | usage: ls [-a] [-l] FILE... | | usage: ls [-a] [-l] FILE... |
| | + | </nowiki> |
| | | | |
| | List directory contents. | | List directory contents. |
| Ligne 400 : |
Ligne 400 : |
| | mkdir | | mkdir |
| | ----- | | ----- |
| − | | + | <nowiki> |
| − | ::
| |
| − | | |
| | mkdir DIRECTORY... | | mkdir DIRECTORY... |
| | + | </nowiki> |
| | | | |
| | Creates one or more directories. | | Creates one or more directories. |
| Ligne 410 : |
Ligne 409 : |
| | ---- | | ---- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | repl [board-name] [~ line][ ~] | | repl [board-name] [~ line][ ~] |
| | + | </nowiki> |
| | | | |
| | Enters into the regular REPL with the MicroPython board. Use Control-X | | Enters into the regular REPL with the MicroPython board. Use Control-X |
| Ligne 428 : |
Ligne 427 : |
| | For example, you could use: | | For example, you could use: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | rshell.py repl ~ pyb.bootloader()~ | | rshell.py repl ~ pyb.bootloader()~ |
| | + | </nowiki> |
| | | | |
| | and it will boot the pyboard into DFU. | | and it will boot the pyboard into DFU. |
| Ligne 437 : |
Ligne 436 : |
| | -- | | -- |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | usage: rm [-r|--recursive][-f|--force] FILE... | | usage: rm [-r|--recursive][-f|--force] FILE... |
| | + | <nowiki> |
| | | | |
| | Removes files or directories (directories must be empty). | | Removes files or directories (directories must be empty). |
| Ligne 456 : |
Ligne 455 : |
| | The shell command can also be abbreviated using the exclamation point. | | The shell command can also be abbreviated using the exclamation point. |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | shell some-command | | shell some-command |
| | !some-command | | !some-command |
| | + | </nowiki> |
| | | | |
| | This will invoke a command, and return back to rshell. Example: | | This will invoke a command, and return back to rshell. Example: |
| | | | |
| − | ::
| + | <nowiki> |
| − | | |
| | !make deploy | | !make deploy |
| | + | </nowiki> |
| | | | |
| | will flash the pyboard. | | will flash the pyboard. |