-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Those are: - usbRebootExample - gnssFixOverMqtt - awsExpressLinkDemo - tobyL2-Fota
- Loading branch information
Showing
7 changed files
with
595 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// all hidden files and folder | ||
|
||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
at_scripts/firmware_update/fwUpdate_tobyL2-Fota_advance.atl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2020 u-blox AG, Thalwil, Switzerland. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
****************************************************************************** | ||
* Synopsis: fwUpdate_tobyL2-Fota_advance.atl | ||
* Topic: firmware_update | ||
* Version: 1.0 | ||
* Author: rmcn | ||
* Description: | ||
* This scrip can be used to perform the FOTA update on TOBY-L2 modules. | ||
****************************************************************************** | ||
* Modules: TOBY-L2 | ||
* Tested on: TOBY-L2 | ||
******************************************************************************/ | ||
|
||
// Initialization | ||
ECHO("*************************************************************************************************************"); | ||
ECHO("This script requires to set some configurable parameters."); | ||
ECHO("Be sure those are correctly configured before the initialization of this."); | ||
ECHO("*************************************************************************************************************"); | ||
|
||
// Configurable parameters | ||
string file_md5 = ''; | ||
string ftp_address = ''; | ||
string ftp_name = ''; | ||
string ftp_password = ''; | ||
string ftp_file_path = ''; | ||
|
||
// Other variables | ||
string resp; | ||
string command; | ||
|
||
// Initial commands | ||
ATI | ||
ATI9 | ||
AT+CGDCONT? | ||
|
||
// PDP context activation | ||
AT+UPSD=0,0,0 | ||
AT+UPSD=0,100,4 | ||
AT+UPSDA=0,3 | ||
|
||
// FTP configuration | ||
command = 'AT+UFTP=1,"' + ftp_address + '"'; | ||
SENDAT(command,6000,'OK'); | ||
command = 'AT+UFTP=2,"' + ftp_name + '"'; | ||
SENDAT(command,6000,'OK'); | ||
command = 'AT+UFTP=3,"' + ftp_password + '"'; | ||
SENDAT(command,6000,'OK'); | ||
AT+UFTP=6,1 | ||
|
||
resp = SENDAT('AT+UFTPC=1',60000,'+UUFTPCR:'); | ||
if (FIND(resp,'+UUFTPCR: 1,1') == -1) | ||
{ | ||
STOP('Failed to connect to server'); | ||
} | ||
|
||
command = 'AT+UFTPC=100,"' + ftp_file_path + '"'; | ||
resp = SENDAT(command,180000,'+UUFTPCR:'); | ||
if (FIND(resp,'+UUFTPCR: 100,1') == -1) | ||
{ | ||
STOP('Failed to download image'); | ||
} | ||
|
||
resp = SENDAT('AT+UFTPC=0',60000,'+UUFTPCR:'); | ||
if (FIND(resp,'+UUFTPCR: 0,1') == -1) | ||
{ | ||
STOP('Failed to disconnect from server'); | ||
} | ||
|
||
command = 'AT+UFWINSTALL=' + file_md5; | ||
SENDAT(command,400,'+UUFTPCR:'); |
96 changes: 96 additions & 0 deletions
96
at_scripts/internet_applications/ipApp_saraR5_awsExpressLinkDemo_basic.atl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 u-blox AG, Thalwil, Switzerland. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
****************************************************************************** | ||
* Synopsis: ipApp_saraR5_awsExpressLinkDemo_basic.atl | ||
* Topic: internet_application | ||
* Version: 1.0 | ||
* Author: mreb | ||
* Description: | ||
* This script has the purpose to demonstrate the MQTT use for | ||
* communication between the u-blox SARA-R510AWS module and the AWS | ||
* server. As an application's example, it simply sends 10 times | ||
* the time to the AWS server. | ||
* Product page: | ||
* https://www.u-blox.com/en/product/SARA-R510AWS-module | ||
****************************************************************************** | ||
* Modules: SARA-R510AWS | ||
* Tested on: SARA-R510AWS | ||
******************************************************************************/ | ||
|
||
|
||
// fixed variables | ||
string command, resp, data_message; | ||
int wait_ten_minutes = 600000; | ||
int wait_one_minute = 60000; | ||
int wait_five_seconds = 5000; | ||
int times = 10; | ||
|
||
// variable settings | ||
string apn_address = "jtm2m"; | ||
int topic_id = 1; | ||
string topic_name = "/example_topic_name"; | ||
|
||
|
||
// specific AWS AT command function to handle OK or ERROR response | ||
void send_aws_at_command(string aws_command, int waiting_time){ | ||
|
||
aws_command = aws_command + "\r\n"; | ||
SENDTEXT(aws_command); | ||
resp = "ERR Timeout"; // this error is used in case waiting_time expires | ||
resp = WAIT("OK", "ERR", waiting_time); | ||
if(FIND(resp, "ERR") != -1) | ||
{ | ||
STOP("Command: " + aws_command + " is failing with error: " + resp); | ||
} | ||
} | ||
|
||
|
||
void main(){ | ||
// Initialization | ||
ECHO("*************************************************************************************************************"); | ||
ECHO("This script requires to set some configurable parameters."); | ||
ECHO("Moreover the script can be used once the module providion has been already completed."); | ||
ECHO("Be sure parameters and AWS end-point address are correctly configured before the initialization of this."); | ||
ECHO("*************************************************************************************************************"); | ||
|
||
ECHO("Configuring..."); | ||
if (apn_address != "") | ||
{ | ||
command = "AT+CONF APN=" + apn_address; | ||
send_aws_at_command(command, wait_five_seconds); | ||
} | ||
|
||
ECHO("Performing the connection."); | ||
send_aws_at_command("AT+CONNECT", 3*wait_ten_minutes); | ||
|
||
command = "AT+CONF Topic" + topic_id + "=" + topic_name; | ||
send_aws_at_command(command, wait_one_minute); | ||
|
||
command = "AT+SUBSCRIBE" + topic_id; | ||
send_aws_at_command(command, wait_one_minute); | ||
|
||
int count = 0; | ||
while (count < times) | ||
{ | ||
data_message = "The time now is " + get_date_time_now(); | ||
command = "AT+SEND" + topic_id + " " + data_message; | ||
send_aws_at_command(command, wait_one_minute); | ||
PAUSE(wait_one_minute); | ||
count++; | ||
} | ||
|
||
ECHO("Performing the disconnection."); | ||
SENDAT("AT+DISCONNECT", wait_ten_minutes,"OK"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.