Presentation and first questions
Hi, I'm Romuald, a FLOSS enthusiast, and I'm working on a project where I'm going to use OVMS platform as a part of the vehicle hybridisation system. To reach my goals, I'll have to: - Read two CAN buses to grab and display values on a HUD - Make an expansion board with some IC which requires to talk using I²C - Publish events on a third CAN bus which exposes additional sensors values I have a lot of questions about the really exiting OVMS board and platform, to start here are my firsts: - Is there is any trap I should take care that is not described in users or developers documentation regarding my goals? - Is there is any place where I can find some prototype boards¹? - Could someone guide me to be able to periodically wrote values on CAN bus using the OVMS code architecture²? Thanks for this awesome project! [1] I bough my OVMS from OpenEnergyMonitor and unfortunately none are sold [2] It's about read some sensors, compute values and provide results at a traditional CAN frequency on the bus. -- Romuald Conty Opus Codium
Romuald, Welcome. To answer your questions: Goals seem fine. OVMS has three CAN buses, expansion board area, and can (sic) write to the third CAN bus. Be aware that there are only two free full GPIOs available, but as I2C only uses two (SDA, SCL), you should hopefully be ok. No traps that I am aware of. Just follow the developer’s guide very carefully (in particularly regarding ESP IDF and compiler versions) to get your build environment up and running, and start with the default sdkconfig copied from support/sdkconfig.default.hw31. OpenEnergyMonitor should have some prototyping boards (I don’t think they list them on the website, but you can ask to confirm). If not, I can supply from Hong Kong but shipping times and costs are still crazy at the moment. Have a look at components/can for the framework. You just need a pointer to the can bus object, and then call the Write() method on it. You can look at can/src/can.c can_tx() function for an example. To do it periodically, you would need a task, or if lightweight use the timer functions. If you only need to write slowly (once a second or so), then even a script could do it. Regards, Mark.
On 27 Apr 2023, at 9:06 PM, Romuald Conty (Opus Codium) <romuald@opus-codium.fr> wrote:
Signed PGP part Hi,
I'm Romuald, a FLOSS enthusiast, and I'm working on a project where I'm going to use OVMS platform as a part of the vehicle hybridisation system.
To reach my goals, I'll have to: - Read two CAN buses to grab and display values on a HUD - Make an expansion board with some IC which requires to talk using I²C - Publish events on a third CAN bus which exposes additional sensors values
I have a lot of questions about the really exiting OVMS board and platform, to start here are my firsts: - Is there is any trap I should take care that is not described in users or developers documentation regarding my goals? - Is there is any place where I can find some prototype boards¹? - Could someone guide me to be able to periodically wrote values on CAN bus using the OVMS code architecture²?
Thanks for this awesome project!
[1] I bough my OVMS from OpenEnergyMonitor and unfortunately none are sold [2] It's about read some sensors, compute values and provide results at a traditional CAN frequency on the bus.
-- Romuald Conty Opus Codium
On Friday, 28 April 2023 07:36:30 CEST Mark Webb-Johnson wrote:
Be aware that there are only two free full GPIOs available, but as I2C only uses two (SDA, SCL), you should hopefully be ok. Which full GPIOs are available on internal expansion bus? On DA26 expansion port, it seems to be EXP_1 and EXP_2, which are GPIO 32 and 33 on ESP32, respectively; correct?
Just follow the developer’s guide very carefully (in particularly regarding ESP IDF and compiler versions) to get your build environment up and running, and start with the default sdkconfig copied from support/sdkconfig.default.hw31. Done, I built and flashed OVMSv3 firmware from sources. Documentation talk about an old ESP-IDF while recent commits are related to IDF v4. Is the documentation still the reference?
OpenEnergyMonitor should have some prototyping boards (I don’t think they list them on the website, but you can ask to confirm). If not, I can supply from Hong Kong but shipping times and costs are still crazy at the moment. I got in touch with OpenEnergyMonitor and yes, prototyping boards are available, thank you.
Have a look at components/can for the framework. Ok, do you thing i2c implementation should go in components/i2c ?
[...] To do it periodically, you would need a task Is there is a code base to write a task in OVMSv3 context? or a similar code that have the right architecture in current firmware?
-- Romuald
Romuald, welcome :-) Am 27.04.23 um 15:06 schrieb Romuald Conty (Opus Codium):
To reach my goals, I'll have to: - Read two CAN buses to grab and display values on a HUD - Make an expansion board with some IC which requires to talk using I²C - Publish events on a third CAN bus which exposes additional sensors values
[...] To do it periodically, you would need a task Is there is a code base to write a task in OVMSv3 context? or a similar code that have the right architecture in current firmware?
There is a `TaskBase` class, but that doesn't offer much of an advantage for your use case. Creating a task really is very simple with FreeRTOS. Examples: * The `obd2ecu` component derives & publishes HUD data using a task and seems to be close to your use case. * The `retools_pidscan` component uses a task to scan for PIDs on OBD2/ISO-TP devices. * The `canopen` component uses worker tasks to handle async CANopen protocol communication. Regards, Michael -- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
participants (3)
-
Mark Webb-Johnson -
Michael Balzer -
Romuald Conty (Opus Codium)