pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
200 stars 166 forks source link

No Pybytes manual connection method works reliably #494

Open zzfjean opened 4 years ago

zzfjean commented 4 years ago

G01, 1.20.1.r1, Pybytes 1.6.0

I cannot use the autostart feature for pybytes for a number of reasons:

I want to be able to handle my own connection using the Pybytes libraries however not having any success:

using connect_lte() or connect_wifi()

from _pybytes_connection import PybytesConnection p = PybytesConnection(pybytes_config,None) p.start_mqtt('lte')

tells me that I've created a successful MQTT connection but no data comes through using pybytes.send_signal(1,1)

What I need......

A reliable way using the pybytes libraries to establish a MQTT connection with Pybytes with me handling the internet connection.

gijsio commented 3 years ago

For anyone still looking for this, the correct way has been added to the docs (https://docs.pycom.io/pybytes/api/) Use the following:

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

pybytes.start()

Note that you do need a pybytes configuration file on the device.