Skip to content

Adding LoRaWAN docs for Mbed-OS 5.8 #414

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

Merged
merged 15 commits into from
Mar 12, 2018
Merged

Adding LoRaWAN docs for Mbed-OS 5.8 #414

merged 15 commits into from
Mar 12, 2018

Conversation

hasnainvirk
Copy link
Contributor

No description provided.

@hasnainvirk
Copy link
Contributor Author

@AnotherButler Please review. This will go first ARMmbed/mbed-os#6087

Copy link

@AnttiKauppila AnttiKauppila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

|`TX_DONE` | When a packet is transmitted |
| `TX_TIMEOUT` | When stack was unable to send packet in TX window |
| `TX_ERROR` | A general TX error |
| `TX_CRYPTO_ERROR` | f MIC fails, or any other crypto relted error |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"f" -> "If"
"relted" -> "related"

| `TX_TIMEOUT` | When stack was unable to send packet in TX window |
| `TX_ERROR` | A general TX error |
| `TX_CRYPTO_ERROR` | f MIC fails, or any other crypto relted error |
| `TX_SCHEDULING_ERROR` | hen stack is unable to schedule packet |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hen" -> "When"

return battery_level;
}

callbacks.link_check_resp = mbed::callback(your_lbattery_level);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callbacks.battery_level = mbed::callback(your_battery_level);

|`LORAWAN_STATUS_PORT_INVALID` | -1015 | Invalid port |
|`LORAWAN_STATUS_CONNECT_IN_PROGRESS` |- 1016 | Connection in progress (application should wait for CONNECT event) |
|`LORAWAN_STATUS_NO_ACTIVE_SESSIONS` | -1017 | No active session in progress |
|`LORAWAN_STATUS_IDLE` |- 1018 | Stack idle at the moment|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table does not show up properly

|`LORAWAN_STATUS_LENGTH_ERROR` |- 1010 | Payload lenght error |
| `LORAWAN_STATUS_DEVICE_OFF`| -1011 | the device is off, i.e., disconnected state |
| `LORAWAN_STATUS_NOT_INITIALIZED` | -1012| Stack not initialized |
| `LORAWAN_STATUS_UNSUPPORTED` | -1013|hUnsupported service |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hUnsupported" -> "Unsupported"

| `LORAWAN_STATUS_FREQ_AND_DR_INVALID` | -1006| When stack was unable to send packet in TX window |
|`LORAWAN_STATUS_NO_NETWORK_JOINED` | -1009 | Device is not part of a network yet (Applicable only for OTAA) |
|`LORAWAN_STATUS_LENGTH_ERROR` |- 1010 | Payload lenght error |
| `LORAWAN_STATUS_DEVICE_OFF`| -1011 | the device is off, i.e., disconnected state |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the" -> "The"

|`LORAWAN_STATUS_WOULD_BLOCK`| -1001 | Stack cannot send at the moment or have nothing to read|
| `LORAWAN_STATUS_SERVICE_UNKNOWN`| -1002 | Unknown service request |
| `LORAWAN_STATUS_PARAMETER_INVALID`| -1003 | Invalid parameter |
| `LORAWAN_STATUS_FREQUENCY_INVALID` | -1004| Invalid frequency |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistensy, please check spaces around "|" -characters

@hasnainvirk
Copy link
Contributor Author

@kivaisan I will send a patch shortly.

Copy link
Contributor

@AnotherButler AnotherButler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hasnainvirk Thanks for the great docs. I've left a few comments and queries for you to address.

@@ -6,6 +6,7 @@ The [APIs](/docs/v5.7/introduction/glossary.html) in this document are organized
- [Drivers](/docs/v5.7/reference/drivers.html): analog and digital input and outputs and digital interfaces.
- [RTOS](/docs/v5.7/reference/rtos.html): handling tasks and events in Mbed OS.
- [Network Socket](/docs/v5.7/reference/network-socket.html): network sockets, Ethernet, Wi-Fi, cellular and mesh networking.
- [LoRaWAN](/docs/v5.8/reference/lorawan.html): low power wide area network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for remembering to add this section.


[![View code](https://www.mbed.com/embed/?type=library)](http://os-doc-builder.test.mbed.com/docs/v5.8/mbed-os-api-doxy/class_l_o_r_a_radio.html)

### LoRaRadio example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an example here from Mbed teams. For an example, please see the LowPowerTicker user API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnttiKauppila Could you please communicate to Amanda through email the reason why we are not posting an embedded example ? I didn't not get hold of the full context when we were discussing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnotherButler Okay, I got clearance to tell you the reason. Please note that we do have a very simple example code which do exist at os.mbed.com, https://os.mbed.com/teams/mbed-os-examples/code/lorawan-example/. But this is private. We can't make it public as it will need at least two months of process through legal and we don't have enough time for it. So for the time being it will suffice to just provide a link for the github repository which contains full example code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this going in without an example for now, but we should add an example as soon as possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Amanda, example is now public and ready for Online compiler

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### LoRaRadio class reference

[![View code](https://www.mbed.com/embed/?type=library)](http://os-doc-builder.test.mbed.com/docs/v5.8/mbed-os-api-doxy/class_l_o_r_a_radio.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't work. Please fix it or let me know when it will go into effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will work after the release. I am not sure. I just followed what others had been doing here. Seemingly, the script to fetch doxygen from Mbed-OS would make it work during the release process.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Arm Mbed OS provides a native network stack for LoRaWAN, which can run on any Mbed Enabled device with a LoRa radio onboard.

The [LoRaWANInterface](https://github.com/ARMmbed/mbed-os/blob/feature-lorawan/features/lorawan/LoRaWANInterface.h) provides a C++ API for connecting to the internet over a LoRa network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer not to link to GitHub. Is there a Doxygen page we could link to, instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnttiKauppila This relates to #414 (comment). Please clarify the reason to Amanda.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnotherButler Please check this #414 (comment)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use real doxygen tag here, but can we change this after release Amanda when we know the real path? Or is there already some doxygen generated for the release?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## LoRaWANInterface class reference

[![View code](https://www.mbed.com/embed/?type=library)](http://os-doc-builder.test.mbed.com/docs/v5.8/mbed-os-api-doxy/class_l_o_r_a_w_a_n_interfcae.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This link doesn't work even after I update the spelling to "interface.html" Please fix it or let me know when it will go into effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh. The spellings :) I wrote this document when I was travelling and had terrible flu :) Affects are pretty obvious. Yeah, the link may work only after the release. I am not actually sure how this works. My assumption is that when you will update docs for 5.8 (during release process), a script will fetch doxygen and this link would start working.


To bring up the Mbed LoRaWAN stack, consider the following progression:

1) An [EventQueue](https://os.mbed.com/docs/v5.8/reference/eventqueue.html) object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query: Do these numbers indicate steps that need to happen in order? Or is it more of a logical grouping of items? [This only matters because we use numbers for ordered steps and bullets for unordered groupings.]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its an ordered progression.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,91 @@
<h2 id="lorawan-configuration">Configuring Mbed LoRaWAN Stack</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this content should go on this page: https://github.com/ARMmbed/Handbook/blob/new_engine/docs/reference/configuration/Connectivity.md

Do you mind if we move it there and make it match that format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid not. There are many reasons why not. For instance, LoRaWAN is non-IP that's why it is out of the Network Socket scope. Secondly, the purpose of this page is just to let user know what he can overwrite in terms of configuration and how to do it. I think the link you provided, is used for creating json config files for embedded example codes which are then exported to Online Compiler. We are not embedding any example in the docs at the moment (@AnttiKauppila will communicate the reason).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hasnainvirk Thanks for the response.

  • The linked page is for all connectivity, not just IP.
  • If you like, we can add an empty line between the components, the way we did between the general purpose file system and LittleFS-specific configs: https://github.com/ARMmbed/Handbook/blob/new_engine/docs/reference/configuration/Storage.md
  • I don't understand your next point. The purpose of the page I linked is also to let users know what they can overwrite in terms of configuration. Could you please elaborate?
  • Thank you and @AnttiKauppila for clarifying about the examples. It makes sense not to include private examples.


### LoRaWAN example

Please visit our [github example repository](https://github.com/ARMmbed/mbed-os-example-lorawan) and follow the instructions in the `README.md`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move this example to Mbed teams? I don't have permissions to, but I would like to transclude this example like we do for other APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnttiKauppila Related to the comments above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnotherButler Please check this #414 (comment)

Copy link

@AnttiKauppila AnttiKauppila Mar 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be used here as a correct link: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-lorawan

I don't have access to Hasnain's fork or this repo, so could you please replace this Amanda?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pekka has corrected this link already together with Antti.


#### Link check response handler

This callback is added when it is desired to send a link check request MAC command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query: Could you please rephrase this sentence? I'm not sure what it means.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will try to make it more clearer.

Hasnain Virk and others added 5 commits March 2, 2018 12:56
Update content to fit our template.
Copy edit for branding, formatting and minor grammar fixes.
Copy edit for active voice, consistent tense and spelling.
Spelling mistakes are corrected.
Table in error codes is streamlined.
Context clearance in lorawanevents.md
@hasnainvirk
Copy link
Contributor Author

@kivaisan @AnotherButler Please review again.

Copy link

@kivaisan kivaisan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fix those extra spaces in error codes. Otherwise ok

|`LORAWAN_STATUS_PORT_INVALID`| -1015 | Invalid port |
|`LORAWAN_STATUS_CONNECT_IN_PROGRESS`|- 1016 | Connection in progress (application should wait for CONNECT event) |
|`LORAWAN_STATUS_NO_ACTIVE_SESSIONS`| -1017 | No active session in progress |
|`LORAWAN_STATUS_IDLE`|- 1018 | Stack idle at the moment|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space between - and the number for these errors:
-1010
-1016
-1018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AnotherButler, would it be possible for you to do these 3 whitespace modifications Kimmo requested? Both Hasnain and Kimmo are on holiday.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnttiKauppila Sure thing. I'll do that shortly.

Amanda Butler and others added 10 commits March 5, 2018 17:30
Update spacing formatting.
Standardize spacing, and remove Latin abbreviation.
Update links for proper rendering.
Update link from filesystem to LoRaWAN.
Update example formatting to match other APIs, and fix spacing in ordered progression.
Update formatting again for consistency.
Update example link because the engine can be picky.
Update links for rendering and so as not to link to GitHub.
@AnotherButler AnotherButler merged commit 5da8d50 into ARMmbed:new_engine Mar 12, 2018
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

Successfully merging this pull request may close these issues.

5 participants