Code Monkey home page Code Monkey logo

Comments (27)

pablogs9 avatar pablogs9 commented on September 21, 2024 1

Could you paste here the output of the micro-ROS Agent with flag -v6? It seems that you have a network problem and the client (ESP32) is not reaching the micro-ROS Agent.

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024 1

Could you test if a native installation of the Agent in a Linux-based system works properly?

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024 1

Yes, basically you need to verify that your ESP32 connected to your network is able to connect to a UDP socket in the same place where you are going to run the agent.

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024 1

micro-ROS agent does support ARM, just follow the instructions for building it: https://github.com/micro-ROS/micro_ros_setup#building-micro-ros-agent

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024 1

@pablogs9 I tried sending UDP from Agent PC and Android app, but both failed. There was no output as for @mmigliavacca . I guess that may be the case for firewall.
As for agent in rpi, raspian buster does not have prebuilt packages, so i am building from source now.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024 1

Well, builing from source also failed... Got stuck at fastrtps. I guess I will try to set it up on my laptop then.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024 1

And the example finally works.

So the HW setup now :

  • Host PC runnning Ubuntu 20.04.4
  • microros agent on host PC, started from provided line in examples
  • ESP32 running int32_publisher.
  1. Install espidf through ESP-IDF install guide(i tried just using vscode extension but that just made more probelms, althogh at the end it started working)
  2. clone this repo into /esp/esp-idf/components
  3. cd /esp
  4. source idf
  5. copy int32_example to /esp/int32_example
  6. cd /esp/int32_example
  7. mkdir components
  8. cd components
  9. git clone https://github.com/micro-ROS/micro_ros_espidf_component
  10. cd ..
  11. set target to esp32
  12. idf.py menuconfig
  13. idf.py build . for some reason at first i needed to press arrow keys when it was building wifi_provisioning . Otherwise it would just stay there
  14. idf.py flash
  15. idf.py monitor
  16. In new terminal docker run -it --rm --net=host microros/micro-ros-agent:galactic udp4 --port 8888 -v6

And that is it. But I would still like to run this from my Windows environment because my laptop keeps powering off every 30 mins, so I will be investigating network issue (related issue #94) .

So for conclusion - check your firewall settings and try connecting to agent with basic UDP client. After that it should be able to start up. Although would it not be better if it would continue trying to reinitialize?

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024
C:\Users\MSI>docker run -it --rm --net=host microros/micro-ros-agent:foxy udp4 --port 8888 -v6
[1646031030.915633] info     | UDPv4AgentLinux.cpp | init                     | running...             | port: 8888
[1646031030.916791] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 6

That is it

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

Your client is not reaching the agent, is the agent's IP configured well on the micro-ROS client side? Are both in the same network? Can you ping from the agent machine the client's IP?

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

Your client is not reaching the agent, is the agent's IP configured well on the micro-ROS client side? Are both in the same network? Can you ping from the agent machine the client's IP?

Agent machine - > client IP Ping successful
VM - > Agent machine ping also successful
image
image
Yes they are on the same network.

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

Can you ping from the virtual machine to the ESP32?

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

Yes, it pings. Kind of having performance problems with VM, so I am taking quite a bit to answer

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

I get the same output
image
But I am not sure if I should change microros Ip. Shouldn't VM IP be the same as host PC?

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

I'm not aware of your VM networking configuration, but the micro-ROS client should be able to connect to the UDP port opened on the agent side. In any case, you can try a basic UDP socket example in order to ensure this connectivity before using micro-ROS.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

So I need to test
UDP Server <-> ESP32 Running UDP Socket example ? I am kind of bad at networking, so it is slighly confusing.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

It seems that I am unable to connect to 8888 port even from anything apart localhost. I tried also using RPI to test UDP to AgentPC with no response. Although ping to xx.194 worked.
For UDP server I used

 import socket 
localIP     = "192.168.1.194"

localPort   = 8888

bufferSize  = 1024 

msgFromServer       = "Hello UDP Client"

bytesToSend         = str.encode(msgFromServer) 

UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) 

UDPServerSocket.bind((localIP, localPort)) 

print("UDP server up and listening") 

while(True):   
    bytesAddressPair = UDPServerSocket.recvfrom(bufferSize)

    message = bytesAddressPair[0]

    address = bytesAddressPair[1]
    print("Sending meessag")
    UDPServerSocket.sendto(bytesToSend, address)
    clientMsg = "Message from Client:{}".format(message)
    clientIP  = "Client IP Address:{}".format(address)    
    print(clientMsg)
    print(clientIP)   

    # Sending a reply to client

    UDPServerSocket.sendto(bytesToSend, address)`

I will investigate this later this day.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

Ok, so . Trying to reduce variables...

Who can send and receive packets when ESP32 is acting as UDP server:

  • rpi
  • HostPC (Windows)

image

Now switching to ESP32 as UDP client and trying to connect to different server hosts.

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

So ESP32, HostPC ,VM Client, -> RPI running nodered UDB server - successful Send transfer
image
Well, at least UDP seems to be working. What changed is that I had to unblock UDP in my firewall for specific devices.

So next is running ros agent? @pablogs9

What should I be seeing on docker output?

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

microrosagent does not support ARM .
image

from micro_ros_espidf_component.

mmigliavacca avatar mmigliavacca commented on September 21, 2024

I'm facing the same issue, with the int32_publisher demo failing at line 49 which is:
RCCHECK(rmw_uros_options_set_udp_address(CONFIG_MICRO_ROS_AGENT_IP, CONFIG_MICRO_ROS_AGENT_PORT, rmw_options));

The strange thing is that this demo, as well as the firmware we developed, was running until last week. Agent address and port are correct.
It is not a firewall issue as the agent receives the data if I run a simple UDP client on the ESP32:
Screenshot from 2022-03-02 16-33-15

While nothing is received when running the demo. Any suggestion to debug this kind of issues?

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

@mmigliavacca

  • Which is the return code of rmw_uros_options_set_udp_address()?
  • Which are your application code?
  • Which are the values of CONFIG_MICRO_ROS_AGENT_IP and CONFIG_MICRO_ROS_AGENT_PORT?
  • Is rmw_options initialized?

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

@AntumArk did you solve your communication issue?

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

Unfortunatelly no, I tried to eliminate firewall issues by running agent on RPi3 , but apperenlty I also need to compile from source ros2, so I got stuck there. Although I did not try to send Udp packets to running Ros agent as @mmigliavacca did. I will try it out.

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

@AntumArk if you use ubuntu in the RPi 3 you can install ROS 2 from apt

from micro_ros_espidf_component.

mmigliavacca avatar mmigliavacca commented on September 21, 2024

@pablogs9, thanks for the super-quick reply.

  • the return code is 11, which I see is RMW_RET_INVALID_ARGUMENT
  • the code is the int32_publisher example, untouched
  • CONFIG_MICRO_ROS_AGENT_IP is "10.0.0.11" and CONFIG_MICRO_ROS_AGENT_PORT is "8888" (both strings, and both configured via menuconfig)
  • rmw_options is initialized by rcl_init_options_get_rmw_init_options(&init_options);

from micro_ros_espidf_component.

pablogs9 avatar pablogs9 commented on September 21, 2024

@mmigliavacca please open another issues with steps for replicating the issue

from micro_ros_espidf_component.

AntumArk avatar AntumArk commented on September 21, 2024

So I was able to run microros Agent on my laptop running ubuntu, and basic udp client on ESP32. So I can confirm that there was something off with windows firewall.

As for building in32publisher on my laptop - I am having similar problem as #60 . Investigating.

from micro_ros_espidf_component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.