dhylands / rshell

Remote Shell for MicroPython
MIT License
951 stars 134 forks source link

executing repl command outputs empty stderr #126

Open minusplusminus opened 4 years ago

minusplusminus commented 4 years ago

Hi,

I have an issue with executing python inline rshell -p /dev/cu.SLAB_USBtoUART repl "~ import test ~"

import network
import config

sta_if = network.WLAN(network.STA_IF)

if not sta_if.isconnected():
    print('connecting to network...')
    sta_if.active(True)
    sta_if.connect(config.wifi_config['ssid'], config.wifi_config['password'])
    while not sta_if.isconnected():
        pass
print('network config: {}'.format(sta_if.ifconfig()))

when I change it to:

import network
import config
import time
sta_if = network.WLAN(network.STA_IF)

if not sta_if.isconnected():

    sta_if.active(True)

    sta_if.connect(config.wifi_config['ssid'], config.wifi_config['password'])

    while not sta_if.isconnected():
        print('checking..')
        time.sleep(1)
        pass

print('network config: {}'.format(sta_if.ifconfig()))

it works. Without print('checking..') the feed stops this returns an empty stderr and breaks the feed :(

update: I know what the problem is: when I comment put these two lines:

if self.quit_when_no_output:
    break

line 2429

it doesn't exit anymore

davehylands commented 4 years ago

Are the snippets above the contents of test.py ?

minusplusminus commented 4 years ago

Yes