No console output in PyMakr whatsoever

  • Hi. I have a Pycom WiPy which I have put my code on. It normally works fine and shows me all the print statements in VS Code as it should. However, it has stopped now for some reason.
    This does not change if I use another device (tried with a SiPy + a LoPy as well).
    Nothing happens if I switch device or editor (tried with another computer + several cables and with Atom as well as VS).
    This makes me feel like it is my code, but this is literally what the first lines look like:

    print("------ Booting up... ------")
    print("Reading Data Storage....")
    from network import WLAN
    from machine import RTC, idle, deepsleep, reset
    import ujson
    import time
    import pycom
    import led
    import os
    wlan = WLAN()
    rtc = RTC()

    This makes me very confused. Console output look like this:

    rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    mode:DIO, clock div:1
    entry 0x400a059c

    After all this, I don´t get any output, but my PyCom flashes all the leds it should (as I have coded it to do). But I can´t send KeyboardInterrupts nor upload any new code.
    Any ideas of what could cause this?
    I am developing a production application.

  • @robert-hh I removed the os module and now everything seems to work fine. Thank you so much for actually taking time and helping out :))

  • @techykermit Unless you use them, they do not harm. But for what purpose do you have the os module? That is intended for the Unix port. On a micro, you should use uos, which has os as it's alias.

  • @robert-hh No, unless one of the libraries I am using does that.
    Obviously I don´t expect you to look through them, I can do that tomorrow, but here is a list of everything I currently have in the lib folder:

    • os (from the MicroPython repository on GitHub)
    • The umqtt/simple library (from the MicroPython repository on GitHub)
    • The library from
    • My own internal libraries which do not reconfigure any output or UART0.
    • PyCom´s OneWire library
    • pkg_resources (from the MicroPython repository on GitHub)
    • ulogging (from the MicroPython repository on GitHub)
    • urequests (from the MicroPython repository on GitHub)

  • @techykermit Do you re-map or reconfigure UART0? Or do you use uos.dupterm() to reconfigure the standard output?

  • @robert-hh Yes. As I am developing a production application, I want to disclose as little as possible.

    My code seems to run fine on the board, I have everything mapped to LED colors. I am just not getting any print output.

    Ctrl+F in PyMakr doesn´t work (maps to the Find function in VS Code). Trying with PuTTY, it does nothing.
    I have an Expansion Board 3.0, can I press the "Safe Boot" button on it? I assume that will safe boot it, but when I have tried, nothing really happens.

  • @techykermit Maybe you should shoe more of your code. Because what is above should not cause any harm.

  • @techykermit What happens if you push Ctrl-F? That should force a safe boot.

  • @robert-hh Converting all the files to .mpy does not make any difference at all. The original issue still persists.

    PuTTY gives the same output as PyMakr.

  • @techykermit Yes, Putty is made for that. Take care to set the flow control option in Putty to None.
    Meanwhile I was able to build a version of mpy-cross.exe for today's release. name: mpy-cross_pycom_v4.exe

  • @robert-hh said in No console output in PyMakr whatsoever:

    Edit: as crosscheck when having trouble with pymakr youj should always confirm with a simple console like putty, that not pymakr is the source of trouble.

    I am talking to my device via the COM port. Does Putty work with interacting with the device that way? (Probably dumb question, but I have never sent any commands to a Pycom outside PyMakr. Thonny IDE didn´t detect my Pycom either.)

  • @techykermit Wipy3 should has sufficient RAM. The mpy-cross version I have here should work with v1.18.0. Filename mpy-cross_pycom.exe
    Edit: as crosscheck when having trouble with pymakr youj should always confirm with a simple console like putty, that not pymakr is the source of trouble.

  • @robert-hh I am running Windows 10. Also, I am trying with a WiPy 3. Is MPy-cross compatible with version 1.18.0 (legacy)? In that case, I can just downgrade for now, if you are expecting support for it to be carried on to the newer firmware in the future.

  • @techykermit WiPy2, SiPy and Lopy all have limited RAM. A source code file of 49k may fail on importing/uploading. You could try to pre-compile the files on your computer with mpy-cross and upload the compiled versions.
    Problem: the mpy-cross executable is not published by Pycom. And with today's release they changed the format. So mpy-cross versions that are out ther will not work. Which operating system are you using on you computer?

  • @robert-hh Uploading my code gives the same errors as described earlier (no console output and the second last file fails to upload). I do not understand why, since my project is only 49kb.

  • @techykermit You do not need mkfs after erase & upload. That re-creates the file system. Now you can go on again with uploading your code. Please note, that the REPL prompt only responds after finished. so if you have code in which continues to ruin. you will not get a prompt.

  • @robert-hh I cannot run any commands on the WiPy (it is a WiPy 3). I can open the window to run commands, but the keyboard does not let me type anything.

    I erased all the device content using the firmware updater... or so I thought. What else could the "Erase during flash" option mean?
    Well, with an "erased" WiPy and new firmware, I still got this as the output from your script:

    >>> import uos
    >>> uos.getfree("")
    >>> for e in uos.ilistdir():
    ...         print("%20s %6d" %(e[0], e[3]))
                     sys      0
                     lib      0
                    cert      0

    So, what I do next is to attempt with os.mkfs("/flash"). Got a strange error:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'mkfs'

    This usually doesn´t happen, it should work fine.

    Any ideas of what I can do?

  • @techykermit Maybe just the file system is full. In the REPL window, what is the response to:

    import uos
    for e in uos.ilistdir():
        print("%20s %6d" %(e[0], e[3]))

    Do you have a Wipy2 or WiPy3? The Wipy2 may have too little RAM to run large code.

  • Oh, and I also get some kind of ENOENT error while uploading files.
    This always happens on the second last file, and even though I tried with code that is ~100kb.

    [17/19] Writing file lib/umqtt/ (7kb)
    Failed to write file, trying again...
    Failed to write file, trying again...
    Failed to write file: [Errno 2] ENOENT
    [18/19] Writing file lib/ (3kb)
    [19/19] Writing file (6kb)

Log in to reply

Pycom on Twitter