How to properly set a fixed position?

I’m trying to use one of my tbeams as a fixed base station, so I’m trying to set the coordinates to a fixed position so there won’t be a delay showing up on the map while the GPS tries to get a fix.

So far, I have run these python api commands:

meshtastic --setlat xx.x8972954649724
meshtastic --setlon xx.x0250983346154
meshtastic --setalt 20
meshtastic --set gps_operation 3

.

meshtastic --info     
Connected to radio
preferences {
  ls_secs: 300
  region: US
  gps_operation: GpsOpTimeOnly
  fixed_position: true
}

My question is - is this all that’s needed to prevent it from trying to get a GPS lock? It seems like it’s still not using the fixed coordinates that I entered, though --info also isn’t showing the coordinates or altitude setting, only the gps_operation. Currently in the node list on my mobile tbeam, it shows my base station recently online, but the coordinates are xx.x9023, xx.x0313.

I also tried to disable sleep by setting device sleep period to 0 in advanced settings, but that setting doesn’t seem to have saved. I basically want to turn off any power saving measures. I’m not 100% sure if it’s the same as ls_secs, since there is no description on the protobuf docs for that parameter: Meshtastic-protobufs/docs.md at master · meshtastic/Meshtastic-protobufs · GitHub

1 Like

There is way more info on power states here.
https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md

Thanks for the link, though it doesn’t give much info on parameters that affect sleep - “go back to sleep until we sleep for ls_secs” suggests that ls_secs is the duration of light sleep, but if that’s true, shouldn’t setting ls_secs to 0 disable sleep?

ls_secs 0 would set to default which according to the protobufs is 3600.

Have you checked whether set is_router true would satisfy your needs for power management. I believe router mode is BT off, deep sleep off, light sleep 24 hours, gps 24 hours (from the comments in NodeDB.h)

Also FYI. --set gps_operation 3 is still in the to-do-list. Probably not implemented yet.
https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/gps-todo.txt

I wanted to avoid is_router since that seemed to assume you want to conserve power - I would want BT on 24/7 since it’s plugged into the wall, and it seemed simpler to set BT always on and turn sleep off instead of using is_router and then undoing some of the things is_router sets.

Also wouldn’t light sleep 24 hours make it sleep for 24 hours?

Mainly, I want to:

  • Turn BT on 24/7
  • Turn off all forms of sleep
  • Set a manual position
  • Don’t try to get GPS position

I believe there is a fixed_position option

meshtastic --set fixed_position true

Yes, that seemed to have already set to true after I set the coordinates. But for some reason the coordinates showing on the map don’t match the ones I passed in, so I assume it’s still getting a GPS lock and sending those instead.

Even when I’m connected to the stationary node itself, the app shows a location near me instead of the coordinates I put into the CLI, so I don’t think it’s stale info.

1 Like

firmware 1.2.10

gps_operation 1

this should be the option to tell the GPS that is is stationary

According to Meshtastic-protobufs/docs.md at master · meshtastic/Meshtastic-protobufs · GitHub , “This mode was removed” :slightly_frowning_face:

But it also suggests GpsOpMobile (2) with gps_update_rate of 1 day, so maybe I’ll try that.

Edit: I suspect that gps_update_rate is supposed to be gps_update_interval on the page I linked, since I got an error Can't set gps_update_rate due to 'UserPreferences' object has no attribute 'gps_update_rate'

Light sleep is more like a suspend to RAM. The CPU stops but it can be woken up by the LORA radio as soon as a packet arrives or any other IRQ.

I know what light sleep is, I just want to disable it as well as deep sleep since my node is plugged into wall power so there’s no point.

Also it looks like gps_operation 2 and gps_update_interval 86400 did the trick for fixing the coordinates, the location on the map now shows the coordinates I passed to the python cli.

Now I just have to make sure it never goes to sleep, since having to wait for it to wake up when using the app is kinda annoying.

Edit: Just kidding - for some reason after power cycling to move the node to my window, the location appears to have switched back to a GPS location instead of the coordinates I gave. It looks like all the settings are still set, so I’m not sure what’s wrong:

preferences {
  ls_secs: 300
  region: US
  gps_operation: GpsOpMobile
  gps_update_interval: 86400
  fixed_position: true
}

Happy to try this myself and see if I can reproduce it. What version is the device on? (mine are now on 1.2.11).

I am interested in clarifying these command “sets” that allow people to configure the mesh & nodes for their purposes, as there are so many options!

Both of mine are also 1.2.11

Hi, my results from setting location below. It does work, but the odd thing was that it reports the longitiude correctly as 'longitudeI': 133877360 but no latitiude

meshtastic --version
1.2.12
meshtastic --setlat -23.69792
meshtastic --setlon 133.87736
meshtastic --setalt 298
Connected to radio
Fixing altitude at 298 meters
Setting device position

… connection appeared to hang here - probably not relevant,
… pressed the centre button, then had to start a new cmd session
Transition powerFSM transition=Press, from=POWER to=POWER

meshtastic --port COM3 --info
Connected to radio
my_node_num: 862628933
has_gps: true
num_bands: 20
firmware_version: "1.2.11"
message_timeout_msec: 300000
min_app_version: 20200
max_channels: 8

Nodes in mesh:
{'num': 862628933, 'user': {'id': '!336aac45', 'longName': 'Unknown ac45', 'shortName': '?45', 'macaddr': 'xE8zaqxF', 'hwModel': 'TBEAM'}, 'position': {'longitudeI': 1338773600, 'time': 1616402173, 'longitude': 133.87735999999998}}
preferences {
  ls_secs: 300
  region: ANZ
  fixed_position: true
}


meshtastic --set gps_operation 1
meshtastic --port COM3 --info
Connected to radio
my_node_num: 862628933
has_gps: true
num_bands: 20
firmware_version: "1.2.11"
message_timeout_msec: 300000
min_app_version: 20200
max_channels: 8

Nodes in mesh:
{'num': 862628933, 'user': {'id': '!336aac45', 'longName': 'Unknown ac45', 'shortName': '?45', 'macaddr': 'xE8zaqxF', 'hwModel': 'TBEAM'}, 'position': {'longitudeI': 1338773600, 'time': 1616402276, 'longitude': 133.87735999999998}}
preferences {
  ls_secs: 300
  region: ANZ
  gps_operation: GpsOpStationary
  fixed_position: true
}

Then I thought I would do a factory reset to clear any odd gps/location settings, but after that it does not recognise as v1.2.11. (Is this another bug?) It was fine after a power-off restart.

meshtastic --set factory_reset true
Connected to radio
Set factory_reset to true
Writing modified preferences to device

meshtastic --port COM3 --info
Traceback (most recent call last):
...
  File "c:\users\xx\appdata\local\programs\python\python39\lib\site-packages\meshtastic\__init__.py", line 641, in _waitConnected
    raise self.failure
Exception: This version of meshtastic-python requires device firmware version 1.2 or later. For more information see https://tinyurl.com/5bjsxu32

Did the restart, and then I repeated the test but sending commands as follows, and it worked fine. So maybe the reset is important, or sending --set gps_operation 1 first?

meshtastic --set gps_operation 1
Connected to radio
Set gps_operation to 1
Writing modified preferences to device

meshtastic --setlat -23.69792 --setlon 133.87736 --setalt 298

meshtastic --info
Connected to radio
my_node_num: 862628933
has_gps: true
num_bands: 20
firmware_version: "1.2.11"
message_timeout_msec: 300000
min_app_version: 20200
max_channels: 8

Nodes in mesh:
{'num': 862628933, 'user': {'id': '!336aac45', 'longName': 'Unknown ac45', 'shortName': '?45', 'macaddr': 'xE8zaqxF', 'hwModel': 'TBEAM'}, 'position': {'latitudeI': -236979200, 'longitudeI': 1338773600, 'time': 1616406964, 'latitude': -23.69792, 'longitude': 133.87735999999998}}
preferences {
  ls_secs: 300
  region: ANZ
  gps_operation: GpsOpStationary
  fixed_position: true
}