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
    pycom.heartbeat(False)
    led.Startup()
    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
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1688
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14592
    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 dth.py library from https://forum.pycom.io/topic/1172/pure-python-library-for-reading-dht-sensor-on-pycom-boards
    • 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 https://github.com/robert-hh/Shared-Stuff 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 main.py finished. so if you have code in main.py 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("")
    4066
    >>> for e in uos.ilistdir():
    ...         print("%20s %6d" %(e[0], e[3]))
    ...
                 main.py     34
                     sys      0
                     lib      0
                    cert      0
                 boot.py     29
    

    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
    uos.getfree("")
    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/simple.py (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/urequests.py (3kb)
    [19/19] Writing file main.py (6kb)
    

Log in to reply
 

Pycom on Twitter