Scripting using Rshell?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jmu51
Posts: 1
Joined: Mon Feb 25, 2019 10:52 pm

Scripting using Rshell?

Post by jmu51 » Mon Feb 25, 2019 10:57 pm

Hi there,

I've been trying to run a super simple script, where Rshell is used to connect to my pycom board and load a few files onto it. I've run into the issue where the rshell command is executed and the shell is entered, but no further commands are completed. Does anyone know how to script rshell or get a simple batch file to continue on after rshell is called?

Thanks.

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: Scripting using Rshell?

Post by cefn » Sat Mar 23, 2019 10:09 pm

I have previously used rshell's CLI behaviours directly, like this...

https://github.com/vgkits/vanguard/blob ... nd.py#L166

This technique involves manipulating sys.argv to 'pretend' to rshell that it has been invoked with particular command line arguments to perform a task and return. This is different than the invocation which launches a shell and holds on to the interactive tty.

Post Reply