hopLimit Behaviour

Hi all,

I’m looking in packet data dictionary and i saw a variable called hopLimit, looking a bit deeper i saw hopLimit changing. I’m not sure about hopLimit Behaviour:

is hopLimit decreasing at each hop (hopLimit=3 is directly received and hopLimit=1 is packet two times repeated)?

Thank for the clarification

Regards

2 Likes

From the above document: “Each node in the mesh, if it sees a packet on the ether with HopLimit set to a value other than zero, it will decrement that HopLimit and attempt retransmission on behalf of the original sending node.”

I believe you are correct, but I am not the most knowledgeable on this subject.

1 Like

Thanks for the answer, it seems to work for what I need. I’ve tried with a cuple of nodes and it seems to work this way.

Regards

1 Like

SO I am attempting to transmit from my house > big hill > big hill > friends house. 4 total nodes, is the hop limit why I’m not getting a message to him?

Try sending a Python message with a larger hop limit.

import meshtastic
interface = meshtastic.SerialInterface()
interface.sendText("hello mesh", hopLimit=4)
interface.close()

I haven’t tried it but it should work as expected.

1 Like

I think that is just 2 hops. In that example only the nodes on big hill(s) would need to retransmit for ‘friends house’ to get packets.

I agree. The first node seems to me to reduce the hoplimit when receiving a packet from an Android application.
In my case it is similar.
https://meshtastic.discourse.group/t/hoplimit-form-android-app/2137

Ideally with what the project has now you should use the Range Test plugin to see how well messages are reaching each hill.

Keep in mind places like LA are likely to have a lot of other things using the shared frequency so the effective range may be limited.

At your friends house is the device on the ground or a few stories up?

1 Like

I was back up on the 2nd hill closest to my friends house today. When I’m up there I can communicate with my friends house and with the router on hill one. But I don’t see my home node. Back at home I see only the node on hill one. I even brought a 2nd unit with me and switched them out so I’m pretty confident it’s not the hardware. I can see all the nodes I should from each location. But not the next hop nodes.

I’m not ruling out interference, but if I can see the next location being signaled from each place I go I’m not sure why messages aren’t being delivered. Btw all nodes are on 1.1.50

If I were to use the signal test plugin which nodes should I configure as transmitter and receiver?

Oh and to answer directly my friends node has a LOS to the hill, 67% signal

this is returning the error

Traceback (most recent call last):
File “<pyshell#3>”, line 1, in
interface.sendText(“hello mesh”, hopLimit=4)
TypeError: sendText() got an unexpected keyword argument ‘hopLimit’

can anyone give me a idea of what’s wrong with the syntax?

I just tried it and it didn’t error for me. Can’t quite tell if it actually changed the hoplimit because I’m struggling with other 1.2.6 difficulties. The code is pretty straight forward.

def sendText(self, text: AnyStr,
             destinationId=BROADCAST_ADDR,
             wantAck=False,
             wantResponse=False,
             hopLimit=defaultHopLimit,
             onResponse=None):
    &#34;&#34;&#34;Send a utf8 string to some other node, if the node has a display it will also be shown on the device.

    Arguments:
        text {string} -- The text to send

    Keyword Arguments:
        destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR})
        portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
        wantAck -- True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
        wantResponse -- True if you want the service on the other side to send an application layer response

Is your python tool up to date?

sudo pip3 install --upgrade meshtastic

I’m on 1.1.50, so my tool is on 1.1.50

I guess I need to update all my nodes over to 1.2? Will I be able to change the hop limit on each of them permanently? I am not able to send a python message with hoplimit 4 as it continues to return an error to me, so I’m still being limited to 2 hops I think.

Hey check it out 13 Miles over mountains and Los Angeles, getting node updates but no messages - #6 by geeksville

1 Like

Btw I just noticed this thread - alas I don’t read all threads. Cool work you did!