-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading is broken with the latest firmware #17
Comments
Some more details: I've made sure that both the firmware and API use the latest commit of the protocol. Hoverboard control works fine, both from my code and from debugMachineProtocol.py, e.g.
I assume the ACKs are read correctly. However, no hall sensor data and no electrical measurements are being received. Other than that, periodically it seems to get the response for ASCII protocol unlock when not actually being asked to:
|
Fixed with #18 |
I used your Code from #18 but the reading still does not work for me. I tried the readSpeed example to make sure it's not a fault on my site but I'm just getting random or zero values. Any Idea? |
In my case the fix from #18 definitely helped, as there's clearly a bug in there. |
With everything in master and with the fix #18, at least active polling works. |
Did you ever get this working? |
I've narrowed it down to not getting any replies from the hoverboard. I am able to successfully send data with the arduino (ie control motors, beeper, etc), when I connect it to my serial adapter I can use the ASCII API perfectly fine but reading does not work on every Arduino I have tried (Mega, ESP32, Uno, Nano). I don't thing the correct commands are getting sent from the library if I am not getting any response. I am checking the response directly from where I do Serial.read() so reading has nothing to do with the library. |
I am actively polling instead of
|
This might have something to do how you open the serial. If this helps, this is a snippet of my C-Code that interacts with the Hoverboard (https://github.com/pilsbot/pilsbot_hw_ros/blob/foxy-devel/pilsbot_driver/src/pilsbot_driver.cpp#L460-L473): // HB specific
struct termios options;
tcgetattr(*fd, &options);
options.c_cflag = B115200 | CS8 | CLOCAL | CREAD; //<Set baud rate
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;
tcflush(*fd, TCIFLUSH);
if(tcsetattr(*fd, TCSANOW, &options) < 0) {
RCLCPP_ERROR(rclcpp::get_logger("PilsbotDriver"),
"hoverboard: Could not set terminal attributes!");
perror("tcsetattr");
}
api = new HoverboardAPI(serialWrite); |
I am running this on arduino not Unix.
Brandon Wees
…On Nov 26, 2023 at 2:41 AM -0600, Pascal ***@***.***>, wrote:
> I am able to successfully send data with the arduino (ie control motors, beeper, etc), when I connect it to my serial adapter I can use the ASCII API perfectly fine but reading does not work on every Arduino I have tried (Mega, ESP32, Uno, Nano).
This might have something to do how you open the serial.
At least under Unix (probably Windows as well), you might want to open it raw and disable the Kernel's Flow control.
If this helps, this is a snippet of my C-Code that interacts with the Hoverboard (https://github.com/pilsbot/pilsbot_hw_ros/blob/foxy-devel/pilsbot_driver/src/pilsbot_driver.cpp#L460-L473):
// HB specific
struct termios options;
tcgetattr(*fd, &options);
options.c_cflag = B115200 | CS8 | CLOCAL | CREAD; //<Set baud rate
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;
tcflush(*fd, TCIFLUSH);
if(tcsetattr(*fd, TCSANOW, &options) < 0) {
RCLCPP_ERROR(rclcpp::get_logger("PilsbotDriver"),
"hoverboard: Could not set terminal attributes!");
perror("tcsetattr");
}
api = new HoverboardAPI(serialWrite);
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Ah sorry, misread that comment |
After updating to the latest firmware (the one with 'Breaking change for serial protocol') the API (and therefore protocol) only works in the direction "TO hoverboard". The data is being read FROM the hoverboard, but callbacks are never triggered -- looks like something is wrong with the parser.
The text was updated successfully, but these errors were encountered: