Request For Help: Software Developers (OVMS and Mobile)

Hello everyone.

There has been some positive developments on the ability to interface with the car via the OBD port. This will probably mean we can query the car using diagnostic protocols and pull some information back out.

I am hoping to be able to say exactly what messages need to be sent (i.e. CAN ID and Payload) as well as how to interpret the messages coming back out (decode bytes to signals).

This “should” mean we can interface with almost any OBD compatible device. My first thoughts are obviously OVMS as well as Bluetooth dongles (e.g. ELM327 with Android).

I wondered if anyone here has had any experience or would like to learn more about the following?:

  • OVMS development
  • ELM327 Development/API use both Wifi and Bluetooth(BT)
  • Android App development and use of the BT interfaces
  • iOS Development and use of BT/Wifi interfaces

I know this will need to be a collective effort, and I am pretty sure we have the skills to try this out. I am hoping that I can link us all up and build a few teams/contacts up to develop this. If you have any experience or interest please can you let me know.

Thanks in advance :smile:

1 Like

No experience in those specific areas (although i have at somepoint made an IOS app - but without BT/Wifi ). But i’m sure I can learn :slight_smile:

Imho, we should consider 3 scenarios:
A. Direct OBD2 whilst car is active and driver in vicinity of car

  • Mostly for SoC/charge speed etc/climate control/other live values? (elm327 dongle via wifi or bt?)

B. OBD2 dongle whilst car is parked near house (preheat/SoC/timed charge)( Either OVMS or elm327 dongle with wifi join functionality (bt would be out of each easily))

C. Remote access whilst car is anywhere (3g/4g via OVMS)

Questions:

  1. Is there an ELM327 adapter that can connect to a 3rd party network (instead of the usual hotspot functionality?) that way, it could join your local wifi network and commands could be sent remotely to the specific dongle. Useful for preheat/SoC/timed charging. Otherwise we would have to go the elm327(serial)+breakout board route
  2. do you know if the obd2 portstays active/powered while the car is left alone on a charger for a couple of hours? do we actively need to keep the car awake?

In personally look forward to the functionality of of ‘B’. The different scenarios might require different software development skillsets. I think we should determine the first target and gather the right people for that goal.

this is great news! I have an OVMS unit purchased especially for this purpose (interfacing with the MG). I can either help with testing, or send you the unit for you to test with. Please let me know how I can help?
thanks again!
Doug

Hi,

I’ve got experience with C++ on embedded, although mostly on AVR, and ARM (ST). I also gave a few Android apps.

Happy to help.

I’ve got a CanZE ESP32 module.

Thanks, Chris.

I’ve got a Bluetooth obd2 adaptor and am happy to run an Android debug/logging tool to gather information if that helps, or connect my laptop which can run windows or Linux to the obd2 device.

I think I have got to the limit of my coding ability with OVMS when trying to setup a vehicle module for the MG…I dont think i have the time, skills, or patience to code a proper vehicle module…From previous projects usually I am reasonably good at debugging and extending functionality to an existing codebase.

I have listed pretty much the exact data needed to be sent to the car and the process of decoding it in the CAN Hack Master spreadsheet , under the DIAG CAN (OBD Request) tab, transmit and receive frames are identified to pull data off the car. You can do all this with standard OBD connections (no breakout lead is needed).

Please help community :slightly_smiling_face:

I will have a look at what’s needed for OVMS integration. can’t be that hard…

I’ve forked the OVMS code base and have ordered the hardware. If there’s a few of us able to work on it should we have a single repo to work on?

Hi Mike, this may be a silly question. But the App Torque has an option in the settings to allow for the user to add custom PIDs. Could this be used as a temporary option to get data such as SOC and SOH.

I’ve been looking at the code of OVMS and having figured out the conversions for all of the PIDs now. Just need to record the responses. Then obviously wait for the hardware to test it. Is the CAN at 500kbit? And I don’t suppose you know which OVMS CAN it’s on? I’m assuming 1 for now until I can test it.

Yes absolutely I have forked and created the vehicle component “shell” for the MG on my Github…is a community github supported? anyway If anyone pushed back code to my fork I will accept it as long as it compiles :slight_smile:

I have opted for MG EV rather than MG ZS EV as it appears from the diagnostic tool to be a cross compatible system MG is using…good indications for the MG5

And to your second question, yes it is 500K CAN on CAN 1

@Northy Wecome to the community, Yes i have looked at Torque. it appears you cannot send to a particular address (just to the broadcast address) not sure that will work but will look to investigate further.

Initial code base pushed to https://github.com/MG-EV-Hackers/Open-Vehicle-Monitoring-System-3-MGEV/tree/feature/mg-zs-ev. It builds, but no idea if it works.

If someone wants to give it a go, you should be able to OTA update from this URL: https://drive.google.com/u/0/uc?id=1XRz6S20OQb6upUfvenhLluuhvnfLzcaA&export=download

PLEASE NOTE: I have not got an OVMS yet, so this is entirely untested. It should be safe to do an OTA update because if it breaks you can roll back, but that’s all theory.

Getting there :grin:, currently giving a TX err on CAN1. I can look more this afternoon. The incoming msg, I think was from the Diagnostic tool which i tried alongside

I (278638) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (278648) ovms-server-v2: Incoming Msg: MP-0 Z0
E (279268) can: can1: intr=2391731 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=22 txdelay=20 wdgreset=0 errreset=0
E (291268) can: can1: intr=2491651 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=23 txdelay=20 wdgreset=0 errreset=0
E (293268) can: can1: intr=2508295 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=24 txdelay=20 wdgreset=0 errreset=0
E (295268) can: can1: intr=2524952 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=25 txdelay=20 wdgreset=0 errreset=0
E (297268) can: can1: intr=2541609 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=26 txdelay=20 wdgreset=0 errreset=0
E (299268) can: can1: intr=2558244 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=27 txdelay=20 wdgreset=0 errreset=0
E (301268) can: can1: intr=2574891 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=28 txdelay=20 wdgreset=0 errreset=0
I (301268) housekeeping: 2020-08-31 10:26:54 BST (RAM: 8b=87728-88368 32b=9576)
E (303268) can: can1: intr=2591549 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=29 txdelay=20 wdgreset=0 errreset=0
E (305268) can: can1: intr=2608215 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=30 txdelay=20 wdgreset=0 errreset=0
E (317268) can: can1: intr=2708414 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=31 txdelay=20 wdgreset=0 errreset=0
I (332878) webserver: HTTP GET /dashboard
E (339268) can: can1: intr=2891803 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=32 txdelay=20 wdgreset=0 errreset=0
E (341268) can: can1: intr=2908474 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=33 txdelay=20 wdgreset=0 errreset=0
E (343268) can: can1: intr=2925126 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=34 txdelay=20 wdgreset=0 errreset=0
E (345268) can: can1: intr=2941785 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=35 txdelay=20 wdgreset=0 errreset=0
E (347268) can: can1: intr=2958447 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=36 txdelay=20 wdgreset=0 errreset=0
E (349278) can: can1: intr=2975216 rxpkt=0 txpkt=0 errflags=0x8040a2 rxerr=128 txerr=16 rxovr=0 txovr=37 txdelay=20 wdgreset=0 errreset=0
E (350058) can: can1: intr=2981746 rxpkt=0 txpkt=0 errflags=0x804016 rxerr=128 txerr=16 rxovr=0 txovr=37 txdelay=20 wdgreset=0 errreset=0dhcps: send_nak>>udp_sendto result 0

Are the messages in the “EV CAN MSGs” sheet broadcast? Can I just process them without having to poll?

Are we sure it’s connected to CAN1 on the OVMS? Just wanted to make sure the pin outs weren’t weird or something and making it on a different bus. The incoming message was from the OVMS cloud server, nothing to do with the CAN.

Just found the Nissan cable has the CAN1 and CAN2 swapped over the standard cable. You might need to recompile with it on CAN2 (or buy the standard cable).

@chris :man_facepalming: of course it is, as the EV CAN is assigned to CAN 1…could you possibly do another build with HSCAN2? I tried my end but I cant get the ovms.bin file out, it seems to be not liking my idf version at the moment?

Nothing is broadcast on the OBD port, it would all need PID retrieval. EV CAN access would need to go in via a breakout lead (do-able but harder to do).

I have re-built using CAN2 (hopefully). Try this: https://drive.google.com/file/d/1V0XPah5zppuaacoxgdIAPvZLxWOgYEDt/view?usp=sharing

My OVMS has shipped, hopefully get it by Wednesday.

Mine has shipped as well (with standard OBD cable, GPS and GSM antenna)

@chris did you see https://docs.google.com/document/d/1q5M9Lb5jzQhJzPMnkMKwy4Es5YK12ACQejX_NWEixr0/edit
?