rshell timed out or error in transfer to remote: b'F'

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
davef
Posts: 180
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

rshell timed out or error in transfer to remote: b'F'

Post by davef » Mon Feb 22, 2021 7:09 am

Found a few threads which suggest that this error message is generated by rshell, I first noticed it when I built v1.14 source for the ESP8266 and tried to flash it.

Code: Select all

cp /home/dave/ESP-07S_Datalogger_project/boot.py /pyboard/
Executing "cp /home/dave/ESP-07S_Datalogger_project/boot.py /pyboard/"
----- About to send 458 bytes of code to the pyboard -----
def get_mode(filename):
    """Returns the mode of a file, which can be used to determine if a file
       exists, if a file is a file or a directory.
    """
    import os
    try:
        # Since this function runs remotely, it can't depend on other functions,
        # so we can't call stat_mode.
        return os.stat(filename)[0]
    except OSError:
        return 0
output = get_mode('/')
if output is None:
    print("None")
else:
    print(output)

-----

-----
----- About to send 2257 bytes of code to the pyboard -----
def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
    """Function which runs on the pyboard. Matches up with send_file_to_remote."""
    import sys
    import ubinascii
    import os
    if False:
        try:
            import pyb
            usb = pyb.USB_VCP()
        except:
            try:
                import machine
                usb = machine.USB_VCP()
            except:
                usb = None
        if usb and usb.isconnected():
            # We don't want 0x03 bytes in the data to be interpreted as a Control-C
            # This gets reset each time the REPL runs a line, so we don't need to
            # worry about resetting it ourselves
            usb.setinterrupt(-1)
    try:
        with open(dst_filename, dst_mode) as dst_file:
            bytes_remaining = filesize
            if not False:
                bytes_remaining *= 2  # hexlify makes each byte into 2
            buf_size = 30
            write_buf = bytearray(buf_size)
            read_buf = bytearray(buf_size)
            while bytes_remaining > 0:
                # Send back an ack as a form of flow control
                sys.stdout.write('\x06')
                read_size = min(bytes_remaining, buf_size)
                buf_remaining = read_size
                buf_index = 0
                while buf_remaining > 0:
                    if False:
                        bytes_read = sys.stdin.buffer.readinto(read_buf, read_size)
                    else:
                        bytes_read = sys.stdin.readinto(read_buf, read_size)
                    if bytes_read > 0:
                        write_buf[buf_index:bytes_read] = read_buf[0:bytes_read]
                        buf_index += bytes_read
                        buf_remaining -= bytes_read
                if False:
                    dst_file.write(write_buf[0:read_size])
                else:
                    dst_file.write(ubinascii.unhexlify(write_buf[0:read_size]))
                if hasattr(os, 'sync'):
                    os.sync()
                bytes_remaining -= read_size
        return True
    except:
        return False
output = recv_file_from_host(None, '/boot.py', 145)
if output is None:
    print("None")
else:
    print(output)

-----
timed out or error in transfer to remote: b'F'

Code: Select all

-----Response-----
b'16384\r\n'
don't know what this refers to, but this seems relevant

Code: Select all

output = recv_file_from_host(None, '/boot.py', 145)
I am guessing None should be something else.

Any suggestions?

davef
Posts: 180
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: rshell timed out or error in transfer to remote: b'F'

Post by davef » Tue Feb 23, 2021 7:56 pm

Found another way to try and get the .bin file on to the ESP8266:

Code: Select all

make PORT=/dev/ttyUSB0 deploy
but come up with this error:

Code: Select all

Writing build-GENERIC/firmware-combined.bin to the board
esptool.py v1.2
Connecting...

A fatal error occurred: Failed to connect to ESP8266
Makefile:199: recipe for target 'deploy' failed
make: *** [deploy] Error 2
And in the Makefile:

Code: Select all

deploy: $(BUILD)/firmware-combined.bin
        $(ECHO) "Writing $< to the board"   (line 199)
        $(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash$

Appreciate any help getting firmware-combined.bin on to the ESP8266.

Thanks,

Post Reply