TheRussian 1 Posted July 24, 2020 Share Posted July 24, 2020 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? Quote Link to post Share on other sites
jasonamyers 0 Posted July 25, 2020 Share Posted July 25, 2020 I picked on of these up, but I got an audi e-tron I'm gonna spend sometime seeing what I can script up. Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 2, 2020 Author Share Posted August 2, 2020 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. Quote Link to post Share on other sites
TheRussian 1 Posted August 3, 2020 Share Posted August 3, 2020 (edited) 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 August 3, 2020 by TheRussian Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 3, 2020 Author Share Posted August 3, 2020 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. Quote Link to post Share on other sites
TheRussian 1 Posted August 4, 2020 Share Posted August 4, 2020 (edited) 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 Edited August 4, 2020 by TheRussian Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 5, 2020 Author Share Posted August 5, 2020 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. Quote Link to post Share on other sites
TheRussian 1 Posted August 6, 2020 Share Posted August 6, 2020 I've just tested it and it seems to work correctly now, updates every few seconds as expected. I'll do some more tests and report back with results! 😉 Quote Link to post Share on other sites
TheRussian 1 Posted August 6, 2020 Share Posted August 6, 2020 (edited) 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 August 6, 2020 by TheRussian Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 6, 2020 Author Share Posted August 6, 2020 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. Quote Link to post Share on other sites
TheRussian 1 Posted August 10, 2020 Share Posted August 10, 2020 You mean I just need to comment this line? self.manage_sleep() Thanks! Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 11, 2020 Author Share Posted August 11, 2020 On 8/10/2020 at 1:59 AM, TheRussian said: You mean I just need to comment this line? self.manage_sleep() Thanks! Correct! Quote Link to post Share on other sites
Reynald 0 Posted August 11, 2020 Share Posted August 11, 2020 (edited) 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... Edited August 11, 2020 by Reynald Quote Link to post Share on other sites
TheRussian 1 Posted August 12, 2020 Share Posted August 12, 2020 Thanks Jason, I deactivated your sleep code and now everything works just fine. 👍 Quote Link to post Share on other sites
Jason-ABRP 180 Posted August 12, 2020 Author Share Posted August 12, 2020 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. 1 Quote Link to post Share on other sites
TheRussian 1 Posted August 25, 2020 Share Posted August 25, 2020 I confirm full functionality of the script now, at least every 30 seconds if not more, good logging, good consumption estimation. Full marks for ABRP with Kona and AutoPi so far. 👑 Quote Link to post Share on other sites
vag 0 Posted September 15, 2020 Share Posted September 15, 2020 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? Quote Link to post Share on other sites
Jason-ABRP 180 Posted September 22, 2020 Author Share Posted September 22, 2020 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. Quote Link to post Share on other sites
vag 0 Posted September 26, 2020 Share Posted September 26, 2020 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. Quote Link to post Share on other sites
Jason-ABRP 180 Posted September 27, 2020 Author Share Posted September 27, 2020 @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? Quote Link to post Share on other sites
vag 0 Posted September 30, 2020 Share Posted September 30, 2020 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. Quote Link to post Share on other sites
vag 0 Posted October 5, 2020 Share Posted October 5, 2020 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. Quote Link to post Share on other sites
TheRussian 1 Posted December 1, 2020 Share Posted December 1, 2020 Hello guys, back to say that everything works good for me on the Kona Ev 64kWh with AutoPi. Only "issue" is that the consumption is over estimated, even when reading the live data from AutoPi: it's usually overestimate consumption of about 10% in a trip where I use 80% SOC. Basically I start from 100%, the trip predicted SOC at the end to be 20% and I finally end up with 30% SOC. Quote Link to post Share on other sites
Jason-ABRP 180 Posted December 2, 2020 Author Share Posted December 2, 2020 Interesting, do you use any of the premium live planning settings like live weather / traffic? If you have the burndown chart active during the drive, is there any kind of pattern where it seems to diverge? Quote Link to post Share on other sites
TheRussian 1 Posted January 11 Share Posted January 11 Actually no, anything specific. I don't have the premium live features. It's not a pattern, it's just like a constant "factor" across the entire trip, it's always about 8-10% error... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.