Unable to Program SiPy

  • Despite some initial success, I am unable to program SiPy module. My main setup is Windows 7 64-bit, using Atom and most recent Pymakr package, and a PyCom SiPy w/ Expansion Board 2.0. I have the latest firmware for the boards.

    Here is a detailed description of troubleshooting/results:

    1. Unboxing/Setup
      - Connected over serial. Updated to latest firmware with wizard.
      - Able to program the device over REPL in Atom

    2. Building a project
      - Moved main and boot files inside of the project folder
      - Synchronized and ran perfectly. Checked Sigfox backend and saw all messages received

    3. Failures with Atom
      - REPL began locking up. I was either left at “Connecting on COMxx” or could see the “>>>,” but could not type anything.
      - Inconsistent: I could program if I unplugged and plugged back in. Sometimes, though connected the REPL would lock.

    4. Troubleshooting (With no Success)
      - OS: Also tried Xubuntu. Was not even able to update firmware.
      - Hardware: Tried multiple cables, another module, and another expansion board. Board is in correct orientation.
      - Firmware: I am updated to the latest version. I had some success restoring to factory firmware, but then lost ability again to program and updated to latest again.
      - Serial: Also tried VS Code, PuTTY, and Python 2.7's serial module, all of which I was successful with before any issues began. I am using the correct baud rate, and port, and have the latest drivers installed.
      - Telnet: Tried with Mac OSX Laptop and with iPhone (SSH Client Free app). I get a response, but still cannot type. I am simply left with this response and no '>>>' for entering commands:

      MicroPython v1.8.6-776-gd0a46cd on 2017-09-29; SiPy with ESP32
      Login as: Password:
      Login succeeded!
      Type "help()" for more information

    I may post this in another part of the discussion board as well, since there seems to be more support for LoPy, and the issue is not necessarily just for SiPy.

    TL;DR my SiPy connects to and is recognized by my computer, but I cannot program it.

  • @jcaron It worked! My bad. Didn't even think about that. I erased flash memory and uploaded most recent firmware. Thank you @robert-hh as well.

    For the future, are there any best practices for connecting/disconnecting, from both a hardware and software standpoint. e.g. my boot.py file:

    import os
    from machine import UART
    uart = UART(0, 115200)

    Should I include anything else?

  • @choco IIRC you need to be in upgrade mode (connect P23-GND on boot) to use esptool.

  • @robert-hh I'm on Windows, but I got this output:

    ...\Pycom Firmware Update\Upgrade\bin> esptool.py --port COM23 erase_flash
    esptool.py v2.0-beta1
    A fatal error occurred: Failed to connect to Espress if device: Timed out waiting for packet header

  • @choco The serial connection is independent from the SiPy, since it is provided by the USB/UART bridge, which works, even when the SiPy is silent. What confuses me is that you see the splash screen of MicroPython, but no >>> prompt. Could you try ro erase flash and then re-load the firmware. For erasing you need esptool.py, which is in the subdirectory of the updater software. And then, in a command window, run:
    python3 esptool.py --port COM23 erase_flash

  • Ctrl-C does nothing as well (and I have my project and global settings marked true for Ctrl-C on Connect). The REPL is entirely locked and unresponsive. When I open Atom, this is what I see:

    Connecting on COM23...         # I open Atom
    Cancelled                      # I hit "reconnect" after a while
    Connecting on COM23...
    > Failed to connect (Error: Port is not open). Click here to try again.    # Same line twice
    > Failed to connect (Error: Port is not open). Click here to try again.
    []    # Flashing cursor

    Device manager shows USB Serial Port 23 as active when I plug the SiPy in, and it disappears when I remove it. Further, if I open a session in PuTTY, though I cannot issue any commands, when I close out of PuTTY, I get a dialog box asking if I want to close the session.

  • @choco this may sound silly, but have you tried Ctrl-C? While your boot.py/main.py is running, REPL is not available unless you terminate the currently running script.

Pycom on Twitter