isl-org / OpenBot

OpenBot leverages smartphones as brains for low-cost robots. We have designed a small electric vehicle that costs about $50 and serves as a robot body. Our software stack for Android smartphones supports advanced robotics workloads such as person following and real-time autonomous navigation.
https://www.openbot.org
MIT License
2.77k stars 513 forks source link

Python controller cannot connect ... #351

Closed khoatranrb closed 9 months ago

khoatranrb commented 1 year ago

image

What should I do now?

thias15 commented 1 year ago

Are phone and computer in the same network? Is connection mode set to RTSP? Did you toggle the controller mode to the phone icon?

khoatranrb commented 1 year ago

I followed the guide in Python controller: connect to same network, turn to phone icon. I am not a wireless expert so can you give me a guide on RTSP connection mode?

khoatranrb commented 1 year ago

image

However, it has been stuck at line 322. So I think RTSP is not problem.

sanjeevitinker commented 9 months ago

Hello @khoatranrb ,

I encountered the same issue with the connection, and I believe I found the solution. The problem seems to be related to a mismatch in the port numbers set in the OpenBot Robot App and the Python application.

In the Python code (keyboard-click.py, keyboard-pygame.py, common.py), the default port is set to 19400:

python - self.sock.bind(("0.0.0.0", 19400))

However, in the OpenBot Robot App, the default port is configured as 8081. To establish a successful connection, these port numbers should match.

To resolve the issue, you can update the Python code to use port 8081:

self.sock.bind(("0.0.0.0", 8081))

After making this change, the Python application should connect to the OpenBot Robot App without any issues.

I hope this helps!