for the JavaScript file upload-ssl-certs-to-bg96.js
All three files have to be provided in PEM format. As this format is in ASCII, you can just cut and paste the contents to the JavaScript source code.
Then transfer the code to the device (using the Espruino IDE) and call function
uploadCertificates();
The files will be saved to the device as cert.pem, key.pem and cacert.pem and can be used in a later step to configure the SSL connection options for the embedded MQTT stack.
____ _
| __|___ ___ ___ _ _|_|___ ___
| __|_ -| . | _| | | | | . |
|____|___| _|_| |___|_|_|_|___|
|_| espruino.com
1v99 (c) 2018 G.Williams
Espruino is Open Source. Our work is supported
only by sales of official boards and donations:
http://espruino.com/Donate
>
>uploadCertificates();
Connecting Cellular Modem ...
=undefined
Cellular Modem connected.
Files in file system: +QFLST: "cacert.pem",1187
+QFLST: "cert.pem",1224
+QFLST: "key.pem",1679
+QFUPL line: +QFUPL: 1224,380d Uploaded cert.pem
+QFUPL line: +QFUPL: 345,1203 Uploaded key.pem
+QFUPL line: +QFUPL: 1187,2d19 Uploaded cacert.pem
Successfully uploaded SSL certificates to BG96 module.
>
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
Create headers by underlining text with ==== or ----
To *italicise* text put one asterisk each side of the word
To **bold** text put two asterisks each side of the word
Embed images by entering: ![](https://www.google.co.uk/images/srpr/logo4w.png) That's the hard one: exclamation, square brackets and then the URL to the image in brackets.
* Create lists by starting lines with asterisks
1. Create numbered lists by starting lines with a number and a dot
> Quote text by starting lines with >
Mention another user by @username
For syntax highlighting, surround the code block with three backticks:
```
Your code goes here
```
Just like Github, a blank line must precede a code block.
If you upload more than 5 files we will display all attachments as thumbnails.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Some IoT platforms like AWS IoT require you to authenicate with X.509 client certificates when using MQTT as communication protocol for your devices.
The Quectel BG96 module on the RAK8212 already has an embedded MQTT stack, so there is no need for using a MQTT library on the device’s MCU.
The BG96 module supports client and server side authentication using X.509 certificates. The following files must be provided:
The challenge is: How can these files be transfered to the BG96 module’s file system?
Having Espruino installed on the RAK8212, this is not a complicated task. Check my github account at
https://github.com/wklenk/rak8212-espruino-nb-iot
for the JavaScript file upload-ssl-certs-to-bg96.js
All three files have to be provided in PEM format. As this format is in ASCII, you can just cut and paste the contents to the JavaScript source code.
Then transfer the code to the device (using the Espruino IDE) and call function
The files will be saved to the device as cert.pem, key.pem and cacert.pem and can be used in a later step to configure the SSL connection options for the embedded MQTT stack.