SiPy - No serial output, responds to console commands

  • The last couple of days my sipys has been really close to leaving this world for good.
    Transferring files via FTP, AFTER hooking up on sipy wifi is not cool, but I'll live. Sipy not being able to offer any serial output is really not cool.
    I tried numerous serial monitors in both PyMakr, Arduino IDE, Putty and others. None of these monitors shows any output.
    The sipy responds to commands via serial monitor uch as "os.uname().release" which is "1.6.3.b1" btw.
    Is there some known bugs in the new firmware that has not been found and/or communicated? Or did anyone out there find a viable method on how to make working with the Sipy bearable?
    Also, Filezilla shows my only two files, "" and "" and three empty folders? If any of you got it running in a tolerable manner would you mind posting the proper file/folderstructure as seen from the FTP-client?

    Best, mathias.

  • I know this is very old and by now you may have caught it, but your if loop will always execute. The line

    if mac=='665544332211' or '111111111111': 
        <do stuff>

    is interpreted as

    if (mac == '665544332211') or ('111111111111')

    This always evaluates as True, because bool('111111111111') is True. I believe the only string that can evaluate to False is the empty string.

    This may be part of your problem. What you need is something like

    if (mac == '665544332211') or (mac == '111111111111')

    And if it's a larger list then you can do something like

    if mac in ['665544332211', '111111111111', ...]

  • My sipy is still dysfunctional.
    I can connect via FTP and upload file. Check.
    I can open a serial monitor and write commands. Check.
    But I can't get any output.
    View from arduino serial monitor:

    >>> print("h")
    >>> ets Jun  8 2016 00:22:57
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    mode:QIO, clock div:2
    entry 0x4009fde4
    I (1575) wifi: wifi firmware version: 2a22b2d
    I (1591) wifi: pp_task_hdl : 3ffd6b34, prio:23, stack:8192
    I (1591) wifi: Init lldesc rx mblock:10
    I (1591) wifi: Init lldesc rx ampdu len mblock:7
    I (1593) wifi: Init lldesc rx ampdu entry mblock:4
    I (1598) wifi: sleep disable
    I (2586) wifi: frc2_timer_task_hdl:3ffdcb84, prio:22, stack:2048
    I (2603) wifi: mode : softAP (24:0a:c4:00:f8:9d)
    MicroPython v1.8.6-480-g4e970fe3 on 2017-02-26; SiPy with ESP32
    Type "help()" for more information.

    with a file like this:

    #code block 
    import pycom
    import os
    for cycles in range(10): # stop after 10 cycles
    import binascii
    import socket
    import machine
    from network import Bluetooth
    from network import Sigfox
    from machine import Timer
    #import time
    #initialiser SigFox
    sig = Sigfox(mode=Sigfox.SIGFOX,  rcz=Sigfox.RCZ1)
    s = socket.socket(socket.AF_SIGFOX,  socket.SOCK_RAW)
    s.setsockopt(socket.SOL_SIGFOX,  socket.SO_RX,  False)
    rtc = machine.RTC()
    bluetooth = Bluetooth()
    timeCounter = Timer.Chrono()
    while bluetooth.isscanning():
        adv = bluetooth.get_adv()
        if adv:
            mac = adv[0]
            mac = binascii.hexlify(mac)
            mac = mac.decode()
            if mac=='665544332211' or '111111111111': 
                data = binascii.hexlify(adv[4])
                data = data.decode()
                timeElapsed =
                timeElapsed = round(timeElapsed, 3)
                print(data[24], data[25], data[28], data[29], timeElapsed)
                stringToSend =""
                stringToSend +=str(data[24])
                stringToSend +=str(data[25])
                stringToSend +=str(data[28])
                stringToSend +=str(data[29])
                stringToSend +=str(timeElapsed)

    The code is sending to the sigfox backend. So it's executing well enough.
    Hope you can see some obvious thing I've missed.

  • @maku
    That code does print HELLO to the serial output for me on SiPy 1.6.3b1.

    Can you describe your serial setup? Are you using the Pycom expansion board for that?
    Is you serial monitor set to the correct port and to 115200 bps?

    Can you see the debugging output on the serial console when the SiPy boots up?

  • @jmarcelino Via Filezilla I uploaded and I downloaded both files again to ensure that they are fine. -- run on boot-up

    import os
    from machine import UART
    uart = UART(0, 115200)
    import pycom
    import time
    for cycles in range(10): # stop after 10 cycles

    I would expect to see the Sipy printing "HELLO" in either Pymakr or any other serialmonitor.
    Is that a faulty asumption?
    The board is running

  • Sorry this isn't making sense to me, you say the SiPy doesn't offer any serial output but then also say it responds to commands via the serial monitor.

    Can you clarify what are you doing and expecting to happen ?

Log in to reply

Pycom on Twitter