Most RoboteQ controllers support serial communication through RS485 and RS232 ports. The Roboteq controller can receive serial commands and queries and reply to the master through the serial port. One serial terminal and an RS232 to USB or RS485 to USB adapter can be used to test the serial communication of the controller. The steps to test the communication are following.


1. Hardware connections


RS232:


The Tx of the controller should be connected to the Rx of the adapter and the Rx of the controller to the TX of the adapter. the two grounds should be connected together. The adapter normally will be powered from the USB, but if there is a 5V input required you can power it from the controller's 5 V output.



RS485:


The + and - signals of both sides should be connected together. The adapter can be powered from the controllers 5 V output and the two grounds should be connected together.

 


2. Controller configurations


By default the controller will work at 115200 baudrate. At 2.1+ firmware the baudrate is configurable, so different rates can be selected through Roborun+ utility. 


3. Terminal configuration


The below settings must be configured for the serial port:


  • 115200 kb/sec
  • 8 bits
  • None parity
  • 1 stop bit


If different baudrate is used, then configure that instead.



The port that the adapter is connected can be found by opening the device manager


4. Sending serial commands

 

Any supported serial command or query can be sent through the Serial terminal. The commands must be sent followed by an underscore or and end of line charter ("_" or "\r"). The Roborun+ utility is automatically adding these characters when sending a command. So for example, the command to read battery amps should be:


?BA 1_


or


?BA 1\r


Now send a test query and see if you will get the controller response.



At UID query, the controller replies its unique ID.


If the serial communication does not seem to work, one can refer to the Troubleshooting RS232 communication problems article (applicable only for RS232 communication).