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 🙂

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@vag, @TheRussian - I updated the script with some additional robustification, and moved the wake/sleep handling back inside the script (sets 10min sleep timers and resets them if charging or driving).  I confirmed it works pretty well for my Bolt EV, could you try it with your cars?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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:

 

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Contact Us

Bo - Lead Developer and Tesla owner: bo@abetterrouteplanner.com

Jason - New Car Models, Developer and Bolt owner : jason@abetterrouteplanner.com

Idreams - Forums Administrator, Forums Developer and Tesla owner : idreams@abetterrouteplanner.com

×
×
  • Create New...