GPS Plugin P082

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

GPS Plugin P082

#1 Post by Sasch600xt » 11 Sep 2021, 19:09

Hello all :)

Today I made my first experience with the GPS plugin.
First, thank you for this great and easy way to connect a GPS sensor to the esp :)

I know it is in beta phase, but may I say what I recognized today ?

- sometimes I get some impossible values for speed, like I drive about 70 kph, and it jumps down to 20kph or up to 350kph.
- I would love to set the decimal to 0 to get an integer of kph. To format the value is not working at the moment.
- I love the feature to publish my data depends on travelled meters. What about 3 steps to set ? Something like "speed under 10 kph" = 10 meters, "speed between 10 kph and 70 kph" = 100meters, "speed over 70 kph" = 300 meters
with this feature, I could save a little data volume at my sim card in my mobile router :)

It was easy to set up in my car today. Thanks a lot for your great work and have a great day :)
Sascha
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#2 Post by TD-er » 11 Sep 2021, 19:42

The "interval" in meters was mainly added to be able to store samples with a regular sample interval regardless the speed.
So to store in to flash using the "cache controller".
That's one of the more practical use cases using GPS, as you are likely not in the range of WiFi.

I can have a look at a more stepped interval, but I think it may be a bit difficult in practice as your "speed" may be quite high when standing still at a fixed location.
As a matter of fact, I have been working on filtering the speed reported by the GPS module as this can be a problem on a static location.

As long as the displacement is within HDOP * N you need quite a lot of filtering.
N depends on the used GPS receiver, but is typically between 8 and 30.
HDOP is reported by the GPS and is a standard deviation, expressed in N meters.
HDOP means Horizontal Dilution Of Precision.
It mainly depends on the SNR of the satellite signal and the largest angle between tracked satellites.
A small angle means large error. Just try to pinpoint the point where 2 circles intersect when their center is close to each other.

The speed is not in km/h, but in m/sec.
So you must multiply it by 3.6 to get km/h.
Wherever you use that value, you can already format it to 0 decimals.
See: https://espeasy.readthedocs.io/en/lates ... red-values

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#3 Post by Sasch600xt » 11 Sep 2021, 20:02

Hello TD-er,

I forgot to tell i multiplied by 3.6 already :)
Screenshot 2021-09-11 195155.jpg
Screenshot 2021-09-11 195155.jpg (39.42 KiB) Viewed 25423 times
Thank you for the hint about the post formatting.
I'll have a look right now :)

I do not have Wi-Fi only, I am online all the time with my car.
So for this case I'll have to take care about my data traffic.
This is why I thought it would be a great idea with the speed related upload :)

While my car is not moving, 22 km/h was the maximum I have seen, so this would not too much affect the idea, i guess.

To be honest, the impossible values are what I don't like most.
So for now I try to filter it out of the raw values in my backend of my house control software

Great job of you, like usually :) thank you for your service !
Have a great evening
Sascha
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#4 Post by TD-er » 11 Sep 2021, 22:40

You can also combine the "distance" and "interval"
For example, if you don't move too much, you probably don't need too many updates.
So you can set the interval to 300 sec (5 minutes) and the distance to 1 km.
When travelling at 120 km/h you have still 2 updates per minute, and when parked only one per 5 minutes.

You can also try to process the items in the rules to apply "filtering" when to send updates.
Still you can't rely on the reported speed when only using a few satellites.
Like I said, there needs to be some filtering implemented in the plugin.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#5 Post by Sasch600xt » 14 Sep 2021, 10:06

Hello :)

yes, distance and travelled I combine already :)
Thank you for your ideas

I have 4 values in the plugin set up which works good (speed, alt, long,lat)
now I would love to publish a 5th value like ODO.

in rules i try:
Publish,"%sysname%/GPS/Distanz Trigger/ODO", [GPS#dist]

But it doesn't work so far ? Can i only publish values which are set up in the plugin ?
Do you see where I am doing something wrong here ?

Thank you and have a great day :)
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#6 Post by TD-er » 14 Sep 2021, 10:44

Yep, you cannot (yet) access the other values, not assigned to the task values.
However, it is useful to have it, so I was already thinking about allowing to reference other values, in a taskvalue like format to be used in rules.
For example the Eastron plugin would greatly benefit from it.

There is some catch here though. Some plugins only fetch whatever is defined as an output value, so the others may not be present.
The GPS pushes its messages anyway, so there is no gain in not fetching it, but for example Modbus devices may need to query them explicitly which takes time.

So this is for sure something that will be added in the future, but is not yet available.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#7 Post by Sasch600xt » 14 Sep 2021, 10:48

YAY, that means I am doing nothing wrong here !!! LOL :)

Would it be easy to just add a 5th field for the plugin for now ?
otherwise, i will swap the value alt to dist
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#8 Post by TD-er » 14 Sep 2021, 11:21

Nope, that's not easy at all as this "4" of vars per task is used a lot in the code.
For example it wil render the settings incompatible.

It is easier to add this extra check for variables not sent via a controller to all plugins. :)

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#9 Post by Sasch600xt » 14 Sep 2021, 12:05

ok :)

i did swap alt with dist for now.

if i can breath i know i am below 6000 meter, so easy to check :)
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#10 Post by TD-er » 14 Sep 2021, 12:11

The reported altitude isn't really useful anyway.

You really need quite a lot of tracked satellites and even then the margin of error can be as high as 100m.
At least that's what I've seen on the Chinese uBlox clones.
So the margin of error is greater than the total altitude difference in the Netherlands ;)

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#11 Post by Sasch600xt » 14 Sep 2021, 12:33

hahahahaha, ok :)

by the way......do you know where i can buy an uBlox M8N ORIGINAL and not a clone ?
I would love to have a "real" one instead of the clones I have here...


Do you have an idea how I can store and publish the stored ODO value ?
At the moment always the ESP reboots, the ODO is zero again.
So i would love to have the "old ODO" somehow survive, add to the new one and publish.

Thank you so much for your help :)
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#12 Post by TD-er » 14 Sep 2021, 12:38

Hmm the ODO values are not stored in RTC, so they are indeed lost.
You could store them in a dummy, to at least survive a crash/reboot without loosing power.
But you cannot restore the ODO, so not sure if that's useful.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#13 Post by Sasch600xt » 14 Sep 2021, 12:50

ok, i´ll try to solve this in my backend software behind the ESP :)
"the flat earth society has members all around the globe"

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#14 Post by Sasch600xt » 14 Sep 2021, 22:16

Hello,

i come right now back from more tests about the gps plugin and found a strange behavior.


i found out, my conversation in the plugin like %value%*3.6 for m/s into kph or %value%/1000 for meters into kilometers ist not always working and is been ignored sometimes and published without conversation.

Hope that helps
Sascha
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#15 Post by TD-er » 14 Sep 2021, 23:58

What build?
And also where do you put the conversion? How do you fetch the values?

If you address the values directly and not from the event, then I think I know what is happening here.

The plugin does put the values in the UserVar (the task value array) directly, while the formula is only called after a PLUGIN_READ was successful.
So if you need consistent behavior, you either need to use the values only from the eventvalues in the rules, or compute it in the rules using the let command.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#16 Post by Sasch600xt » 15 Sep 2021, 09:00

Good morning :)

this build:
Screenshot 2021-09-15 085225.jpg
Screenshot 2021-09-15 085225.jpg (52.45 KiB) Viewed 25260 times


i do the conversation right in the plugin:
Screenshot 2021-09-11 195155.jpg
Screenshot 2021-09-11 195155.jpg (39.42 KiB) Viewed 25260 times
I have a display connected to the ESP in my car and i want the gps speed update every second.
So display and gps is set to 1 second interval.

this is why i do not publish all data to openHub Controller every second.
instead i use rules to do so.

Code: Select all

On Rules#Timer=2 do
  Publish,"%sysname%/GPS/Distanz Trigger/Speed", [GPS#spd#d2.0]
  Publish,"%sysname%/GPS/Distanz Trigger/Longitude", [GPS#long]
  Publish,"%sysname%/GPS/Distanz Trigger/Latitude", [GPS#lat]
  // Publish,"%sysname%/GPS/Distanz Trigger/Altitude", [GPS#alt#d0.0]
  Publish,"%sysname%/GPS/Distanz Trigger/ODO", [GPS#dist#d0.0]
  timerSet,2,120
endon

on GPS#travelled do
  Publish,"%sysname%/GPS/Distanz Trigger/Speed", [GPS#spd#d2.0]
  Publish,"%sysname%/GPS/Distanz Trigger/Longitude", [GPS#long]
  Publish,"%sysname%/GPS/Distanz Trigger/Latitude", [GPS#lat]
endon

Do you have an example how to use the let command in my case ?

Thank you very much ! :)
Sascha
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#17 Post by TD-er » 15 Sep 2021, 21:13

Code: Select all

on GPS#travelled do
  let,1,[GPS#spd#d2.0]*3.6 // Store speed in km/h in variable #1
  Publish,"%sysname%/GPS/Distanz Trigger/Speed", [int#1]
  Publish,"%sysname%/GPS/Distanz Trigger/Longitude", [GPS#long]
  Publish,"%sysname%/GPS/Distanz Trigger/Latitude", [GPS#lat]
endon
You first store the speed in km/h in variable #1.
When accessing this via [var#1] you get it as a floating point value.
But since you try to format it anyway, you can also fetch it as an integer value. [int#1]

You can store values in as many variables as you like.
For example you can also compute the average speed, since the GPS does output a new value every second.

Code: Select all

on GPS#travelled do
  let,1,[GPS#spd#d2.0]*3.6 // Store speed in km/h in variable #1
  let,2,[var#1}+[var#2] // collect the sum of all speeds in var#2
  let,3,[int#3]+1 // Count how many stored in the sum
  Publish,"%sysname%/GPS/Distanz Trigger/Speed", [int#1]
  Publish,"%sysname%/GPS/Distanz Trigger/Longitude", [GPS#long]
  Publish,"%sysname%/GPS/Distanz Trigger/Latitude", [GPS#lat]
endon

On Rules#Timer=2 do
  Publish,"%sysname%/GPS/Distanz Trigger/Speed", [GPS#spd#d2.0]
  Publish,"%sysname%/GPS/Distanz Trigger/Longitude", [GPS#long]
  Publish,"%sysname%/GPS/Distanz Trigger/Latitude", [GPS#lat]
  // Publish,"%sysname%/GPS/Distanz Trigger/Altitude", [GPS#alt#d0.0]
  Publish,"%sysname%/GPS/Distanz Trigger/ODO", [GPS#dist#d0.0]
  if [int#3] > 0
    let,4,[var#2]/[int#3]
  endif
  Publish,"%sysname%/GPS/Distanz Trigger/AvgSpd", [var#4#d2.0]
  let,2,0
  let,3,0
  timerSet,2,120
endon
The let command allows for all kinds of calculations.
In theory you could also do the computations in the publish command, but the calculations are then not always run as expected.
Using the let command it is way more predictable ;)

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#18 Post by Sasch600xt » 15 Sep 2021, 22:24

this is soooooo cool !!!

now i send traveled distance converted in km to my display which is connected to the ESP but at the same time publish it in meters to my controller hub.
This is amazing !! I love it :)
tomorrow i do some tests about the conversation errors in the plugin (which i dont need anymore be cause i´ll do it with custom variables)

maybe during winter i change my setup to an ESP32.

i am so exited lol :)

this is how it looks in my Software so far:
Screenshot 2021-09-15 172240.jpg
Screenshot 2021-09-15 172240.jpg (314.18 KiB) Viewed 25221 times
"the flat earth society has members all around the globe"

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#19 Post by Sasch600xt » 15 Sep 2021, 22:39

i want my display in my car refresh every second with the gsp speed.

ist it ok to have a timerinterval of one second, or is this too often ?

Code: Select all

On Rules#Timer=3 do
  let,1,[GPS#spd]*3.6 // Store speed in km/h in variable #1
  timerSet,3,1
endon
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#20 Post by TD-er » 15 Sep 2021, 22:55

1 sec interval is OK, as the GPS will output the same sequence of NMEA messages every second.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#21 Post by Sasch600xt » 15 Sep 2021, 23:03

great :)

by the way, another esp with espeasy:
(have a look for uptime :))
Screenshot 2021-09-15 230158.jpg
Screenshot 2021-09-15 230158.jpg (43.5 KiB) Viewed 25214 times
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#22 Post by TD-er » 15 Sep 2021, 23:16

Close to 1 million minutes :)
Great :)

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#23 Post by Sasch600xt » 16 Sep 2021, 08:48

Good morning :)

I solved it at my backend software and i could also solve it in rules now,
but for next update, you could maybe change the value after reset.
The value for distance is "-1" after reset. If it could be "0" would great :)

It is also very dangerous on the highway !!!!
Consider driving with 120 km/h and the ESP resets, car do an emergency stop, drive back one meter and accelerate to 120 km/h again........
Not sure my breakfast would stay where it was before......
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#24 Post by TD-er » 16 Sep 2021, 08:51

The "-1" is a good indication it is not set. So you can check for it in the rules.
About your example... it gets even worse, as it is a distance and not speed.
That would mean you have to teleport back to the starting point (and beyond) and start over again.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#25 Post by Sasch600xt » 16 Sep 2021, 09:00

your right :(
when i do a long ride over hundreds of kilometer and close to the goal the esp resets..... that would be depressing !
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#26 Post by TD-er » 16 Sep 2021, 12:20

On the other hand, if you need to get home quickly (e.g. stuck in a traffic jam), a reset of the ESP would be a nice feature :)
Let's hope nobody else is then parked on your spot.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#27 Post by Sasch600xt » 16 Sep 2021, 12:42

at least not one meter behind my old spot ^^
"the flat earth society has members all around the globe"

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#28 Post by Sasch600xt » 16 Sep 2021, 21:34

i am back from testdrive :)

just want to let you know, the conversation in rules works perfect now !
no errors anymore, straight values every second.
Thank you for all your great hints :)

I am looking forward to use more then 4 parameters, but i can wait a long time for.

The "must" is working perfect now :)

Have a great evening
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#29 Post by TD-er » 16 Sep 2021, 21:44

Great to hear it is running fine now :)
Let's hope you still keep an eye on the road while driving.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: GPS Plugin P082

#30 Post by Sasch600xt » 16 Sep 2021, 22:17

my dashcams are connected to the esp and a few servos controlling the car.
most of the time i´m in the back, sleeping.

no, serious, my girlfriend helped me out and where looking at the tablet and the display.
so all was safe :)
"the flat earth society has members all around the globe"

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#31 Post by TD-er » 16 Sep 2021, 22:37

Ah, so the WAF is strong in this one :)

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#32 Post by giorgino » 24 Oct 2024, 22:22

WHERE AM I WRONG ??

Hi, just bought a GPS NEO6m, connected for testing to a PC serial, it works !
Reading data at his 9600 with a serial monitor, got fix.. OK
Then I connect it at espeasy, and doesn't work; there is something I miss:
gps espeasy.jpg
gps espeasy.jpg (196.67 KiB) Viewed 3243 times
the GPS tx is connected at pin 25
No other device (for testing I've unflagged all the "enabled" flag in other device)

any idea?
thanks

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#33 Post by TD-er » 24 Oct 2024, 22:27

Please set it to "Serial 1" as on "Serial 0" you probably have the ESPEasy console.

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#34 Post by giorgino » 24 Oct 2024, 22:32

NOTHING ! IT WORKSSSS :D :D :D :D :D :D :D

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#35 Post by giorgino » 24 Oct 2024, 22:33

sorry, I was experimenting with serial software and something goes wrong

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#36 Post by TD-er » 24 Oct 2024, 22:42

Maybe also nice to check the "stats" checkboxes as it will then also show you some nice charts and also a scatter plot of longitude vs. latitude, so you can see where you've been, or how good the GPS position is being calculated.

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#37 Post by giorgino » 03 Nov 2024, 22:46

please how can I obtain more GPS data exept the four selected values? Do I have to "send all togheter?"

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GPS Plugin P082

#38 Post by Ath » 03 Nov 2024, 22:55

From Rules, in a Display configuration or Nextion Command Statements you can access all available values of the GPS task, as documented here: https://espeasy.readthedocs.io/en/lates ... ent-values
/Ton (PayPal.me)

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#39 Post by TD-er » 03 Nov 2024, 23:05

giorgino wrote: 03 Nov 2024, 22:46 please how can I obtain more GPS data exept the four selected values? Do I have to "send all togheter?"
Send all is a good first step as that will allow you to act on a single event.

For some project, I have added 2 'dummy' tasks with the taskvalue names set the same as in the link Ton gave.
So on the gps#all event I copied all values to these 2 dummy tasks and then called 'taskrun' on them to flush all other collected values to the 'cache controller'.
The idea is to have the GPS trigger an event every X meter and this will then collect all other sensor data and flush it to be stored on the file system along with the timestamp when the GPS event was given.

Code: Select all

On gps#All Do
  Let,4,%unixtime%
  LoopTimerSet,1,[int#2] // re-set the timer to have at least [int#2] seconds between samples.
  TaskValueSet,gps1,long,[gps#long] 
  TaskValueSet,gps1,lat,[gps#lat] 
  TaskValueSet,gps1,alt,[gps#alt] 
  TaskValueSet,gps1,spd,[gps#spd] 
  TaskRunAt,gps1,[int#4]
  Event,saveAllToFlash
Endon

On Rules#Timer=1 Do
  Let,4,%unixtime%
  Event,saveAllToFlash
Endon

On saveAllToFlash Do

   // Now collect  other data to store into 'dummy' tasks.
   // For this, we use the command TaskValueSet.
   // See: https://espeasy.readthedocs.io/en/latest/Rules/Rules.html#taskvalueset
   
   // First we get the other values from the GPS unit and store it  in the dummy task called "gps2"
   // See: https://espeasy.readthedocs.io/en/latest/Plugin/P082.html#access-to-all-measurement-values
   // N.B. the first 2 arguments of the TaskValueSet command are resp. the task name and variable name of a dummy task
   // So make sure these match with an enabled dummy task
   TaskValueSet,gps2,hdop,[gps#hdop] 
   TaskValueSet,gps2,satvis,[gps#sat_vis] 
   TaskValueSet,gps2,sattracked,[gps#sat_tr] 
   TaskValueSet,gps2,chksumfail,[gps#chksum_fail] 
   // Calling TaskRun will cause the values to be sent to the controller(s) assigned to the task
   TaskRunAt,gps2,[int#4]
   
   // Now we collect the latest samples of the analog voltages
   TaskValueSet,analog,carBat,[bat#Analog.avg2]
   TaskValueSet,analog,backupBat,[batBackup#Analog.avg2]
   // And flush them to the Cache Controller
   TaskRunAt,analog,[int#4]
   
   // Now we collect the latest samples of the BME280
   TaskValueSet,bme2,Temperature,[bme280#Temperature]
   TaskValueSet,bme2,Humidity,[bme280#Humidity]
   TaskValueSet,bme2,Pressure,[bme280#Pressure]
   // And flush them to the Cache Controller
   TaskRunAt,bme2,[int#4]
      
   // Collect some sysinfo
   TaskRunAt,sysinfo,[int#4]  
   
   // Collect error states
   TaskRunAt,error,[int#4]  
Endon

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#40 Post by giorgino » 03 Nov 2024, 23:13

thank you for explanation.
Is there an easy way to calculate BRG?
or I continue writing in rules a formula to calculate the azimuth between points

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#41 Post by TD-er » 03 Nov 2024, 23:22

What do you mean by "BRG" ?
Is that bearing? (direction) ?

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#42 Post by giorgino » 03 Nov 2024, 23:27

yes, BeaRinG , direction

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#43 Post by TD-er » 03 Nov 2024, 23:29

Just looked at the source of the library we use, TinyGPS++
https://github.com/letscontrolit/ESPEas ... B.cpp#L196
Seems the 'course' is also registered, so I could add it as an extra parameter.

For small intervals, you could maybe also use the math function atan2.
However I think that might give quite an offset the further away from the equator you get.

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#44 Post by giorgino » 03 Nov 2024, 23:42

yes, "course" seems to be the data I need... will it become available in a future edition of the plugin?

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#45 Post by TD-er » 03 Nov 2024, 23:46

I can add it to this pending PR: https://github.com/letscontrolit/ESPEasy/pull/5090

The reason it was not yet merged is that I'm not yet confident the way how I do increase the GPS resolution is the way to go forward as it will break some installations like Cache Controller, or at least the existing code to recreate the data later when reading back the stored values.
However the GPS resolution is actually significantly improved by that PR as the GPS on my desk shows about 2 - 3m standard deviation when in a static position.

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#46 Post by TD-er » 04 Nov 2024, 00:40

Just thought it shouldn't be that hard to add, so I quickly made some changes.
Can you test this PR when it is ready building? https://github.com/letscontrolit/ESPEasy/pull/5152

Test build: https://github.com/letscontrolit/ESPEas ... 1655632006

N.B. I did not test it, status is "it will probably compile" as that wasn't even tested.
Just made it quickly while I really had to get to bed...

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#47 Post by giorgino » 04 Nov 2024, 22:53

gps#course IT WORKS !
:D :D :D

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#48 Post by TD-er » 04 Nov 2024, 23:05

Great!
I will also add it to the documentation and then merge it :)

Thanks for testing.

giorgino
Normal user
Posts: 122
Joined: 24 Oct 2022, 21:06

Re: GPS Plugin P082

#49 Post by giorgino » 04 Nov 2024, 23:14

now waiting for a (semi) final version with 176 plugin included :mrgreen:

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPS Plugin P082

#50 Post by TD-er » 04 Nov 2024, 23:31


Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests