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

Making ESP32-cam as a client from being a server #8

Open
Balaji-Ganesh opened this issue Jun 18, 2023 · 2 comments
Open

Making ESP32-cam as a client from being a server #8

Balaji-Ganesh opened this issue Jun 18, 2023 · 2 comments
Assignees
Labels
✨ enhancement New feature or request

Comments

@Balaji-Ganesh
Copy link
Owner

Need

  • Currently middleware with FastAPI and python-socketio is being
    • as a server -- for Flask WebApp.
    • as a client -- for ESP32.
  • Fewer times, connection to ESP32 is breaking.

Current setup (of ESP32)

  • The ESP32 is configured to connect to mobile hotspot.
  • Hence, each time it connects, (most possibly)get the different IP address.

Possible issues that raise out (When becomes a client)

  • Need to upload the code to ESP32 by updating the assigned IP of computer, in each setup of environment to run/test.

Solutions

  • Use a router and assigning static IP addresses to the computer and ESP32.
    • This solves repeated uploading to ESP32.
@Balaji-Ganesh Balaji-Ganesh added the ✨ enhancement New feature or request label Jun 18, 2023
@Balaji-Ganesh Balaji-Ganesh self-assigned this Jun 18, 2023
@Balaji-Ganesh
Copy link
Owner Author

A light on few lines..

reg.

  • Fewer times, connection to ESP32 is breaking.

OK, why not change the middleware from using websockets to python-socket.io as like the Flask-webapp. So that, like Web-client, it polls for auto re-connect and gets connected to ESP32. This fulfills the need right - connection breaking right..?

reg.

  • as a client -- for ESP32.

This appears completely fine, as as per the need, the ESP32 should able to serve both Camera feed and collision feed simultaneously.

  • When being a server, both needs are served on different port -- good.
  • If becomes client, how to make two features available parallely?
    • May say, multi-threading.. Why go for even more complex setup, when being as a server does the job perfectly fine, that too neatly??

reg.

  • Use a router ... (for assigning static IP.)

In middleware, can update the IP address of ESP32 easily right.

  • Hence no need of any router, just simply go with mobile hotspot.

@Balaji-Ganesh
Copy link
Owner Author

Now if would like to solve the error (mentioned in description, simply as connection breaking)

Message: '[EXCEPTION] Camera streaming interrupted. Error: '
Arguments: (ConnectionClosedError(None, Close(code=1011, reason='keepalive ping timeout'), None),)
  • Change the library from websockets to python-socketio and make sure to find and enable autoReconnnect to True. So, that, even if by some cause, it gets disconnected, by socketio's polling mechanism, can connect back to server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant