Skip to content
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

Using ethernet module results in RCL_RET_ERROR being returned when running rclc_support_init #95

Open
sowmr5 opened this issue Feb 21, 2023 · 7 comments

Comments

@sowmr5
Copy link

sowmr5 commented Feb 21, 2023

Using ethernet module results in RCL_RET_ERROR being returned when running rclc_support_init

  • Hardware description: Teensy 4.1
  • RTOS: Arduino
  • Installation type: PlatformIO example
  • Version or commit hash: 1.0.0 (2022-05-25) - judging from changelog in platformio library folder.

Steps to reproduce the issue

Run the following code in platformio: https://pastebin.com/p0CZA7zE
When trying to use the ethernet module, it seems to fail when reaching:
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
The value returned is RCL_RET_ERROR but there is no other detail on it. Ethernet itself appears to work as there is an IP on the network which can be pinged.

Expected behavior

rclc_support_init returns a non error value and continues running the rest of the program

Actual behavior

The teensy will end up in the error_loop function when the RCL_RET_ERROR error is returned in the RCCHECK

@pablogs9
Copy link
Member

Is this code being built?

// Test custom transports
#if defined(MICRO_ROS_TRANSPORT_ARDUINO_CUSTOM)
bool platformio_transport_open(struct uxrCustomTransport * transport) {return false;};
bool platformio_transport_close(struct uxrCustomTransport * transport) {return false;};
size_t platformio_transport_write(struct uxrCustomTransport* transport, const uint8_t * buf, size_t len, uint8_t * err) {return 0;};
size_t platformio_transport_read(struct uxrCustomTransport* transport, uint8_t* buf, size_t len, int timeout, uint8_t* err) {return 0;};
#endif

@sowmr5
Copy link
Author

sowmr5 commented Feb 21, 2023

Thanks for the reply, no, it's not being built. I've tried it with and without that code and both appear to fail in the same place (rclc_support_init).

@pablogs9
Copy link
Member

What is the output of your micro-ROS Agent with the flag -v6?

@sowmr5
Copy link
Author

sowmr5 commented Feb 21, 2023

Command:

micro-ros-agent udp4 --port 8888 -v6

Output:

[1676993210.570109] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1676993210.570422] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6

@pablogs9
Copy link
Member

Your board is not communication with the agent, this is why rclc_support_init.

Can you ensure that without micro-ROS your board networking is working?

@sowmr5
Copy link
Author

sowmr5 commented Feb 22, 2023

Thanks for your help. After trying the following demo code:

https://github.com/vjmuzik/NativeEthernet/blob/master/examples/UDPSendReceiveString/UDPSendReceiveString.ino

and sending a UDP packet, the Teensy network appears to be working ok:

Reached end of setupReceived packet of size 2
From 192.168.1.27, port 44744
Contents:
hi

It that test ok, or should a different one be made? As a next step I'll check if there are any issue with the teensy accessing the agent on the host machine.

Thanks again

@pablogs9
Copy link
Member

This test is ok, now you need to ensure that micro-ROS in sending UDP message to port 8888 in your host (where the agent is listening). Probably is a good idea to take a look at send method of the custom transports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants