Parma
Offline
Edison Member
Karma: 10
Posts: 2117
|
 |
« Reply #15 on: April 14, 2012, 05:49:12 am » |
Hai provato a controllare se hai lasciato abilitata la modalità AT? Devi rimetterlo in modalità normale per farlo funzionare Ciao
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #16 on: April 14, 2012, 05:57:53 am » |
Mi fai del male se ti dico che non so di cosa stai parlando? come abilito/disabilito la modalità at?
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
Napoli
Offline
Full Member
Karma: 2
Posts: 182
Arduino rocks
|
 |
« Reply #17 on: April 14, 2012, 06:30:16 am » |
Ciao, facendo una ricerca sul forum ho trovato un post http://arduino.cc/forum/index.php/topic,50252.30.html in cui è riportato che per entrare nella modalità AT occorre portare un PIN a livello logico alto, date un'occhiata al post potrebbe essere utile. Ciao.
|
|
|
|
|
Logged
|
Arduino 2009
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #18 on: April 14, 2012, 10:57:52 am » |
Ci sto dando un occhiata mmm qualche spiegazione diretta forse sarebbe meglio 
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #19 on: April 16, 2012, 04:00:03 am » |
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #20 on: April 16, 2012, 08:04:11 am » |
Industrial serial port bluetooth, Drop-in replacement for wired serial connections, transparent usage. You can use it simply for a serial port replacement to establish connection between MCU and GPS, PC to your embedded project and etc. Default serail port setting : 9600 (optional 4800,9600,19200) , N, 8, 1 Pairing code : 1234 Running in slave role: Pair with BT dongle and master module.
Application : This item can be used as a normal serial port bluetooth , and can communicate with PC、Mobile Phone etc. This item can connect with kinds of serial port devices. This item can be also expanded for second time with kinds of equipments such as GPS etc.
Usage: Coupled Mode: Two modules will establish communication automatically when powered. PC hosted mode: Pair the module with bluetooth dongle directly as virtual serial.
Note : Master modules and slave modules can not switch mode from each other, and only can work as a single work mode The master modules can only use with this slave modules, and the master modules can not match with other slave modules such as the computer、cell phones and other bluetooth device etc. The slave modules can match with other slave modules such as the computer、cell phones and other bluetooth device etc. The master modules have the same At command with the slave modules except for "AT+NAME" , which means the slave modules have At command of "AT+NAME" and The master modules don't have.
Se ho capito bene devo metterlo in modalità slave altrimenti non può comunicare col pc giusto? fa riferimento anche a come si mette in modalità slave ma non ho capito bene. idee?
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #21 on: April 16, 2012, 01:11:28 pm » |
Niente non riesco proprio a rilevarna e non ne capisco il motivo uff 
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
0
Offline
Edison Member
Karma: 15
Posts: 1878
Have you mooed today?
|
 |
« Reply #22 on: April 17, 2012, 05:13:37 am » |
Ciao, innanzitutto in questo thread: http://arduino.cc/forum/index.php/topic,99292.msg749388.html#msg749388si affronta a fondo la questione di moduli master/slave, comandi AT, cambi modalità master / slave, etc Da schema il tuo modulo è marcato HC06, ovvero della serie con fw poco permissivo (leggi questo mio post: http://arduino.cc/forum/index.php/topic,99292.msg750183.html#msg750183per approfondimenti). Se ciò è vero, dovresti riuscire a lanciare comandi AT senza dover intervenire su altri pin del modulo (con questo fw la modalità AT si disabilita quando esiste una connessione). Il problema è che se effettivamente si tratta di HC06, non puoi cambiare modalità: te lo devi tenere Master (sempre che non gli aggiorni fw, guarda qui http://byron76.blogspot.it/2011/09/upgrade-your-bluetooth-module.html) Quindi, prima di tutto: fatti un test con i comandi AT base.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #23 on: April 17, 2012, 05:41:53 am » |
Interessanti purtroppo non sono a casa e non posso testare appena torno provo, quindi collego vcc,gnd,rx,tx >3,3v,gnd,tx,rx poi apro il serial monitor e mando questi comandi? senza nessuno sketch caricato? oppure devo fare come leggo in altri post ovvero togliere l'atmega e usare l'arduino solo come convertitore usb seriale?
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
0
Offline
Edison Member
Karma: 15
Posts: 1878
Have you mooed today?
|
 |
« Reply #24 on: April 17, 2012, 05:46:40 am » |
Ciao, puoi usare una SoftwareSerial, a cui connetterai il modulo BT; ti avevano già linkato la discussione sul tema, con esempio di codice: http://arduino.cc/forum/index.php/topic,50252.msg366272.html#msg366272Benchè io usi il modulo proprio per mezzo di una SwSerial, la programmazione preferisco farla con un convertitore usb-> serial, direttamente.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #25 on: April 18, 2012, 12:10:33 pm » |
Allora ho collegato il modulo ai pin TX al 5 e RX 6 e ho usato lo scketch linkato il serial monitor con questo codice: #include <NewSoftSerial.h>
int pinRX = 6; int pinTX = 5; int pinAT = 8; NewSoftSerial blue(pinRX, pinTX); int pinLed = 13;
void commandAT(char *v) { int i=0; while(v[i] != '\n') { blue.print(v[i]); i++; } blue.print('\n'); }
void readResponse(int nchar) { if(blue.available() > 0){ for(int i=0; i < nchar; i++){ char data = (char)blue.read(); Serial.print(data); delay(100); } } }
void setup() { blue.begin(115200); Serial.begin(9600); Serial.println("Inizializzo sistema..."); pinMode(pinLed, OUTPUT); pinMode(pinAT, OUTPUT); //Valore ALTO per switchare in modalità AT // il 34 sull'antenna digitalWrite(pinAT, HIGH); Serial.println("pinAT attivo"); //Comando AT da inviare char s[] = "AT+ORGL \r\n"; Serial.print("Scrivo comando: "); Serial.print(s); delay(50); //Invio comando all'antenna commandAT(s); delay(50); //Leggo la risposta readResponse(2); }
void loop() { } mi restituisce Inizializzo sistema... pinAT attivo Scrivo comando: AT+ORGL Con quest'altro invece #include <NewSoftSerial.h>
int pinRX = 6; int pinTX = 5; int pinAT = 8; NewSoftSerial blue(pinRX, pinTX); int pinLed = 13;
void commandAT(char *v) { int i=0; while(v[i] != '\n') { blue.print(v[i]); i++; } blue.print('\n'); }
void readResponse() { int a = blue.available(); Serial.print("Caratteri disponibili: "); Serial.println(a); if(a > 0){ for(int i=0; i < a; i++){ char data = (char)blue.read(); Serial.print(data); delay(100); } }
}
void setup() { blue.begin(38400); Serial.begin(9600); Serial.println("Inizializzo sistema..."); pinMode(pinLed, OUTPUT); pinMode(pinAT, OUTPUT); //Valore ALTO per switchare in modalità AT // il 34 sull'antenna digitalWrite(pinAT, HIGH); Serial.println("pinAT attivo"); //Comando AT da inviare char s[] = "AT+ROLE=2\r\n"; Serial.print("Scrivo comando: "); Serial.print(s); delay(50); //Invio comando all'antenna commandAT(s); delay(50); //Leggo la risposta readResponse(); }
void loop() { } Inizializzo sistema... pinAT attivo Scrivo comando: AT+ROLE=2 Caratteri disponibili: 0 sempre con led rosso lampeggiante e ùùma niente da fare idee? cosa sbaglio?
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #26 on: April 19, 2012, 08:05:47 am » |
odio profondo verso i cinesi!potevano scriverlo un manualino ._.
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
0
Offline
Edison Member
Karma: 15
Posts: 1878
Have you mooed today?
|
 |
« Reply #27 on: April 19, 2012, 08:38:59 am » |
odio profondo verso i cinesi!potevano scriverlo un manualino ._.  a parte che nella pagina da te linkata, si trova link a manuale e datasheet!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 16
Posts: 1801
|
 |
« Reply #28 on: April 19, 2012, 08:41:22 am » |
odio profondo verso i cinesi!potevano scriverlo un manualino ._.  a parte che nella pagina da te linkata, si trova link a manuale e datasheet! hai ragione ma cmq non funziona quindi li odio lo stesso 
|
|
|
|
|
Logged
|
"Due cose sono infinite: l'universo e la stupidità umana, ma riguardo l'universo ho ancora dei dubbi..." Albert Einstein
|
|
|
|
0
Offline
Edison Member
Karma: 15
Posts: 1878
Have you mooed today?
|
 |
« Reply #29 on: April 19, 2012, 08:51:29 am » |
Ciao, rimane cmq da appurare questa affermazione: Master modules and slave modules can not switch mode from each other, and only can work as a single work mode il tuo modulo di default è master, si tratta di capire se via AT si riesce a cambiare modalità, o se è necessaria una riprogrammazione: http://arduino.cc/forum/index.php/topic,99292.msg763207.html#msg763207
|
|
|
|
|
Logged
|
|
|
|
|
|