Skip to content

Conversation

@MattsAttack
Copy link

This PR introduces python scripts that will allow four drones to communicate with each other via a mesh network.

@MattsAttack
Copy link
Author

The largest issue with this current implementation is that if a drone isn't in range and a client attempts to connect to it, it will spend around 20 seconds stalling in the .send_data() method attempting to connect. This could be fixed via a thread implementation but that would increase complexity.

Here's a video of the delay.

Screen.Recording.2025-09-24.120915.mp4

@MattsAttack
Copy link
Author

MattsAttack commented Sep 25, 2025

PR Status:
Currently, as stated above, this PR implements python scripts to allow the Pi's to host a server via the server and connect to the all other Pi's via the client script. The current client code is good for single drone connections but slow when handling multiple drones since it runs sequentially and waits for connection timeouts. To address this issue, we'll unfortunately more than likely have to implement more threading.

Here's my basic scaffolding for it:

  1. Start a thread for each client connection for send_data() in otherDronesIps for loop
  2. Update send_data() to timeout after a # of seconds (1s-5s probably)
  3. Have send_data() return true or false to thread (Note: This is the hardest step. Getting return values from threads is doable but very ugly)
  4. Use that return value to determine our connection status to the drone
  5. Update value on primary client thread with what drones we are connected to
  6. Keep looping and sending data

@MattsAttack
Copy link
Author

Also, the other thing I think would be good to implement is a JSON parser class for our config file. This shouldn't be terrible to do and would make passing our config data around easier and cleaner.

@MattsAttack
Copy link
Author

With this commit, the basic asyncio implementation is complete. There's still some more stuff that'd I'd like to clean up but this should be functional (based on my basic testing).

@MattsAttack
Copy link
Author

Also, I currently have it set up so you can pass in the drone id as a arg when you run the code.
EX: python main.py 2 (would run with selfId 2)

This helps a ton for testing on a local network

MattsAttack and others added 30 commits November 3, 2025 23:49
Update the readme with enviorment setup
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

Successfully merging this pull request may close these issues.

2 participants