Home Arduino arduino uno – Downside with studying information from ELM327

arduino uno – Downside with studying information from ELM327

0
arduino uno – Downside with studying information from ELM327

[ad_1]

The thought was to create a bluetooth system on the arduino to learn information from the machine (ELM327 v2.1) utilizing the HC-05 bluetooth module.

On this code the bluetooth module is switched to MASTER mode and related to ELM327 utilizing its MAC deal with. The responses of the module within the code are within the feedback.

#embody <SoftwareSerial.h>
SoftwareSerial bluetoothSerial(4, 5);

void setup() {
  Serial.start(9600);
  Serial.print("READY");
  bluetoothSerial.start(38400);
  delay(1000);
  getSetAtCommand("AT");                         //OK
  getSetAtCommand("AT+CMODE=0");                 //OK
  getSetAtCommand("AT+PSWD=1234");               //OK
  getSetAtCommand("AT+ROLE=1");                  //OK
  getSetAtCommand("AT+BIND=0010,CC,4F3603");     //OK
  getSetAtCommand("AT+LINK=0010,CC,4F3603");     //OK
  delay(1000);
  getSetAtCommand("AT+STATE?");  // OK: CONNECTED
  delay(1000);
  getSetAtCommand("ATZ");      //no reply, the buffer is empty                
  getSetAtCommand("AT015B");//no reply, the buffer is empty
  getSetAtCommand("015B");      //no reply, the buffer is empty          
  getSetAtCommand("ATRV");   //no reply, the buffer is empty
  getSetAtCommand("0105");    //no reply, the buffer is empty                  
  getSetAtCommand("at i");   //no reply, the buffer is empty
  getSetAtCommand("at rv");   //no reply, the buffer is empty                   
  getSetAtCommand("ati");    //no reply, the buffer is empty  
  getSetAtCommand("atrv");   //no reply, the buffer is empty
}

void loop() {
}

void getSetAtCommand(String command) {
  Serial.println(command);
  String added_command = command + "rn";
  bluetoothSerial.print(added_command);
  delay(500);
  whereas (bluetoothSerial.out there()) {
    Serial.write(bluetoothSerial.learn());
  }
}

Because the State returns CONNECTED, I assume that it’s related to the ELM.

To the command AT+PAIR=0010,CC,4F3603,20rn the module doesn’t reply. The module additionally doesn’t reply to instructions akin to ATZrn, AT015Brn, 015Brn, ATRVrn, 0105rn, at irn, at rvrn, atirn, atrvrn. Typically the reply is ERROR[0], as I perceive it implies that there isn’t a such command.

It appears to me that these instructions do not attain the ELM in any respect. What might be the issue?

The ELM327 itself works, connects to the telephone with none issues and exhibits the info.

Tried by way of the simulator on a laptop computer, the related bluetooth mannequin is displayed within the bluetooth units on the laptop computer and likewise doesn’t work as with the ELM.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here