Hi there
how would i send a byte to a dash pro?
i have no idea about what this would be called … webhooks? api call? …
or can this be done in the dashboard?
thanks
henning
Hi there
how would i send a byte to a dash pro?
i have no idea about what this would be called … webhooks? api call? …
or can this be done in the dashboard?
thanks
henning
that is rather disappointing that nobody ever tried to send something to the dash …
2 days and no answer ?
Hey sorry for the delay, we don’t have an API call to get SMS or incoming data yet, but that’s coming.
The reason it was taking a while was because we were trying to get a code snippet workaround for you but it looks like that might not be possible.
Stay tuned for the next system firmware update as it may have some useful things in there related to this.
Actually, I take that back. We may have that workaround after all
great … looking forward to that …
and forgive me for my second post …
henning, hamburg, germany …
Hi,
Sorry for the delay.
You can send SMS to the Dash/Dash Pro. Here are the steps to do it.
Configuring the Dash/Dash Pro to receive SMS
Upload this Arduino sketch to the Dash/Dash Pro. This is a simple demo of how the Dash identifies an incoming SMS message.
// EFFECTS: Strips away the length number from the payload as it's not needed.
String stripOffLengthNumber(String payload) {
int index = 0;
while (payload[index] == ',') {
++index;
}
while (payload[index] != ',') {
++index;
}
++index;
payload.remove(0, index);
return payload;
}
void setup() {
/* Serial Setup */
SerialUSB.begin(9600); /* USB UART */
SerialCloud.begin(115200); /* Konekt Cloud */
delay(4000); /* Delay 4 seconds to wait for Usb Serial to Init.*/
/* Setup Konekt Dash */
Dash.begin();
Dash.pulseLED(100,5000); /* Set the User Led to flash every 5 seconds */
/* Serial Print Info */
SerialUSB.println("Konekt Dash SMS Receiving Example Started!");
SerialUSB.print("Using Boot Version: ");
SerialUSB.println(Dash.bootVersion()); /* Print Dash Bootloader Version */
SerialCloud.println("Hello, World!"); /* one-time message */
}
String tempBuffer = "";
String payload = "";
bool foundSMS = false;
void loop() {
char currChar;
/* the code here will pass data between Cloud<-->UART */
while (SerialCloud.available()) {
currChar = (char)SerialCloud.read();
// check if the current buffer hits the SMSRCVD code.
if (!foundSMS) {
if (tempBuffer == "SMSRCVD") {
foundSMS = true;
}
}
// If it received the SMSRCVD code, the payload will get populated until
// we get a \n.
else if (currChar == '\n'){
SerialUSB.println("\nSMS received: ");
payload = stripOffLengthNumber(payload);
SerialUSB.println(payload);
// DO SOMETHING WITH SMS HERE.
// reset foundSMS and the payload for the next iteration.
foundSMS = false;
payload = "";
}
else {
payload.concat(currChar);
}
// Only keep a sliding buffer length of size 7
// (need to only check for SMSRCVD).
if (tempBuffer.length() >= 7) {
tempBuffer.remove(0, 1);
}
// add latest char to our buffer.
tempBuffer.concat(currChar);
SerialUSB.write(currChar);
}
delay(500);
}
Open up a serial monitor with a baud rate set to 9600. A bunch of events showing what the Dash/Dash Pro is running will appear. You will need to wait for a while to get it initialized and ready to receive SMS. Once an event that says ‘data successfully sent to cloud’, you may proceed to the steps below.
Sending SMS via the Dashboard
Please feel free to reach out to us again if you have any questions or concerns. Thanks!
Thanks for the code and example.
Why is this not part of the existing API?
It’s in development right now. Hopefully we’ll be able to get it released soon.
hi
don’t get me wrong … i really loooooove the project …
but what i expected from the konekt dash was a device that could send and receive data
and achieving that should be the prime directive. all other things should be secondary directive. short message service is a temporary workaround - thanks zheng - but it requires to have a telephone number assigned to the dash … that is not an option for me …
until “serial cloud” has two way communication sending a byte each direction is not possible … the dash is sadly basically unusable for me and for my project …
I am full of hope as i am trusting you guys …
Hey, we totally agree and are working hard to add more features along those lines. We know it’s taking longer than expected and appreciate your patience as we work through all this stuff.
Just so you know, you don’t need to purchase a phone number to use SMS. You can send SMS via our API or through the Dashboard.
Hello Reuben, How do you send SMS to device without purchasing Phone Number? I thought having a Phone Number was required.
From the SMS API Documentation…
phonenumber (string, required, phone number of the recipient device if the device has already been assigned a phone number)
Am I missing something?
Regards,
Pat Jackson
Oh, maybe we’re missing something in the docs. The API will accept deviceid
instead of phonenumber
I am going to try it.
That would mean we could SMS device to send back a payload. That is what I need.
Side question. Do you have link for Dash Class Functions?
I noticed previously a “show version” function that I had not seen before.
I wonder if there are more functions than listed in the Community?
Take a look at Using the Dash class
Oh now I see in the API it says:
One of the following form fields are required in the POST body to identify the recipient device (only one of the following fields may be supplied):
deviceid (number, required, id of the recipient device)
phonenumber (string, required, phone number of the recipient device if the device has already been assigned a phone number)
deviceids (array of deviceid entries, used for sending SMS to multiple devices simultaneously)
Neat!!!
I don’t see Dash.bootVersion() listed in that link.
That why I asked if maybe there are more functions.
One suggestion when determining the payload is to not only check for a new line but also a carriage return because I noticed that there may be a \r before the \n which will make string comparisons difficult. Suggest changing the line “else if (currChar == ‘\n’ ){” to “else if (currChar == ‘\n’ || currChar == ‘\r’){”.
Updating this thread for a recent and useful bit of information:
I used the code above for my own SMS testing recently. I discovered it would timeout when the modem reset. Reuben was able to quickly analyze the issue, and suggested the following fix (which I tested and confirmed as solving the issue:
Can you add this after the SerialCloud.read()?
if(currChar == 0) { continue; }
When the modem resets, you may end up with a null in the buffer and the Arduino String functions don’t handle this correctly and the string gets corrupted. I’ll make sure that this is added into our example code.
You can read the whole thread here: