meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.32k stars 804 forks source link

Cannot set lat&lon via CLI #900

Closed osmanovv closed 2 years ago

osmanovv commented 2 years ago

With the latest changes in coordinates handling (probably #875 or later) there is no way to set fixed coordinates via CLI:

meshtastic --setlat 55.0000000 --setlon 37.0000000 --setalt 133

Could someone confirm it?

@syund, @a-f-G-U-C, please check it. With the previous firmware it works fine.

a-f-G-U-C commented 2 years ago

O:-) I think it was me in #880

Simply put, I overlooked that the end-user can also be a source of packets, and inadvertently bundled user-generated packets together with device-generated packets which are exempt from (re-)processing. In reality, end-user packets are a separate source of data, with distinct characteristics from the other two.

Thanks for the notice and apologies for the breakage,

a-f-G-U-C commented 2 years ago

@osmanovv , PR #901 fixed the problem for me, with no apparent side effects - should be safe to give it a try

osmanovv commented 2 years ago

Hm, I have built #da9dd62 from your fork and still have

Altitude: 0m
0.000000 0.000000

on display and no lat&lon info in CLI output.

osmanovv commented 2 years ago

I tested it on my DIY device and T-BEAM1+:

C:\ttt>meshtastic --set fixed_position true
Connected to radio
Set fixed_position to true
Writing modified preferences to device

C:\ttt>meshtastic --setlat 55.00000000 --setlon 37.0000000 --setalt 182
Connected to radio
Fixing altitude at 182 meters
Fixing latitude at 55.00000000 degrees
Fixing longitude at 37.0000000 degrees
Setting device position

C:\ttt>meshtastic --info
Connected to radio

Owner: Unknown e30c (?0C)

My info: { "myNodeNum": 4064600844, "hasGps": true, "numBands": 13, "firmwareVersion": "1.2.46.da9dd62-d", "rebootCount": 1, "messageTimeoutMsec": 300000, "minAppVersion": 20200, "maxChannels": 8 }

Nodes in mesh:
  {'num': 4064600844, 'user': {'id': '!f244e30c', 'longName': 'Unknown e30c', 'shortName': '?0C', 'macaddr': 'CDryROMM', 'hwModel': 'TBEAM'}, 'position': {'batteryLevel': 100}}

Preferences: { "phoneTimeoutSecs": 900, "lsSecs": 300, "fixedPosition": true }

Channels:
  PRIMARY psk=default { "modemConfig": "Bw125Cr48Sf4096", "psk": "AQ==" }

Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
a-f-G-U-C commented 2 years ago

OK, one more question please. Do the lat/lon/alt values appear to be saved initially, then overwritten by zeros, or do they seem to be completely ignored? If you run the --info command immediately after the --setlon etc command, does it show the values even for the briefest time, or not at all?

Also, before my tests I used meshtastic --set gps_operation 3 just to be sure the GPS will stay out of the way. Can you please make one more test with this setting?

Thank you

osmanovv commented 2 years ago

On TBEAM I tried --info command immediately after the --setlon several times - there are no lat&lon in position element in my node info. On OLED there are 000000's.

The same result with meshtastic --set gps_operation 3.

I tried to flush TBEAM again and also noticed that I cannot set owner via CLR:

C:\ttt>meshtastic --info
Connected to radio

Owner: Unknown e30c (?0C)

My info: { "myNodeNum": 4064600844, "hasGps": true, "numBands": 13, "firmwareVersion": "1.2.46.da9dd62-d", "rebootCount": 1, "messageTimeoutMsec": 300000, "minAppVersion": 20200, "maxChannels": 8 }

Nodes in mesh:
  {'num': 4064600844, 'user': {'id': '!f244e30c', 'longName': 'Unknown e30c', 'shortName': '?0C', 'macaddr': 'CDryROMM', 'hwModel': 'TBEAM'}, 'position': {'batteryLevel': 100}}

Preferences: { "phoneTimeoutSecs": 900, "lsSecs": 300 }

Channels:
  PRIMARY psk=default { "modemConfig": "Bw125Cr48Sf4096", "psk": "AQ==" }

Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ

C:\ttt>meshtastic --set-owner CP4N
Connected to radio
Setting device owner to CP4N

C:\ttt>meshtastic --setlat 55.00000000 --setlon 37.0000000 --setalt 182
Connected to radio
Fixing altitude at 182 meters
Fixing latitude at 55.00000000 degrees
Fixing longitude at 37.0000000 degrees
Setting device position

C:\ttt>meshtastic --info
Connected to radio

Owner: Unknown e30c (?0C)

My info: { "myNodeNum": 4064600844, "hasGps": true, "numBands": 13, "firmwareVersion": "1.2.46.da9dd62-d", "rebootCount": 1, "messageTimeoutMsec": 300000, "minAppVersion": 20200, "maxChannels": 8 }

Nodes in mesh:
  {'num': 4064600844, 'user': {'id': '!f244e30c', 'longName': 'Unknown e30c', 'shortName': '?0C', 'macaddr': 'CDryROMM', 'hwModel': 'TBEAM'}, 'position': {'batteryLevel': 100}}

Preferences: { "phoneTimeoutSecs": 900, "lsSecs": 300, "fixedPosition": true }

Channels:
  PRIMARY psk=default { "modemConfig": "Bw125Cr48Sf4096", "psk": "AQ==" }

Primary channel URL: https://www.meshtastic.org/d/#CgUYAyIBAQ
a-f-G-U-C commented 2 years ago

@osmanovv, it seems that in the rush to get the issue fixed I forgot to check in one of the files (in PR #901 ), which explains the discrepancy between our results. My apologies once again. I am pushing a new PR in a few minutes, which should provide the missing piece.

Can't comment on the "set owner name" problem yet, it appears to be a separate issue but we'll see.

osmanovv commented 2 years ago

I am on the map now - https://github.com/meshtastic/Meshtastic-device/pull/906 fixes this issue. Thanks for all your work.

geeksville commented 2 years ago

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/device-firmware-1-2-47-alpha/4298/1

geeksville commented 2 years ago

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/device-firmware-release-1-2-47-alpha/4299/1