Connecting to HBL2350 via RS232 (Linux API)

5 years 9 months ago #29529835 by Goncharenko
Hi all,
I'm trying to connect to Roboteq HBL2350 in Debian using Linux API v1.1, September 01, 2014
At this step I just compiled sample.cpp with correct tty* but I'm not able to connect to the controller:

Opening port: '/dev/ttyUSB0' ... succeeded.
Initializing port....... done.
Detecting device version... failed (issue ?$1E response: 6).
Error connecting to device: 7


I've tested my cable at PC: Roborun+ can find and operate the controller via USB2COMport adapter without any problems,
but the same cable and and the same controller didn't work in Linux.
What I do wrong?
The following user(s) said Thank You: brettpac

Please Log in or Create an account to join the conversation.

5 years 9 months ago #29529838 by Goncharenko

Goncharenko wrote: What I do wrong?

Small update: I compiled the sample code (Windows API) on PC - it works!
But in Debian Virtual Box the sample code returns the same error. I see the request and response on COM port
as well, but program don't receive this response.

PS: Maybe it should be mentioned, that original Linux code returns the following bunch of errors [1],
but this issue can be solved by the including library <unistd.h> into RoboteqDevice.cppCan it be
the origin of my problem?

[1]
RoboteqDevice.cpp: In member function ‘void RoboteqDevice::Disconnect()’:
RoboteqDevice.cpp:79:15: error: ‘close’ was not declared in this scope
RoboteqDevice.cpp: In member function ‘int RoboteqDevice::Write(std::string)’:
RoboteqDevice.cpp:123:57: error: ‘write’ was not declared in this scope
RoboteqDevice.cpp: In member function ‘int
RoboteqDevice::ReadAll(std::string&)’:
RoboteqDevice.cpp:141:49: error: ‘read’ was not declared in this scope
RoboteqDevice.cpp: In member function ‘int
RoboteqDevice::IssueCommand(std::string, std::string, std::string,
int, std::string&, bool)’:
RoboteqDevice.cpp:175:23: error: ‘usleep’ was not declared in this scope
RoboteqDevice.cpp: In function ‘void sleepms(int)’:
RoboteqDevice.cpp:360:28: error: ‘usleep’ was not declared in this scope
make: *** [RoboteqDevice.o] Error 1

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29529843 by Goncharenko
And, finally, I'll finish my monolog :)

According to the user manual: The controller’s serial communication port is set as follows:
• 115200 bits/s

In Windows API RoboteqDevice.cpp we can find:
comSettings.BaudRate = 115200;
which is OK,
but in the Linux version of API we have:
int BAUDRATE = B9600;
which is 12 times slower. In order to work with Roboteq in Linux it is necessary to change
the bound rate to 115200.
The following user(s) said Thank You: CheckMark

Please Log in or Create an account to join the conversation.

5 years 6 months ago #29530114 by brettpac
Has there been any response on this???

I've ran into this exact same scenario. I had the same initial problem, made the same changes to the code (such as including <unistd.h>, and changing the baud rate to 115200 to get things to work) and ended up with the exact same error...

Opening port: '/dev/ttyACM0' ... succeeded.
Initializing port....... done.
Detecting device version... failed (issue ?$1E response: 6).
Error connecting to device: 7


I'm trying to connect a SDC2130 to an Ubuntu 14.04LTS that runs inside of VMWare Workstation 10.
As was the case with Goncharenko, I've been able to connect and operate the controller using the Roborun+ utility on a windows machine and I've done continuity tests on all my cables.

Please Log in or Create an account to join the conversation.

5 years 6 months ago #29530115 by TechSupport
Have you checked to make sure other communication protocols were also correct?

• 115200 bits/s
• 8-bit data
• 1 Start bit
• 1 Stop bit
• No Parity
• No flow control

Please Log in or Create an account to join the conversation.

5 years 6 months ago #29530116 by brettpac
Yes, these have been checked using minicom...

+
+
| A - Serial Device : /dev/ttyACM0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+
+
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+
+

Please Log in or Create an account to join the conversation.

5 years 6 months ago #29530117 by TechSupport
I will ask our tech team to see if there is anything else.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.095 seconds