In this tutorial we will check how to ping the UART OBLOQ device, to make sure it is working properly and can answer our commands.
Since the only interface available to communicate with the device is a serial port, then we will need to establish a serial connection to it before sending any command. Since we are performing a very basic ping test, I’m assuming the use of a Serial to USB converter, so we can test sending some commands to the device without having to write any code.
In the computer side, there are many programs that can be used to send serial data to a connection. For this test, I will be using the Arduino IDE, which allows to establish serial connections using its built in serial monitor. Nonetheless, you can try with other software.
As mentioned, the UART OBLOQ only has a serial interface, so the electronic connections will be very simple.
Since we are going to supply the device with 3.3 V, we should use a serial to USB converter that operates at this voltage level. I will be using this cheap one, which allows to choose the mode of operation between 5 V and 3.3 V using a jumper.
As shown in figure 1, we simply need to connect the serial port pins of the device to the pins of the serial to USB converter. Also, don’t forget to use a common ground between the devices.
Figure 1 – Connection between the UART OBLOQ and the serial to USB converter.
Connecting to serial with the Arduino IDE
For those who are not familiar with the Arduino IDE, this section explains how to open the Serial Monitor to start sending commands via serial to the UART OBLOQ device. You should follow this section after doing the connections from figure 1 and after connecting the serial to USB converter via USB to the computer.
You need to install the Arduino IDE first. You can download the installer for the latest version here.
After the installation of the IDE finishes, open it. Then, on the top bar menu, select tools. Then, go to Port and from the devices that appear, choose the one corresponding to the serial to USB converter.
If you have multiple devices on the list, then the easiest way to figure out which one you should use is disconnecting the device, checking the list, connecting it back and check which COM port was added.
Then, go back to the tools menu and this time choose Serial Monitor. The serial monitor should open, as shown in figure 2.
Figure 2 – Arduino IDE serial monitor.
The ping command
Pinging the device is very simple. We basically need to send the following command via serial:
In figure 3, you can check the Arduino IDE serial monitor configuration before sending the command. Note that in the first dropdown we should choose “Carriage return“, since the OBLOQ commands end with a carriage return. Also, we need to set the baud rate to 9600.
Figure 3 – Sending the ping command.
As output, if the device is working properly, we should get the same |1|1| value back, as shown in figure 4.