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 functionpybytes.start()You will need to instantiate
pybytesobject manually. Basically do the steps that this code is doing, whenpybytes_autostartisTrue. 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_autostartwas 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) >>>
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