Jump to content
vag

Wrong real-time consumption

Recommended Posts

Yes, the job is configured to run once every minute and only one job may run at a time.

I have some more and positive info:

I reality, it needs to run for a while in order to provide the data to ABRP. Because of the actual pandemic limitations, driving a car is only possible for very small distances and this was apparently not always enough to get the data.

So I can confirm that the script definitely works, but we need to drive for a few Kms in order to have the results online.

Thank you Jason 🙂

Link to comment
Share on other sites

5 hours ago, vag said:

Yes, the job is configured to run once every minute and only one job may run at a time.

I have some more and positive info:

I reality, it needs to run for a while in order to provide the data to ABRP. Because of the actual pandemic limitations, driving a car is only possible for very small distances and this was apparently not always enough to get the data.

So I can confirm that the script definitely works, but we need to drive for a few Kms in order to have the results online.

Thank you Jason 🙂

Hmm, that shouldn't be the case, unless the AutoPi is taking a while to boot up (which I've seen if it's been asleep for a very long time).  Ah well, probably more improvements needed.

Link to comment
Share on other sites

The AutoPi doesn't takes that long to boot and we can see this by checking its web interface after power on, for instance. So I don't think that the delay could come from that.

Anyway, this would be of course a nice improvement, but the script works perfectly for the rest. All in all, having the online info uploaded for very short distances is not that necessary.

Link to comment
Share on other sites

Hi vag,

 

can you tell me exactly how you configured kwargs and args in the cronjob? I tested Jason's script as well on my Kona Ev and it doesn't work at all, while my previous script keeps working flawlessly (I'm back to my script actually).

Do you need to put token and car_model between apexes ( ' ' ) in the kwargs/args? I tired that as well, without any improvement...

Edited by TheRussian
Link to comment
Share on other sites

Hi @TheRussian,

In the attached picture you have everything you need to make the script work:

ap_job.jpg.e981d658c1024b634b523aa09c100cd4.jpg

Variable items that depend on your setup:

Name: is the name of the job, put something that reminds you what that job does

Function: This is the name of the script, as you saved it in "Advanced" -> "Custom Code" AutoPi screen/menu. The first part is the exact name that you setup in the custom code script creation (I have set my_abrp_iternio) and here you must add the ".tlm" part (at the end of the script's name)

Kwargs: Your own token as you see it in my example (replace the xxxxxx...) and at the next line the Kona car_model, exactly like you see it here above.

All the rest must be exactly like on the picture here above.

You save the cron job and you synchronize it with the AutoPi.

After a while, it should start to send data to ABRP. Sometimes, and I don't know the reason why, it takes a little long to start sending the data.

But it definitely works.

 

Link to comment
Share on other sites

Hi Vag, there must be some bugs in the script you're running/testing... It keeps not starting at all in my AutoPi, even with the same parameter configured, and the fact that sometimes it takes longer to load it's not a good symptom either... 😅

On the contrary, my own script (taken from the original AutoPi script from pLord12) starts as soon as AutoPi has boot constantly (2 minutes roughly) and sends regularly data to ABRP (even if limited by the cronjob time execution every 1 minute at the moment). I think at this point I'm going to start from mine and implement the 2 seconds reading from there, as I don't really know where to modify yours in order to have it running properly.

I'll get back to this post regularly to update you and see if in the meantime you solved the issue! 🙂

Edited by TheRussian
Link to comment
Share on other sites

Hello @TheRussian,

It is indeed a bit too slow at the startup, I don't see exactly why, but the script works well.

You need to let it work for a few days in order to better estimate if it works or not. Hopefully we'll find out why soon.

Link to comment
Share on other sites

@Jason (ABRP)

Thank you for this new version. I uploaded your new version to the car.

The script works like previously and the delay is still there.

For small distances with the car (about 2km in the city: taking approximately 5-6 minutes with the parking), it doesn't has the time to send the data to ABRP.

Link to comment
Share on other sites

That's very strange behavior, I can't think of any reason it should take that long to initialize.  When I restart the script on my device locally it only takes a few seconds.  Do you have any way to confirm whether the AutoPi itself is fully booted up?

I wonder if I need to get a little fancier about killing the script when it thinks it's time to go to sleep so we don't end up with a zombie script on resume.

Link to comment
Share on other sites

@Jason (ABRP) Today i tried something to see if the AutoPi wakes-up well on the car power-on. For this I used a power-on trigger that sends me an e-mail when the system boots.

So this morning I received it at 7:45, when I powered on the car which is normal. On the other side, the last update that I have on ABRP is dated from yesterday, at 21:17, which is the time when I powered off the car (yesterday).

The above means that the AutoPi starts well when the car is ON and powers down correctly when the car is OFF.

The script doesn't starts on the same time than the AutoPi. I hope this can help you.

Link to comment
Share on other sites

My suspicion is that the script is not properly quitting when the AutoPi goes to sleep, which leaves it in kind of a zombie state until it eventually crashes.  So I'm going to toy with some internal handling of that on the script.  Will post in the AutoPi support thread when I make that update:

 

Link to comment
Share on other sites

The zombie state idea sounds like a good path to follow, especially because the AutoPi wakes up every 3 hours, as it is configured actually, so even without using the car, the ABRP script should have at least one update within this interval. But this is not the case.

Link to comment
Share on other sites

7 hours ago, vag said:

The zombie state idea sounds like a good path to follow, especially because the AutoPi wakes up every 3 hours, as it is configured actually, so even without using the car, the ABRP script should have at least one update within this interval. But this is not the case.

It's not that surprising, actually, I don't have the ABRP script report in unless it has a minimum amount of data (Need SoC and Power, if memory serves) So if the car is off it won't receive that data, and it won't report in.

I checked with AutoPi, and when they say "sleep" they actually turn the Pi all the way off. So my zombie process hypothesis doesn't really hold water.

Link to comment
Share on other sites

@Jason (ABRP) After the last AutoPi update from 27/05/2020, the script seems to work correctly, even during very short trips.

This means that until now and after several tests, I didn't encountered the problem that we had before.

The only thing that I noticed, is that from time to time, when the car is OFF, it shows the "charging" sign, while it is not powered to any charger. This is occasional. Maybe a badly interpreted state?

 

Link to comment
Share on other sites

1 hour ago, vag said:

@Jason (ABRP) After the last AutoPi update from 27/05/2020, the script seems to work correctly, even during very short trips.

This means that until now and after several tests, I didn't encountered the problem that we had before.

The only thing that I noticed, is that from time to time, when the car is OFF, it shows the "charging" sign, while it is not powered to any charger. This is occasional. Maybe a badly interpreted state?

 

Yes, this is something I'm trying figure out a better way to handle in the main AutoPi support thread:

I've got a PID posted there that I'm considering to better note charging/driving status, would you mind giving it a try to see if it accurately reports status?

Link to comment
Share on other sites

1 minute ago, vag said:

@Jason (ABRP) of course I can give a try.

Is this included in the actual version of your script from here?: https://github.com/iternio/autopi-link/blob/master/my_abrp.py

Not yet, wanted to get confirmation it was useful before incorporating.  You should be able to run the "obd.query" command in local.autopi.io when connected to the hotspot, and it should (if it works) return 1 if charging, 0 if not charging.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...