GPS Data & Hybrid Pondering

#1

Hey guys!

Just curious, when my dongle is online and I do a cloud.peek_cache_queue pend I can see some GPS data in there. This never shows on the events panel or updates location yet.

Is that feature still in progress?

Also, I’ve a hybrid and I suspect that when I start rolling that the voltage difference isn’t sufficient to wake the AutoPi from it’s slumber. My drive to work this morning didn’t seem to wake the device at all.

Can you provide some insights on the above?

Thanks! :smiley:
John

#2

Did some further testing. Forced the engine to run and connected locally. Using obd.status on the local dongle showed the below. No events listed in the minion log file for any engine data. Just voltage.

#3

And final test on my wife’s regular petrol powered car. #sadface

#4

Hi @foehammer,

Welcome to the forum :slight_smile:

So, a couple of other users has already reported that some EV and PHEV has problems returning the data directy.

You can see all data available through standard OBD PID’s using this command:

obd.commands

You will most likely discover that your wife’s petrol car har a lot more commands available.

The solution to get the data from the EV, and there is a solution, is to listen to commands flowing on the can bus using socketcan. We are working on a solution for this, but you are more than welcome to investigate this until the “official” solution is ready.

This was also addressed in this thread:

Best
Peter

#5

Thanks Peter! I’ll give that a go for sure!

Any tips on the GPS data? :slight_smile:

#6

Sure. You can always check if the GPS position is up using this command:

ec2x.gnss_location

The GPS wont be associated with a trip, unless the system is able to create on. I think your petrol car will be able to create a trip.

#7

Peter, how can I run the commands from linux shell? I want to send location, fuel, and other data to my openhab home automation server via mqtt.

#8

Hi Sip

Well, it’s not officially supported yet, but as the system is open source, it is very possible.
You should look into creating a custom salt module, the same as the ec2x module that peter mentioned above.

You can take a look at the modules in autopi core repo.

  1. Create a custom salt module that does what you need. import mqtt, etc.
  2. Create a job (can be done through my.autopi.io), that calls the moduleName.functionName (like ec2x.gnss_location)

The job will then execute your module, at specific times, defined using a cron expression. Ie. every N days/hours/minutes.

As this is not really supported yet, you should keep a backup of your module, so that if an update removes the file, you will not lose your code.

(The ui is ready for creating custom modules, but we need to do more work behind the scenes)

Best regards
/ Malte

#9

So does it have to be a salt module? I already have python scripts that run on the pi, I just need to figure out how to access the salt module from shell to get the data for my scripts.

#10

I am trying to write a salt module, but the salt command does not seem to be on the pi.

http://pyholodeck.readthedocs.io/en/latest/first_module.html

I found I could run s salt command from shell, but it takes a VERY long time to execute.
pi@raspberrypi:~ $ date ; sudo salt-call ec2x.gnss_location ; date
Tue 24 Jul 14:30:15 UTC 2018
local:
----------
_stamp:
2018-07-24T14:31:02.476297
alt:
28.0
cog:
0.0
date_utc:
2018-07-24
fix:
2D
hdop:
2.0
lat:
42.35943
lon:
-71.02703
nsat:
9
sog_km:
0.0
sog_kn:
0.0
time_utc:
14:31:02
Tue 24 Jul 14:31:04 UTC 2018
pi@raspberrypi:~ $

#11

Hi

Yeah, it needs to be a salt module, the reason for this, is that it gets a lot of context from the minion instance and ability to talk to other modules this way.
But you don’t need to move everything, you should be able to create a ‘skeleton/shell’ module, that imports your other code and executes it.

Regarding the long run time of the command, then yes, using salt-call is not a good way to do it, as this spins up an entirely new instance of the minion, calls the command and then exists.
This adds a lot of overhead.

If you add a custom module to the modules directory on the minion, remember to restart the salt-minion service. I don’t think it will show up if you dont.

Do you have your code hosted on github by any chance? I’d love to take a look at some point.

Best regards
/Malte