Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FEATURE REQUEST] Update module to API1 or API2 through library #241

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

Closed
brandonmoser opened this issue May 21, 2021 · 5 comments
Closed

Comments

@brandonmoser
Copy link
Member

The library should have a function to set the API mode and not require XCTU (or other serial connection). If, during device.open(), it is found to be in AP0 (transparent) mode, automatically switch the mode so that all other commands work, as expected.

@tatianaleon
Copy link
Contributor

Hi @brandonmoser,

The library already includes a force_settings option in the open() method to establish the serial connection with the specified serial settings, configuring the XBee with the selected serial values, and setting the operating mode to API without escapes (AP=1). For example, to connect with the XBee attached to the port /dev/ttyUSB0 using a baud rate of 115200, use:

xbee = XBeeDevice(port="/dev/ttyUSB0", baud_rate=115200)
xbee.open(force_settings=True)

This configures the XBee to work in API without escapes (AP=1) and a baud rare of 115200 (BD=7) if it is not already, then opens the serial connection.

Best Regards.

@brandonmoser
Copy link
Member Author

thanks @tatianaleon. I didn't see this in the Getting Started doc, only that I would need to use XCTU to set the AP mode. Can we note that the Getting Started guide should note this functionality?

@tatianaleon
Copy link
Contributor

Hi @brandonmoser,

For the get started process there are more things to configure apart from the mode of an XBee, for example, to create a network or connect to an access point. So, for the moment, we are going to leave it as it is. But, we can add some information for the connect method at:

https://xbplib.readthedocs.io/en/latest/user_doc/working_with_xbee_classes.html#open-the-xbee-device-connection

@brandonmoser
Copy link
Member Author

Thanks Tatiana. I think anything we can do to make the Getting Started process simpler for developers is great.

tatianaleon added a commit that referenced this issue Jun 4, 2021
tatianaleon added a commit that referenced this issue Jun 4, 2021
tatianaleon added a commit that referenced this issue Jun 4, 2021
@tatianaleon
Copy link
Contributor

Hi @brandonmoser,

We added some information about the open() method in the documentation. For the moment, closing this issue.

Best Regards.

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

No branches or pull requests

2 participants