Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Launching pybytes (pybytes autostart set to off)

    Scheduled Pinned Locked Moved Pybytes IoT platform
    2 Posts 2 Posters 691 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      HansSanitizer
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • J Offline
        jirkakrepl
        last edited by jirkakrepl

        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)
        >>>
        

        software developer @ Pycom

        Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io

        Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom