Launching pybytes (pybytes autostart set to off)



  • I was wondering if there was a command to launch Pybytes manually from within a script, after having the device start up with pybytes disabled.



  • Hi,
    there is, we have function pybytes.start()

    You will need to instantiate pybytes object manually. Basically do the steps that this code is doing, when pybytes_autostart is True. https://github.com/pycom/pycom-micropython-sigfox/blob/pybytes-master/esp32/frozen/Base/_main.py#L21-L45

    >>> from _pybytes_config import PybytesConfig
    >>> pybytes_config = PybytesConfig().read_config()
    >>> from _pybytes import Pybytes
    >>> pybytes = Pybytes(pybytes_config)
    

    this is how the full output if pybytes_autostart was false and how I manually connected to Pybytes later.
    (you can see the message: Not starting Pybytes as auto-start is disabled)

    rst:0x1 (POWERON_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
    Pybytes configuration read from /flash/pybytes_config.json
    Not starting Pybytes as auto-start is disabled
    Pycom MicroPython 1.18.2.r6 [v1.8.6-849-a210e85] on 2019-05-13; WiPy with ESP32
    Type "help()" for more information.
    >>> from _pybytes_config import PybytesConfig
    >>> pybytes_config = PybytesConfig().read_config()
    >>> from _pybytes import Pybytes
    >>> pybytes = Pybytes(pybytes_config)
    WMAC: 240AC40B3A1C
    Firmware: 1.18.2.r6
    Pybytes: 0.9.12
    >>> pybytes.connect()
    Initialized watchdog for WiFi and LTE connection with timeout 660000 ms
    WiFi connection established
    WARNING: consider enabling TLS by using pybytes.enable_ssl()
    Connected to MQTT 10.0.0.66
    Pybytes connected successfully (using the built-in pybytes library)
    >>>
    

Log in to reply
 

Pycom on Twitter