'+' character in command protocol
I have a doubt about the commnand protocol.
In the documentation is not reported the use of the '+' character but in the Arduino code I see that it is used.
In the eventSerial() function ask if the inChar variable is equal to '+' and in the comments says: // if we see a 'bun' on the serial
What does it mean? Is '+' the first character that I have to send to communicate with the openBCI?
Comments
@biomurph,
"The Dongle inserts the '+' sign into the signal. You, or the controlling program, does not have to do it."
It seams logic but I cannot get any reaction of the programme if I dont write all the "+".
From the Arduino IDE, when I use the "Tools / Serial Monitor" I have to write (without the double quotes):
"+v+" or "+?+" or "+=++a++N+" , etc... It works
How do you understand that ?
Is my Dongle wrong ?
Funny , if I write "+v+?+" or "+?+v+" , with only one "+" between "v" and "?" ,
I get in both cases the "restart from scratch" but no "print registers" ...
If I repeat the last sequence , I get only the registers,
If I repeat the last sequence again, I get only the restart,
If I repeat the last sequence again, I get only the registers,
then If I write "+v+" , I get nothing
If I continue writing "++v+" it restarts one time over two.
In the code of the function "void eventSerial(){" , one can read : " if(millis() - commandTimer < 5){ // if it's not too late, "
Too late for what ?
Wish you happy hollidays.
Yannick.
Thank's for your answer,
- I have not touched the Dongle firmware.
- In the file OpenBCI_32bit_SD_Only.ino
After the main loop we find :
// =============== some variables to help find 'burger protocol' commands
int plusCounter = 0;
char testChar;
unsigned long commandTimer;
void eventSerial(){
while(Serial0.available()){
char inChar = (char)Serial0.read();
if(plusCounter == 1){ // if we have received the first 'bun'
testChar = inChar; // this might be the 'patty', stop laughing
plusCounter++; // get ready to look for another 'bun'
commandTimer = millis(); // don't wait too long!
}
if(inChar == '+'){ // if we see a 'bun' on the serial
plusCounter++; // make a note of it
if(plusCounter == 3){ // looks like we got a command character
if(millis() - commandTimer < 5){ // if it's not too late,
if(getChannelSettings){ // if we just got an 'x' expect channel setting parameters
loadChannelSettings(testChar); // go get em!
}else if(getLeadOffSettings){ // if we just got a 'z' expect lead-off setting parameters
loadLeadOffSettings(testChar); // go get em!
}else{
getCommand(testChar); // decode the command
}
}
plusCounter = 0; // get ready for the next one
}
}
}
}
But dont bother with that, you have so much to do at the moment...
Thank's for all,
Yannick.
I , for my part , fully agree with your interpretation of the Sandwich protocole and its timing.
On the net the best I found was :
Yannick.
you asked me if I had altered the dongle firmware...
Do you mean that someting could be wrong with this dongle?
What should I do?
Is there anything to check? How?
Is there a way to know which version is running?
Thank's
Yannick.
I am trying to re-program the Dongle.
But : OpenBCI_32bit_Host.ino:35:53: fatal error: RFduinoGZLL.h: No such file or directory
Do I absolutely need to use the 1.5.8 ide ?
If yes can it coexiste with the 1.6.5 that I curently use?
if the 1.6.5 is OK, then where should I put the library?
I put OpenBCI_Radios-master\OpenBCI_RFduino_Library\RFduino
In : c:\Program Files\Arduino\Hardware\arduino
Thank's for your help,
Yannick.
<span style="color: rgb(255, 0, 0);"><br></span>Then can it coexiste with the 1.6.5 that I curently use?
Yannick.
My english is bad...,
I just wanted to know if the two versions , 1.5.8 and 1.6.5 can be installed on the same computer ?
& sorry again...
Yannick.
yesteday, using windows 7 I remarked that the "+" are no longer needed ! ! !
Thus the ++ problem that I observed under XP, would not be caused by the Dongle itself ?
Have you ever heard of a such incompatibility?
Yannick.
"One train may hide another"
and a problem , another...
I Uploaded the Host Firmware to the Dongle following the instructions:
32 bits Host...
device_t role = HOST ;
RFduinoGZLL.channel = 4 ; // 4 from the antistatic bag.
Arduino ver 1.5.8 replied "SUCCESS"
and I went back to my OBCI Board to see if I could better upload its code... (I still have the biggest difficulties to upload)
Then frustration , disappointment , consternation... ( I joke a little bit)
Now : "No target found."
In the tutorial the comment of the line :
RFduinoGZLL.channel = 4 ; // use channels 2-25. 1 is same as 0 and 0-8 in normal GZLL library
makes me perplexed.
" The channel your boards were shipped with is noted on the static baggie that it came in. "
It is written "4" on the baggie
then I must write : RFduinoGZLL.channel = 4 ;
Isnt' it ?
What's wrong ? the OBCI Board radio code is not compatible with the Dongle update?
Thank's a lot for your help.
Yannick.
A last symptome : If I try to upload the firmware of the Card, as I use to do, the blue diode whick blinks slowly after the sequence "RST - PROG" , begins to blink faster as soon as the upload should start.
But no more reaction from the Card...
On the dongle side the green led flashes a few time , may be 6 short flashs and nothing else after that.
At least it shows that something has been transmitted.
If I repeat this with a bad channel number, the diode frequency does not change at all, I did that to be sure that the "4" on the baggie was the true one...
Concerning the upload of the "device radio code" to the OpenBci Board, I meticulously checked all aspects of the protocol but never succeeded...
Thanks for your time.
Yannick.