@Slimfetz …Here is a simple AT Pass thru program to play with…
You will need to set APN, as you know, for your Sim…
Compile and Download firmware to Boron using DFU…
After initialization,Open serial monitor — set to 115200 baud.
You should be able to type in AT commands using Terminal monitor.
And see responses…
Try AT and Enter…should see OK reply.
AT+cgatt=1 is good to see what happens…
AT+COPS=1,2,“310410” also.
Look over AT command set for SARA R4100…
The ` key does a Particle.connect()
The ~ key does a Particle.disconnect()
// This #include statement was automatically added by the Particle IDE.
#include "Particle.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
char cellular_data[200] = "";
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
int cb(int type, const char* buf, int len, char* cellular_data);
void setup() {
Cellular.setActiveSim(EXTERNAL_SIM);
Cellular.setCredentials("hologram"); // Set to your APN
//Cellular.setActiveSim(INTERNAL_SIM);
// Cellular.clearCredentials();
delay(2000);
Serial.begin(11520);
Cellular.on();
delay(2000);
Cellular.connect();
}
void loop(){
while (Serial.available()) {
// get char:
char inChar = (char)Serial.read();
Serial.print(inChar); // Show it in monitor
// add it to inputString:
inputString += inChar;
// if a return, set a flag
// so the main loop can do something about it:
if (inChar == '\r') {
stringComplete = true;
}
if (inChar == '`'){
doConnect();
}
if (inChar == '~'){
disConnect();
}
}
if (stringComplete) {
if ((inputString.startsWith("at"))||(inputString.startsWith("AT"))){
Serial.print("Sending command: "+inputString +"\r\n");
RESP_OK == Cellular.command(cb, cellular_data, 10000, inputString);
}
else{
Serial.print("Bad command:");
}
// clear the string:
inputString = "";
stringComplete = false;
}
delay(1);
}
//#############################################################
int doConnect(){
Particle.connect();
inputString = "";
return 1;
}
int disConnect(){
Particle.disconnect();
inputString = "";
return 1;
}
int cb(int type, const char* buf, int len, char* cellular_data)
{
Serial.printlnf("Reply: %s\r\n", buf);
return WAIT;
}