tag:blogger.com,1999:blog-4538874870128905283.post8652192876651353266..comments2024-03-12T02:26:23.874-04:00Comments on Phillipe Cantin: Arduino Bluetooth LinkPhillipe Cantinhttp://www.blogger.com/profile/09212731287198061992noreply@blogger.comBlogger123125tag:blogger.com,1999:blog-4538874870128905283.post-35262064948296313722022-02-23T21:38:35.747-05:002022-02-23T21:38:35.747-05:00You make so many great points here that I read you...You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Feel free to visit my website; <a href="https://www.oncasinosite.net" title="바카라사이트" rel="nofollow">바카라사이트</a><br /><br />oncasinositenethttps://www.blogger.com/profile/03636830467003605457noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-15586207072725302822021-05-17T08:47:38.762-04:002021-05-17T08:47:38.762-04:00google 3857
google 3858
google 3859
google 3860...<a href="https://frenchmoon7.webgarden.cz/rubriky/frenchmoon7-s-blog/unnamed-12" rel="nofollow">google 3857</a> <br /><a href="https://petersonmagnu.livejournal.com/profile" rel="nofollow">google 3858</a> <br /><a href="https://www.openlearning.com/u/flatfriend3/blog/01234567891011" rel="nofollow">google 3859</a> <br /><a href="http://buspowder0.xtgem.com/__xt_blog/__xtblog_entry/__xtblog_entry/20361566-?__xtblog_block_id=1#xt_blog" rel="nofollow">google 3860</a> <br /><a href="https://epochleo8.webgarden.at/kategorien/epochleo8-s-blog/unnamed-13" rel="nofollow">google 3861</a> <br /><a href="https://pbase.com/topics/bushorn3/chaparral_high_school_nash_w" rel="nofollow">google 3862</a> marryann1220https://www.blogger.com/profile/10429821113730061605noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-11866509221979536982019-06-24T12:58:00.209-04:002019-06-24T12:58:00.209-04:00i want 100m range communication. can i use Bluesmi...i want 100m range communication. can i use Bluesmirf device for my project.shukryhttps://www.blogger.com/profile/06695742635637991722noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-90021737271663064682019-06-24T12:55:39.306-04:002019-06-24T12:55:39.306-04:00This comment has been removed by the author.shukryhttps://www.blogger.com/profile/06695742635637991722noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-41163671333517297762014-11-18T06:15:54.863-05:002014-11-18T06:15:54.863-05:00Hello Philipe, i have spent several hours trying t...Hello Philipe, i have spent several hours trying to figure out whats wrong with my code, because my two RN42-XV bluetooth modules would not connect to each other, could you please help, i've set the authentication on both bluetooth modules to SA,2. could that be the problem ??? here's the code for both master and slave. Thank you.<br /><br />//Master<br />#include <br /><br />String Slave1 = "0006666931BA"; //Mac Address of Slave1<br /><br />void setup() {<br /> Serial.begin(9600); //baudrate<br /> Serial.print("$$$"); // Enter command mode<br /> delay(100);<br /> Serial.println("SM,1"); // Act as Master<br /> delay(100);<br /> Serial.println("c,"+ Slave1 +"\r"); //connect to device<br /> delay(100);<br /> Serial.println("---,"+ Slave1 + "\r"); //exit command mode and enter data mode<br /> }<br /><br />void loop() {<br /> Serial.println("L"); //Send L when in data mode<br /> delay(100);<br /> Serial.println("H"); //Send H in data mode<br /> delay(100);<br /> }<br /><br /><br />//slave<br />#include <br /><br />String address = "00066669386C"; //address of master bluetooth<br /><br />void setup() {<br /> Serial.begin(9600); //baudrate<br /> Serial.print("$$$");<br /> delay(100);<br /> Serial.println("c,"+ address +"\r"); //connect to master<br /> delay(100);<br /> Serial.println("SM,0"); //slave mode<br /> delay(100);<br /> Serial.println("---,"+ address +"\r"); //exit command mode<br /> delay(100);<br />}<br /><br />void loop() {<br /> if(Serial.available()>0) { //check if data is avialable<br /> char signal = Serial.read(); //read incoming data<br /> if(signal=='L') { <br /> digitalWrite(13,HIGH);<br /> delay(100);<br /> }<br /> else if (signal=='H') {<br /> digitalWrite(13,LOW);<br /> delay(100);<br /> }<br /> }<br />}Anonymoushttps://www.blogger.com/profile/13960211058727689329noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-85824504377964752092014-10-24T18:55:10.535-04:002014-10-24T18:55:10.535-04:00According to the user manual (https://www.sparkfun...According to the user manual (https://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf) it is suported. I have not tried it though. Yet another thing to try. bluetooth never endsPhillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-3538843266792803562014-10-24T16:13:15.139-04:002014-10-24T16:13:15.139-04:00Hi.... Could you help me with something? I want to...Hi.... Could you help me with something? I want to pair a master RN-42 module with a slave HC-05 module? How can it be done?Tanzimhttps://www.blogger.com/profile/03370721537479339301noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-28069101940393685202014-08-05T18:00:55.259-04:002014-08-05T18:00:55.259-04:00To help, I will need more info like the code and t...To help, I will need more info like the code and the error message (send it to: phillipe at cantin dot com)Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-54893155247307807972014-08-05T08:39:58.950-04:002014-08-05T08:39:58.950-04:00But Phillipe, i have some error compilation proble...But Phillipe, i have some error compilation problem in this masters code. could you please tell me, what is the problem.when i uploaded this coded it shows error compilation.Anonymoushttps://www.blogger.com/profile/00245108691209607111noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-69192908746732770582014-08-03T21:10:45.774-04:002014-08-03T21:10:45.774-04:00It shouldn't be a problem. When you connect u...It shouldn't be a problem. When you connect using your phone take note of the MAC address of the sensor. You can then set your Arduino/bluetooth as a Master ("SM,1") and connect to this MAC address using the "C,000666123ABC" command (of course here you have to replace the 000666123ABC fake address with the address of your sensor).Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-67794999349862392942014-08-03T21:05:29.792-04:002014-08-03T21:05:29.792-04:00Using this code you don't have to enter "...Using this code you don't have to enter "$$$" since the setup function is doing that for you. You can use all the other command and I suggest you send a "---" when you're done, to close the command mode.Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-44537131218097245682014-08-03T20:51:32.771-04:002014-08-03T20:51:32.771-04:00Dear Phillipe,
This is karthik, i would like to ...Dear Phillipe,<br /> This is karthik, i would like to ask you a Question, i am doing my project in Human emotion sensors. i have using (Affectiva Q sensor ) Device. This device is used to find the human skin temperature and this device have an inbuilt bluetooth. i already connect this device to my mobile and get the data. But now i am using arduino and bluetooth. is there any possibility to collect this device data using arduino.Anonymoushttps://www.blogger.com/profile/00245108691209607111noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-88347334957100588872014-07-21T20:27:56.119-04:002014-07-21T20:27:56.119-04:00Sorry Phillipe for a late reply here is the link h...Sorry Phillipe for a late reply here is the link https://learn.sparkfun.com/tutorials/using-the-bluesmirf/all<br />Anonymoushttps://www.blogger.com/profile/07495496887162157176noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-7605938215488501192014-07-01T15:22:32.974-04:002014-07-01T15:22:32.974-04:00I would need to see the code to be able to help. C...I would need to see the code to be able to help. Can you give the link?Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-17477514795572475522014-07-01T10:04:03.028-04:002014-07-01T10:04:03.028-04:00Hey! I cant enter the command mode since two days ...Hey! I cant enter the command mode since two days on my bluesmirf silver! I am running the same code from sparkfun website and hitting $$$ but no response from it! I have a arduino mega adk and i am using pins 14 15 as rx tx ..Anonymoushttps://www.blogger.com/profile/07495496887162157176noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-23696213538807213142014-06-26T19:02:13.671-04:002014-06-26T19:02:13.671-04:00I'm happy to hear that. Keep on hacking!I'm happy to hear that. Keep on hacking!Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-63630244236733504732014-06-26T18:10:04.356-04:002014-06-26T18:10:04.356-04:00Hello Phillipe,
I am back to inform you that final...Hello Phillipe,<br />I am back to inform you that finally I got the Master-Slave connection.It was not working because of authentication.I added BT.println("SA,0"); to the Master and slave modules and it started working. Invested so much time for such a small thing. But I learned a lot from your and other sources.<br /><br />Thanks & Regards.arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-32891024160967080512014-06-24T18:30:58.993-04:002014-06-24T18:30:58.993-04:00You might be right. I uploaded master code and sti...You might be right. I uploaded master code and still blueterm app could connect it. Using the app, I gave D command. the code sets the mode to master and also sets the slave as remote device.But, actually it's not behaving like a master.It should not be able to connect with other bluetooth devices.<br />I factory reset my bluesmirf and tried again .No change. I will replace my master with another bluetooth and will try again.Thanks for all your help. I am really obliged. I will update you if I somehow succeed. arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-36721593431563179212014-06-24T17:20:46.435-04:002014-06-24T17:20:46.435-04:00This code should work and is the same as what I...This code should work and is the same as what I've successfully tested yesterday. The shield has no impact on the test. I have used these modules directly on breadboards with only the Atmega328 chip (no arduino board and no shield) and it works fine. <br /><br />It is possible that your BT modules are slave only.Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-86235601174282959392014-06-24T15:38:04.876-04:002014-06-24T15:38:04.876-04:00I removed the while loop where I was doing status ...I removed the while loop where I was doing status check.Also, I am now closing the commands before using delay(). <br />//Master code<br />void setup() {<br /><br />pinMode(ledPin, OUTPUT);<br />Serial.begin(115200);<br /><br />Serial.print("$$$");<br />delay(100);<br />Serial.println("SM,1"); <br />delay(100);<br />Serial.println("C,00066666351B"); //Connect to address<br />delay(100);<br />Serial.println("---");<br />delay(70000);<br />}<br />Similarly, I changed for slave. But, didn't work for me. Do you think this issue is because I am not using 'Sparkfun proto shield ' ?? If not, could you please send me the modified code which worked for you.arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-8824957568160454272014-06-23T21:40:10.998-04:002014-06-23T21:40:10.998-04:00As a quick test I have removed a the code after th...As a quick test I have removed a the code after the connection (“GK” and if validation) on both master and slave. It connected right away so ... we got that going for us. <br /> <br />As for the rest of the code (which is not working for me either) I can one main problem. When opening a new set of command instruction, you don't always close the series of command by calling the “---” command. And example of this is in your master code after the "C,00066666351B" command you delay of 70 seconds before calling the “---” command and let the module try to connect. <br />Think of this as a state machine where you can set the module in a certain state by calling some commands and [always] finish with the “---”. Then you can delay to let the module in this 'state' for a while.<br /><br />Almost there.Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-17700926486401680782014-06-23T13:54:26.656-04:002014-06-23T13:54:26.656-04:00Which Arduino pins are you using to connect to the...Which Arduino pins are you using to connect to the modules TX and RX pins?-> 0 and 1.TX/RX of bluetooth with RX/TX of arduino, respectively.<br />Are you closing the command mode by calling the "---" command?-> Yes<br />When you call the "SM,1" on the master, are you getting an "AOK" message back?-> Yes<br /><br />I wanted to share my code with you.There might be some delay() issue.<br /><br />Master Code-><br />int ledPin = 13; <br /><br /><br />int incomingByte = 0;<br />char msgArray[256];<br />int numVal;<br />boolean flagDone = false;<br /><br />void checkCommandOutputAtSerial(void){<br /> bool keepReading = true;<br /> int index = 0;<br /> <br /> msgArray[0] = '\0';<br /> <br /> while(keepReading){<br /> keepReading = false;<br /> <br /> if (Serial.available() > 0) {<br /> // read the incoming byte:<br /> incomingByte = Serial.read();<br /> if(incomingByte != 13){<br /> msgArray[index++] = incomingByte;<br /> keepReading = true;<br /> }<br /> }<br /> } <br /> msgArray[index] = '\0';<br />}<br /><br /><br />//Master code<br />void setup() {<br /> <br /> pinMode(ledPin, OUTPUT);<br /> Serial.begin(115200);<br /><br /> Serial.print("$$$");<br /> delay(1000); <br /> Serial.println("SM,1");<br /> delay(100); <br /> Serial.println("C,00066666351B"); //C,address - Connect to address<br /> delay(70000); <br /> <br />while(!flagDone){<br /><br /> Serial.println("---");<br /> delay(1000); <br /> <br /> Serial.print("$$$");<br /> delay(1000); <br /> <br /> Serial.println("SM,1");<br /> delay(100); <br /> Serial.println("C,00066666351B");<br /> delay(70000);<br /><br /> Serial.println("GK");//check the status<br /> delay(10000); <br /><br /> checkCommandOutputAtSerial(); //read the command output in msgArray<br /> delay(1000);<br /><br /> if(strlen(msgArray) > 0) {<br /> //Serial.println(msgArray);<br /> numVal= atoi(msgArray);<br /> //Serial.println("msgArray numVal is "+numVal);<br /> if(numVal == 1){<br /> Serial.println("Success! Connection Made!!");<br /> flagDone = true;<br /> digitalWrite(ledPin, HIGH);<br /> }<br /> else{<br /> //Serial.println("Not connected"); <br /> }<br /> <br /> }<br />} <br />delay(10000); <br />Serial.println("---");<br />}<br /><br />void loop(){}<br /><br />SLAVE-><br />//Slave code<br />int ledPin = 13; <br />int incomingByte = 0;<br />char msgArray[256];<br />int numVal;<br />boolean flagDone = false;<br /><br />void checkCommandOutputAtSerial(void){<br /> bool keepReading = true;<br /> int index = 0;<br /> <br /> msgArray[0] = '\0';<br /> <br /> while(keepReading){<br /> keepReading = false;<br /> <br /> if (Serial.available() > 0) {<br /> // read the incoming byte:<br /> incomingByte = Serial.read();<br /> if(incomingByte != 13){ <br /> msgArray[index++] = incomingByte;<br /> keepReading = true;<br /> }<br /> }<br /> } <br /> msgArray[index] = '\0';<br />}<br /><br /><br />void setup() {<br /><br />pinMode(ledPin, OUTPUT); <br />Serial.begin(115200);<br /><br />Serial.print("$$$");<br />delay(1000);<br />Serial.println("SM,0");<br />delay(1000);<br /><br />while(!flagDone){<br /> <br />Serial.println("---");<br />delay(4000); //wait for connection<br /><br />Serial.print("$$$");<br />delay(1000);<br />Serial.println("GK");//check the status<br />delay(4000); <br /><br />checkCommandOutputAtSerial(); //read the command output in msgArray<br />delay(1000);<br /><br /> if(strlen(msgArray) > 0) {<br /> //Serial.println(msgArray);<br /> numVal= atoi(msgArray);<br /> //Serial.println("msgArray numVal is "+numVal);<br /> if(numVal == 1){<br /> Serial.println("Success! Connection Made!!");<br /> flagDone = true;<br /> digitalWrite(ledPin, HIGH);<br /> }<br /> else{<br /> //Serial.println("Not connected"); <br /> }<br /> <br /> }<br />} <br />delay(10000); <br />Serial.println("---");<br /><br /><br />}<br /><br />void loop(){}<br /><br />Let me know if these work on your module.Even if after changing some delay parameters or anything else.Thanks a lot phillipe.arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-73418821182689685832014-06-23T07:03:27.238-04:002014-06-23T07:03:27.238-04:00If you don't get a green Connect light by usin...If you don't get a green Connect light by using the Simple Test code, something is not right. Which Arduino pins are you using to connect to the modules TX and RX pins? Are you closing the command mode by calling the "---" command? When you call the "SM,1" on the master, are you getting an "AOK" message back?Phillipe Cantinhttps://www.blogger.com/profile/09212731287198061992noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-67222575392609829452014-06-23T00:55:53.029-04:002014-06-23T00:55:53.029-04:00Hello Phillipe,
FYI,the master module can detect a...Hello Phillipe,<br />FYI,the master module can detect and pair with my android and pc , but no connect light yet.This clears that the modules are not faulty.<br /><br />I have a question. Does the connection depends on the mode(data/command) of the modules? Example, If one module is in command mode and trying to connect (C,address), and other bluesmirf also gets into it's command mode for checking the connection ("GK"). What is the trick of the connection ? Really, is it that challenging?arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.comtag:blogger.com,1999:blog-4538874870128905283.post-41653490561930703092014-06-21T11:55:31.031-04:002014-06-21T11:55:31.031-04:00Yes I tried the simple code from this post. It'...Yes I tried the simple code from this post. It's not working. I am afraid if my modules are faulty. I also reset these to factory default and tried back. By SM,1 command, it sets the module in Master mode and shows the slave as the remote device(though not connecting). But, my modules beautifully work as slaves and communicate successfully with blueterm app.<br />Anyway, I will keep trying and will update you.Desperately trying to find the solution. arduinoExphttps://www.blogger.com/profile/15518814543143078977noreply@blogger.com