I am trying to communicate over Bluetooth (HC-05 or HC-06) for controlling industrial VFD/INVERTER over modbus RTU communication .
I am successful to send command from android over Bluetooth and then sending modbus RTU frame over rs485 according to command from android. where i put modbus functioning in Arduino MEGA side.
the network architecture is as follows
But when i tried to send modbus frame direct over android and bluetooth without arduino MEGA there is no communication response from VFD/INVERTER.
The network architecture is as follows
My analysis shows that is has something to do with communication speed. The modbus Rtu style of communication determines the end of frame by 3.5 character times between two frames. I think the communication speed does not meetup the needs.
My coding for sending modbus RTU command in android side.
public void write500toinverter()
{
try {
mmSocket.getOutputStream().write(0X01);//write device address
mmSocket.getOutputStream().write(0X06);//write function code
mmSocket.getOutputStream().write(0x00);//write register address
mmSocket.getOutputStream().write(0X04);//write register address
mmSocket.getOutputStream().write(0x01);//Write value
mmSocket.getOutputStream().write(0xF4);//Write value
mmSocket.getOutputStream().write(0XC8);//write CRC C81C
mmSocket.getOutputStream().write(0x1C);//write CRC C81C
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
If there are someone who can shear the working experience it will be very much appreciated.
