-
Notifications
You must be signed in to change notification settings - Fork 81
Pb 833 documentation of pybytes library api #206
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
Pb 833 documentation of pybytes library api #206
Conversation
…a-server Pb 787 documentation for pycom lora server
content/pybytes/api/send_signal.md
Outdated
- pybytes/api/send_signal | ||
--- | ||
|
||
Send signal to the given pin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's replace the word pin
with signal_number
.
I know that in the code the parameter name is still named pin
. But it can confuse users, it does not have anything common with hardware pins on a device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, in the future, it's worth to change the parameter name from pin
to signal_number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please exchange the pin
parameter to signal_number
on this page.
Yes, I think it is a good idea to change the parameter name in the code. Please do it now, and create PR in pybytes-devices repository
content/pybytes/api/update_config.md
Outdated
**Example** | ||
---- | ||
`pybytes.update_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` | ||
|
||
**Success Response** | ||
---- | ||
|
||
TBD test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's write some good example here, please. And complete the response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not see the difference between pybytes.update_config
and pybytes.set_config
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works I've just updated wifi password. Please use this as an example in docs.
Also, write a Success response. thanks
>>> pybytes.print_config()
wifi = {'ssid': 'Pycom', 'password': 'PyE!ndh0ven#'}
cfg_msg = Pybytes configuration read from /flash/pybytes_config.json
wlan_antenna = 0
ota_server = {'port': 443, 'domain': 'software.pycom.io'}
server = mqtt.pybytes.pycom.io
ssl = False
lte = {'apn': 'soracom.io', 'cid': 1, 'reset': False, 'carrier': 'standard', 'band': 99, 'type': 'IP'}
device_id = 9305509f-4ea8-4d6b-824f-539c39e7ddf2
network_preferences = ['lte', 'wifi']
pybytes_autostart = True
dump_ca = False
username = [email protected]
>>>
>>>
>>> pybytes.update_config(key="wifi", value={'password': 'Pa$$w0rd'}, permanent=True, silent=False, reconnect=False)
Pybytes configuration written to /flash/pybytes_config.json
>>>
>>>
>>> pybytes.print_config()
wifi = {'ssid': 'Pycom', 'password': 'Pa$$w0rd'}
cfg_msg = Pybytes configuration read from /flash/pybytes_config.json
wlan_antenna = 0
ota_server = {'port': 443, 'domain': 'software.pycom.io'}
server = mqtt.pybytes.pycom.io
ssl = False
lte = {'apn': 'soracom.io', 'cid': 1, 'reset': False, 'carrier': 'standard', 'band': 99, 'type': 'IP'}
device_id = 9305509f-4ea8-4d6b-824f-539c39e7ddf2
network_preferences = ['lte', 'wifi']
pybytes_autostart = True
dump_ca = False
username = [email protected]
>>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok it should work if a key you're trying to update is an object. if you have lte object in your confing, this should work:
pybytes.update_config(key="lte", value={'band': 99}, permanent=True, silent=False, reconnect=False)
I think it does not work on arrays like network_preferences
I wrote a ticket for this bug and assigned it to you. Thank you
https://pycomiot.atlassian.net/browse/PB-861
content/pybytes/api/write_config.md
Outdated
- pybytes/api/write_config | ||
--- | ||
|
||
Write device configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at this method and it is the private method which sneaked to public API
It will write config from self.__conf to a file
Let's remove this method from documentation
content/pybytes/api/write_config.md
Outdated
- pybytes/api/write_config | ||
--- | ||
|
||
Write device configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at this method and it is the private method which sneaked to public API
It will write config from self.__conf to a file
Let's remove this method from documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes for readability (please also double check the 0-99 debugging level)
content/pybytes/api/_index.md
Outdated
aliases: | ||
--- | ||
|
||
To test Pybytes library API, connect your device to Pymakr and call the methods listed below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st comment: To test the Pybytes library API, connect your device to Pymakr and call the methods listed below.
content/pybytes/api/_index.md
Outdated
--- | ||
|
||
To test Pybytes library API, connect your device to Pymakr and call the methods listed below. | ||
You can use Pybytes library API in your MicroPython project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2nd comment: You can use the Pybytes library API in your MicroPython project.
content/pybytes/api/_index.md
Outdated
|
||
|
||
### Debugging | ||
If you are facing any issues try to enable debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3rd comment: Enable debugging if you are having any issues. There are multiple debug levels, the lowest is 0 which is for warnings only and 99 is the highest used and will print more debugging messages.
content/pybytes/api/_index.md
Outdated
|
||
### Debugging | ||
If you are facing any issues try to enable debugging. | ||
There are multiple debug levels, 0 is warnings only, 99 is currently the highest used). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4th comment: ( I have just moved this sentence into the 3rd comment, so you can delete it)
content/pybytes/api/deepsleep.md
Outdated
|
||
**Success Response** | ||
---- | ||
After sleep, device reconnect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5th comment: After deepsleep, the device reconnects.
- pybytes/api/set_custom_message_callback | ||
--- | ||
|
||
Send custom message callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7th comment: Sends custom message callback.
content/pybytes/api/start.md
Outdated
- pybytes/api/start | ||
--- | ||
|
||
Starts Pybytes library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8th comment: Opens the Pybytes library.
content/pybytes/api/read_config.md
Outdated
- pybytes/api/read_config | ||
--- | ||
|
||
Reads configuration from the given file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads the configuration from the given file.
content/pybytes/api/connect_wifi.md
Outdated
- pybytes/api/connect_wifi | ||
--- | ||
|
||
Initialize watchdog for WiFi and LTE connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize watchdog for the WiFi and LTE connection.
content/pybytes/api/print_config.md
Outdated
- pybytes/api/print_config | ||
--- | ||
|
||
Prints current configuration in the terminal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prints the current configuration in the terminal.
This PR contains Pybytes API library documentation