Obtain battery information from device in "is_router" mode

That’s great information, I will conduct such a simulation once I managed to understand all the required steps.

I think I start now to understand, from where the problem with my RAK4631 is coming. Please find attached the list of battery levels from this morning. Around 10:30 am we lost connection to the RAK, presumably because it shut down since battery voltage was dropping. We realized, that our ChUtil and AirTm is very high, even so only one message was sent this morning. Is this normal? I checked the RAK yesterday, hop.limit is 4, but some of our clients still have hop-limit of 7 as setting. What could have caused this pretty intense traffic? Any idea?

at 10:45 the RAK was online again, with battery levels of 74%. I changed the battery few minutes ago to check, if maybe the battery has a problem, but I think it is the usage that causes the problems.

Please find below the settings:

Preferences: { “device”: { “role”: “ROUTER”, “serialEnabled”: true }, “position”: { “positionBroadcastSecs”: 43200, “positionBroadcastSmartEnabled”: true, “gpsEnabled”: true, “gpsUpdateInterval”: 86400, “gpsAttemptTime”: 300, “positionFlags”: 3 }, “power”: { “waitBluetoothSecs”: 1, “meshSdsTimeoutSecs”: 4294967295, “sdsSecs”: 86400, “lsSecs”: 86400, “minWakeSecs”: 10 }, “network”: { “ntpServer”: “0.pool.ntp.org” }, “display”: { “screenOnSecs”: 600 }, “lora”: { “usePreset”: true, “region”: “EU_868”, “hopLimit”: 4, “txEnabled”: true, “txPower”: 27 }, “bluetooth”: { “enabled”: true, “mode”: “FIXED_PIN”, “fixedPin”: 123456 } }

If you have pip and python installed, it should not be too difficult to run the simulator. Feel free to ask me any questions.

I would also recommend setting the hop limit of the clients back. Apart from normal messaging, the devices send their nodeInfo periodically and already that can cause a lot of traffic using several devices with hop limit of 7.

@GUVWAF thanks for the advice, I started working with the simulation software.

I realized, that I needed to install python_tk as well. I used the command “brew install python-tk@3.10” for this (I’m working with a MAC Laptop).

Thereafter, the figure started, I was able to place nodes and the next step started as well (presumably the calculation), but then the program crashed with the feedback in the terminal below. Do you have any idea, what I missed to install?


python3 interactiveSim.py
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
sh: gnome-terminal: command not found
Error: Could not connect to native program: [Errno 61] Connection refused

Closing all nodes…
Traceback (most recent call last):
File “/Users/hauptmann/Documents/Arbeitsordner/01 nemotec UG/03 Projekte/14 Sonstiges/LORA Netzwerk/Meshtasticator-master/lib/interactive.py”, line 268, in init
iface = tcp_interface.TCPInterface(hostname=“localhost”, portNumber=n.TCPPort)
File “/usr/local/lib/python3.10/site-packages/meshtastic/tcp_interface.py”, line 28, in init
sock = socket.create_connection(server_address)
File “/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py”, line 845, in create_connection
raise err
File “/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py”, line 833, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/hauptmann/Documents/Arbeitsordner/01 nemotec UG/03 Projekte/14 Sonstiges/LORA Netzwerk/Meshtasticator-master/interactiveSim.py”, line 10, in
sim = interactiveSim() # Start the simulator
File “/Users/hauptmann/Documents/Arbeitsordner/01 nemotec UG/03 Projekte/14 Sonstiges/LORA Netzwerk/Meshtasticator-master/lib/interactive.py”, line 273, in init
self.closeNodes()
File “/Users/hauptmann/Documents/Arbeitsordner/01 nemotec UG/03 Projekte/14 Sonstiges/LORA Netzwerk/Meshtasticator-master/lib/interactive.py”, line 406, in closeNodes
n.iface.localNode.exitSimulator()
AttributeError: ‘interactiveNode’ object has no attribute ‘iface’

I didn’t know python-tk is required on Mac, thanks for pointing that out.

The interactive simulator is only tested on Linux and Windows, sorry. Though, it might work if you use it with Docker (see the instructions).

However, the discrete-event simulator, which is better suited for large-scale simulations, should work on Mac. Can you try: python3 loraMesh.py?

@GUVWAF great, loarMesh.py worked. Thanks for the hint. Is it possible to start the program with our configuration, i.e., a list of nodes and their locations (GPS coordinates)? I also would like to change the MODEL settings to 4 (rural-area), do you think that’s a good idea? I have seen the entry for the hop limit in the config.py file, I presume, that I would need to change this to check, if different hop limits show different/better results, right?

The best way to start the simulation again with all the nodes on your locations is to first place them all once on the plot (maybe you have to increase the size with YSIZE/XSIZE in lib/config.py). Then it will save the coordinates and you can run it again by using python3 loraMesh.py --from-file coords.

Indeed, if your region is a rural area, it would be good to set it to MODEL 4. This part is however probably the most uncertain part of the simulator, as it depends on a lot of factors in your real physical environment.
And indeed, you have to change the hop limit there as well if you want to see the influence. Note that unfortunately this then applies to all nodes at once, you cannot specify it per node.

@GUVWAF thanks, that’s all well understood and I will do so. Do you know, if the simulation does also consider the elevation? Our topology is not flat, we have basically one area close to the lake shore at lake level and another plateau at a level of 70m. We placed one router at the edge of the two plateaus, where is can oversee the lower plateau.

Furthermore, is it possible to mark 3-4 of the nodes as routers as we do in reality, or are all nodes handled as clients?

You can set the elevation of the nodes by setting HM in config.py. Unfortunately right now all settings will apply to all nodes. This also holds for setting the nodes as routers, which you can set in loraMesh.py (set isRouter to True).

It would be possible to configure each node separately, but that requires some work on the simulator.

I have done the simulations, all works fine. I placed the nodes to fit with our configuration. The xy range is 9000 x 14000 m.

I started with the stimulation and recognised, that the config file used US settings. I have redone the simulations with EU868 settings, which we use (we also use Long/Fast).

The results are interesting, for US settings a HOP.Limit of 5 resulted in best reach of nodes of 88%, but for EU868 settings, I only got only 43%, best results again with Hop.Limit=5.

Do you know, why the results are such different? Note: for EU433 the results are even worse.

Here you can find our config.py & out/coords settings: https://www.dropbox.com/scl/fo/2envifrspsvvkmcvj7vl2/h?dl=0&rlkey=e1e69ygez0n03n5iq0olorh1f

Nice to see you succeeded in doing the simulations :slight_smile:

In the US, a higher TX power is allowed (30dBm), which is why the results are much better. I just realized that for EU868 lately it was updated in the Meshtastic firmware to use 27dBm instead of 16dBm which was previously used (it was copied from LoRaWAN, but apparently 27dBm is allowed). I will change it in the simulator, you can do it as well in config.py → regions → power_limit.

I have redone the simulation with 27 dBm, see below. Now we can reach 81% reachablility with Hop.Limit = 4. That’s great. Increasing the tx_power by 3 dB would give us additional 5% (or would reduce missing messages by 30%). It’s a great tool, thanks for providing it. We now can also check where we should place an additional device, to obtain better results.

Actually, I have identified what caused the enormous amount of traffic in our network in the last days. For one node the settings were changed, such that GPS signals were updated every 20 seconds or so. When the node was moving (in car) even more frequent position information was sent. So I think here we have another way to reduce the traffic and power consumption in our network.

2 Likes

Just a note: I updated the simulator to support some configurations (hop limit, router, height and antenna gain) per node. If you use the plot to place the nodes, you can configure them there. Afterwards, you can modify a yaml file to change e.g. the hop limit of some of the nodes and run the scenario again (see also the updated documentation).

1 Like