I am planning to work on support for the Tesla Powered 2012-2014 Toyota RAV4 EV. I don't see any evidence of earlier work on Github. I have done some preliminary recon and determined that only the main Toyota CAN and Tesla CAN are needed for the desired information. Maybe K-Line for TPMS would be nice since the car won't display pressures, but the Toyota Techstream diagnostic software does. The most valuable information is on the Tesla CAN and should be similar or exactly the same as other Tesla models. I am just starting to gather hardware and software at this moment, but suggestions are welcomed. - Mike
On Thu, 27 May 2021, Michael Iimura wrote:
I am planning to work on support for the Tesla Powered 2012-2014 Toyota RAV4 EV. I don't see any evidence of earlier work on Github. I have done some preliminary recon and determined that only the main Toyota CAN and Tesla CAN are needed for the desired information. Maybe K-Line for TPMS would be nice since the car won't display pressures, but the Toyota Techstream diagnostic software does. The most valuable information is on the Tesla CAN and should be similar or exactly the same as other Tesla models.
Welcome! The Tesla Roadster is one of the most complete implementations since it was first, but the CAN protocols in later models are much different. I know Mark has implemented some support for the Model S which should be more similar. -- Steve
Hi Mike, As you have already found out, the MB B250e is also pretty similar to your car from a drive-train perspective. The can bridges between the Tesla-stuff and OBD connector are probably different. MB implementation has the TPMS info in OBD-CAN - have you tried to just record the traffic and decode it with savvyCAN? Another approach that might work is reverse engineering the Techstream communication. Jarkko pe 28. toukok. 2021 klo 2.23 Stephen Casner (casner@acm.org) kirjoitti:
On Thu, 27 May 2021, Michael Iimura wrote:
I am planning to work on support for the Tesla Powered 2012-2014 Toyota RAV4 EV. I don't see any evidence of earlier work on Github. I have done some preliminary recon and determined that only the main Toyota CAN and Tesla CAN are needed for the desired information. Maybe K-Line for TPMS would be nice since the car won't display pressures, but the Toyota Techstream diagnostic software does. The most valuable information is on the Tesla CAN and should be similar or exactly the same as other Tesla models.
Welcome! The Tesla Roadster is one of the most complete implementations since it was first, but the CAN protocols in later models are much different. I know Mark has implemented some support for the Model S which should be more similar.
-- Steve _______________________________________________ OvmsDev mailing list OvmsDev@lists.openvehicles.com http://lists.openvehicles.com/mailman/listinfo/ovmsdev
Stephen, You were right on. Most of the Tesla Model S code worked straight away. I have made a pull request for my initial work that involves only the Tesla CAN bus on Can1. I have not even started looking at the Toyota CAN because most of the useful stuff is already broadcast on the Tesla bus. I pulled the cooling system temperatures and pump speed percentages and put them in new vehicle specific metrics. I fumbled my way through copying the method of making a vehicle specific web page from the Nissan Leaf code so that I could display that information. However, I got stuck when populating those metrics into the web page. The compiler throws this error for each of my new metrics: L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp: In static member function 'static void OvmsVehicleToyotaRav4Ev::WebCooling(PageEntry_t&, PageContext_t&)': L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:100:50: error: invalid use of member 'OvmsVehicleToyotaRav4Ev::m_v_bat_cool_in_temp' in static member function c.printf("<p>Battery Coolant Inlet: %.1f C</p>", m_v_bat_cool_in_temp->AsFloat()); ^ In file included from L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:38:0: L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.h:90:22: note: declared here OvmsMetricFloat *m_v_bat_cool_in_temp; ^ Anybody have a clue what I'm doing wrong here? - Mike On Thu, May 27, 2021 at 4:23 PM Stephen Casner <casner@acm.org> wrote:
On Thu, 27 May 2021, Michael Iimura wrote:
I am planning to work on support for the Tesla Powered 2012-2014 Toyota RAV4 EV. I don't see any evidence of earlier work on Github. I have done some preliminary recon and determined that only the main Toyota CAN and Tesla CAN are needed for the desired information. Maybe K-Line for TPMS would be nice since the car won't display pressures, but the Toyota Techstream diagnostic software does. The most valuable information is on the Tesla CAN and should be similar or exactly the same as other Tesla models.
Welcome! The Tesla Roadster is one of the most complete implementations since it was first, but the CAN protocols in later models are much different. I know Mark has implemented some support for the Model S which should be more similar.
-- Steve _______________________________________________ OvmsDev mailing list OvmsDev@lists.openvehicles.com http://lists.openvehicles.com/mailman/listinfo/ovmsdev
On Fri, 2 Jul 2021, Michael Iimura wrote:
However, I got stuck when populating those metrics into the web page. The compiler throws this error for each of my new metrics:
L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp: In static member function 'static void OvmsVehicleToyotaRav4Ev::WebCooling(PageEntry_t&, PageContext_t&)': L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:100:50: error: invalid use of member 'OvmsVehicleToyotaRav4Ev::m_v_bat_cool_in_temp' in static member function c.printf("<p>Battery Coolant Inlet: %.1f C</p>", m_v_bat_cool_in_temp->AsFloat());
That error is straightforward. You can only reference non-static member variables in an object when you have a pointer or reference to that object. Static member functions are called without referencing any object, so the processor would not know where to find the member variable. -- Steve
Steve, So, what's the solution? Is there a function I can call to pull those metric variables into the scope? Clearly other web page objects can push and pull variables to and from the rest of the OVMS system. - Mike On Fri, Jul 2, 2021 at 10:00 PM Stephen Casner <casner@acm.org> wrote:
On Fri, 2 Jul 2021, Michael Iimura wrote:
However, I got stuck when populating those metrics into the web page. The compiler throws this error for each of my new metrics:
L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:
In static member function 'static void OvmsVehicleToyotaRav4Ev::WebCooling(PageEntry_t&, PageContext_t&)':
L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:100:50:
error: invalid use of member 'OvmsVehicleToyotaRav4Ev::m_v_bat_cool_in_temp' in static member function c.printf("<p>Battery Coolant Inlet: %.1f C</p>", m_v_bat_cool_in_temp->AsFloat());
That error is straightforward. You can only reference non-static member variables in an object when you have a pointer or reference to that object. Static member functions are called without referencing any object, so the processor would not know where to find the member variable.
-- Steve _______________________________________________ OvmsDev mailing list OvmsDev@lists.openvehicles.com http://lists.openvehicles.com/mailman/listinfo/ovmsdev
Michael, Am 03.07.21 um 06:48 schrieb Michael Iimura:
L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:100:50: error: invalid use of member 'OvmsVehicleToyotaRav4Ev::m_v_bat_cool_in_temp' in static member function c.printf("<p>Battery Coolant Inlet: %.1f C</p>", m_v_bat_cool_in_temp->AsFloat()); ^ In file included from L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:38:0: L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.h:90:22: note: declared here OvmsMetricFloat *m_v_bat_cool_in_temp; ^ Anybody have a clue what I'm doing wrong here?
as Steve already explained, if you want to access a member variable, you need to get the object (vehicle) pointer. You could do so by calling MyVehicleFactory.ActiveVehicle(). But do you really want a static metric value in a web page? Why not use a standard metric display so you can see the dynamic value changes? To do so, you simply need to add class "receiver" to e.g. your main panel div, then do: c.printf("<p>Battery Coolant Inlet: <span class=\"metric\" data-metric=\"xr4.v.b.t.cltin\">?</span> C</p>"); Or, using the metric number widget to get some default layout & style: <div class="receiver"> ... <div class="metric number" data-metric="xr4.v.b.t.cltin" data-prec="1"> <span class="label">Battery Coolant Inlet:</span> <span class="value">?</span> <span class="unit">°C</span> </div> ... </div> See https://docs.openvehicles.com/en/latest/components/ovms_webserver/docs/metri... for the full reference. Regards, Michael -- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
participants (4)
-
Jarkko Ruoho -
Michael Balzer -
Michael Iimura -
Stephen Casner