Jump to content

Recommended Posts

The problem is that it's not even updating every 30 seconds, while more than once every 2 minutes... So I wonder if it's really related to that additional part of the script or something else...

One more question: In the Kona the flag is_driving is always true except when is_charging is true, correct?

Link to post
Share on other sites
  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

The AutoPi ABRP script is to a point where I'm much happier with its behavior.  If there's interest, I'd be happy to add car support for the cars we know PIDs for (mainly Ioniq and Soul), but I need p

I've done another test this morning, I can confirm that during this test the charging power and SOC are updated correctly, so it must have been something else than your script (maybe carrier coverage

Great to hear! Feel free to PM me or email me if you've got questions on how to make it work. Awesome! Glad to hear it.

Posted Images

On 7/24/2020 at 11:37 AM, TheRussian said:

The problem is that it's not even updating every 30 seconds, while more than once every 2 minutes... So I wonder if it's really related to that additional part of the script or something else...

One more question: In the Kona the flag is_driving is always true except when is_charging is true, correct?

That's really weird, I just took my Bolt for a camping trip with the AutoPi and it worked really well.  That would imply that the problem is somewhere in the HKMC-specific code.  Wish I had one on-hand to test with.  Don't suppose anyone is in Houston with one so I can test directly?

Either way I'll take some time and see if I can figure out what's going on.

On 7/25/2020 at 10:57 AM, jasonamyers said:

I picked on of these up, but I got an audi e-tron I'm gonna spend sometime seeing what I can script up.

Great! Will probably need to tinker with the CAN recording mode to figure out the PIDs.  I've also heard that the E-Tron has a system which sets the alarm something tries to access the OBD while it's locked and off, might have to figure out how to turn that off.

Link to post
Share on other sites

Well, I can send you the code that was actually working for me in the past, if you wish to look for the differences... 😅

Anyway, I've just reset my AutoPi completely: now the behavior of your last script is that it's only triggered once every minute by the cronjob, so I can confirm that something is not working correctly with the script itself.

 

 

Edited by TheRussian
Link to post
Share on other sites
7 hours ago, TheRussian said:

Well, I can send you the code that was actually working for me in the past, if you wish to look for the differences... 😅

Anyway, I've just reset my AutoPi completely: now the behavior of your last script is that it's only triggered once every minute by the cronjob, so I can confirm that something is not working correctly with the script itself

I'll take it! Or if easier, just pick out the commit on Github with the most recent working version:
https://github.com/iternio/autopi-link/commits/master

And I'll work it out from there.

Link to post
Share on other sites
14 hours ago, TheRussian said:

Here's the last working code: I would still love to get the new PIDs/feature you inserted in latest releases though (odometer, speed, kWh charged, etc.)... 😇

LastWorkingScriptKonaEv.txt 14.34 kB · 0 downloads

Wellp, I made a dumb error.  Generic is_driving() always returned false for you, so yeah, it'd basically go to sleep and never report in.  I upgraded the generic 'is_driving' function so it's a little smarter than that, so hopefully it works as expected now.  I also merged it into the service branch, so feel free to grab either version and give it a try.

Link to post
Share on other sites

Jason, if I want to remove the additional sleep management that you have in your script, what lines should I remove? It seems like your script sees -0.0003kW (which is clearly a mis-reading, as there's nothing going on) and prevents AutoPi from going to sleep.

I've already implemented a robust routine to schedule sleep in another script, so I would just like to remove this feature from your script, without breaking it obviously... 😅

Is it enough to remove the following?

    # Manage sleep as the last thing in the script.
    self.manage_sleep()
    if self.scripts is not None:
      for script in self.scripts:
        try:
          script.on_cycle(self.car.data)
        except:
          safelog(traceback.format_exc(), always=True)
          pass


  def manage_sleep(self,force=False):
    if time.time() - self.last_sleep_time < 60 and not force:
      return
    else:
      self.last_sleep_time = time.time()
    should_be_awake = False
    if not force:
      should_be_awake = self.car.should_be_awake()
    else:
      should_be_awake = True
    if should_be_awake:
      # clear all sleep timers and re-set timers for fail-safe.
      safelog("Should be awake:" +str(should_be_awake) + ' - Resetting sleep timer')
      try:
        __salt__['power.sleep_timer'](*[],**{'clear': '*', 'add': 'ABRP Sleep Timer', 'period': 600, 'reason': 'Vehicle inactive'})
      except:
        safelog(traceback.format_exc(), always=True)
        pass

 

Edited by TheRussian
Link to post
Share on other sites

Glad to hear it's working as intended now!

And to avoid sleep management, don't even need to remove the manage_sleep function itself, just where it's called on the second line you quoted.

I also just pushed a version that adds a 0.1kW power tolerance on the sleep function, only keeps you awake if you have >= 0.1kW power.

Link to post
Share on other sites
18 hours ago, Reynald said:

Hello, 

 

I'm using this script flawlessly on my Kona EV, thank you @Jason (ABRP) ! 

Now I'm going to try to convert this script as an add-on to ABRP script :https://github.com/plord12/autopi-tools/blob/master/my_charge_status.py I'm not really a developper, so let's see... 

Great to hear! Feel free to PM me or email me if you've got questions on how to make it work.

2 hours ago, TheRussian said:

Thanks Jason, I deactivated your sleep code and now everything works just fine. 👍

Awesome! Glad to hear it.

  • Thanks 1
Link to post
Share on other sites
  • 2 weeks later...
  • 3 weeks later...

I have a problem using that last version of the script:

I installed it about 2 weeks ago and went for a trip of about 1000km. After 350Km it stopped updating.

I restarted the Autopi etc and didn't worked back again except after a few days.

Actually the script doesn't updates ABRP anymore, while other scripts on the Autopi operate very well, like previously.

The same behavior happens on a friend's Kona that has the same config like me.

I commented out the sleep line self.manage_sleep() but this didn't changed anything.

Any idea of what this problem could be?

Link to post
Share on other sites
On 9/15/2020 at 2:56 PM, vag said:

I have a problem using that last version of the script:

I installed it about 2 weeks ago and went for a trip of about 1000km. After 350Km it stopped updating.

I restarted the Autopi etc and didn't worked back again except after a few days.

Actually the script doesn't updates ABRP anymore, while other scripts on the Autopi operate very well, like previously.

The same behavior happens on a friend's Kona that has the same config like me.

I commented out the sleep line self.manage_sleep() but this didn't changed anything.

Any idea of what this problem could be?

That's very strange, and you're certain you have the most recent version of the script? I haven't changed it in the last month or so, and it's been working pretty much constantly for me.

Link to post
Share on other sites

Yes, I downloaded it at least 3 times and saved it in the Autopi, the restarted everything etc. The the result is still the same.

The best that I could had lastly was to have it operating only randomly.

Link to post
Share on other sites

@vag - huh, do you have the ability to SSH into the AutoPi and check the logs? 

https://community.autopi.io/t/guide-how-to-ssh-to-your-dongle/386

If so, try adding:

debug=True

To the Job's Kwargs, then restart the AutoPi (to restart the job), SSH in, and run:

sudo tail -f /var/log/salt/minion | grep ABRP

Which will isolate just the logs associated with the ABRP script.  See if there's anything useful that would tell us what's going on causing the issue?

Link to post
Share on other sites

Hi, the Autopi was finally completely blocked and was not booting up. I had to reflash it from scratch.

Now it works again, the debug=true is configured in the kwargs, but performing:

sudo tail -f /var/log/salt/minion | grep ABRP

doesn't outputs anything on the screen.

Link to post
Share on other sites

Hi again,

After having reinstalled the Autopi, there was also an update pushed out on 1st of October that I launched too.

Since then, I made a trip of about 100 Km go & return without any issue.

Hopefully, the problem was from the Autopi unstable state. Nevertheless, The problems that I had were during a longer trip (about 1000 km) and they started after about 300 km.

So I need to check again when I'll have to drive far, but for the moment it operates without issues.

Thank you.

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.


×
×
  • Create New...