Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Pybytes manual connection method works reliably #494

Open
zzfjean opened this issue Nov 1, 2020 · 1 comment
Open

No Pybytes manual connection method works reliably #494

zzfjean opened this issue Nov 1, 2020 · 1 comment

Comments

@zzfjean
Copy link

zzfjean commented Nov 1, 2020

G01, 1.20.1.r1, Pybytes 1.6.0

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

  • Only supports single wifi ssid - where I need multiple
  • Cannot set devices to STA_AP mode without dropping pybytes connection
  • lte.attach hangs of there are no towers in range, stopping the whole application

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

  • Apart from the fact that these functions re-establishes the connection after I already created one, there is a bigger issue that it breaks the Pymakr remote REPL console, most likely due to some clash with the existing connnection I've created?
    using

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
Copy link
Contributor

gijsio commented Jan 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants