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

Additional Features #25

Open
harelber opened this issue Feb 4, 2025 · 9 comments
Open

Additional Features #25

harelber opened this issue Feb 4, 2025 · 9 comments

Comments

@harelber
Copy link

harelber commented Feb 4, 2025

Hi @GUVWAF ,
I am interested whether the simulator can be enhanced by:

  1. Enlarging the grid, from 12 KM X 12 KM to 25x25.
  2. Using >100 nodes
  3. Adding simulated obstacles like mountains

Do you know whether I can add these to the simulator?

@GUVWAF
Copy link
Member

GUVWAF commented Feb 4, 2025

Hey,

  1. You can change it here: https://github.com/meshtastic/Meshtasticator/blob/master/lib/config.py#L12. In this file are also several other configuration parameters.
  2. For the discrete event simulator you can simply change the number of nodes e.g. using python3 loraSim.py 200. For the interactive simulator in principle you can do so as well, but you'll likely need a very good computer to run more than 100 instances of the firmware.
  3. In principle this should be possible, but it would require a significant amount of coding. You'll have to change the pathloss model to incorporate obstacles as well.

@harelber harelber mentioned this issue Feb 4, 2025
@harelber
Copy link
Author

harelber commented Feb 4, 2025

@GUVWAF I am working on a research project involving the simulator. If you want to collaborate, me and my colleague would be happy to talk.
Please let me know how to reach out to you if this sounds interesting to you.

@GUVWAF
Copy link
Member

GUVWAF commented Feb 4, 2025

Unfortunately I only have very limited free time to work on projects like this, so I'm sorry but I have to decline the offer.
If you need any specific help you're always welcome to open issues though.

@harelber
Copy link
Author

harelber commented Feb 4, 2025

@GUVWAF Thanks for your response.
Do you have any initial pointers as to how to change the pathloss model to include obstacles?
Thanks!

@GUVWAF
Copy link
Member

GUVWAF commented Feb 4, 2025

The current pathloss model implementation can be found here:

def estimatePathLoss(conf, dist, freq, txZ=conf.HM, rxZ=conf.HM):

As you can see it only includes distance between nodes (and operating frequency), but does not take any additional attenuation into account. If you want to make it simple, you could define an obstacle at a certain location and when the line between the two nodes crosses that obstacle, you can add a certain amount of additional pathloss (e.g. 10dB).

If you really want to make it realistic, you could consider adding the SPLAT! RF analysis tool, which is also used by https://github.com/meshtastic/meshtastic-site-planner. Would be really cool to have this integrated with the simulator :)

@harelber
Copy link
Author

Thanks, @GUVWAF .

Is there a way to add the obstacles similar to the nodes themselves, in other words - in a GUI way - such that their addition can be easily propagated to the whole code?
I saw that the estaimeatePathLoss is called 5 times from different functions, thus adding obstacles should be added for each one of them.

@GUVWAF
Copy link
Member

GUVWAF commented Feb 12, 2025

In principle yes, you should add a method to draw the obstacles and store their coordinates e.g. in the Graph object. Instead of calling estimatePathloss() with the distance between nodes, you call it with the coordinates of the nodes, and inside the function you check whether the line between the nodes crosses an object and if so, you add the extra pathloss.

@harelber
Copy link
Author

I will clarify, @GUVWAF

Is adding the obstacle as a new type of node (similar to client/router) logical? of course, i will need to remove any message-transferring functionality...

@GUVWAF
Copy link
Member

GUVWAF commented Feb 17, 2025

That's an option, yes, but I'd imagine you want to draw the obstacle with e.g. a polygon instead of a single dot? You could e.g. look at the Polygon Selector. So for example, in the plot you could add a button for "Draw obstacle", and then use the polygon selector. Then add the coordinates of the polygon to a list of obstacles and then, like I described before, in estimatePathloss() calculate whether the line-of-sight path between two nodes crosses any of the obstacles.

Hope this helps, but I'm also not an expert in these GUI-related things.

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