Hello everybody, my name is Julien, I am a soon-to-be CS engineer from France. I am working on an internship project that requires to modify the Renault Twizy's internal parameters via the CAN bus. I am very interested in the work done by the OVMS developers on that topic. In the past few weeks I have learned quite a lot about Twizy's SEVCON through the documentation and also by browsing through the OVMS car module's source code. Thanks a lot for all the documentation and advice you provide! I have some questions that I hope you guys can answer to (TL;DR below). MSG commands My current situation is that I have upgraded my OVMS module to 2.6.5 firmware with the .hex file provided on GitHub. I have also successfully connected to the module via SMS commands and Android App. Most of the basic commands that I tried worked. I say 'most', because I have set the #15 'write' bit to '1' and cleared the #14 bit as well. However, I don't seem to be able to send CFG commands via SMS (such as CFG SPEED <speed> for example) in the way that the twizy manual describes it. All I get are push notifications forwarding my SMS to the app. Is there something I'm missing? :( Compilation issues On an other topic, I have installed MPLABX and acquired the C18 compiler thanks to someone hosting it on a personal website (note: it's nowhere to be found in the microchip archive and static links sourcing it on the website are all dead at the moment). I have tried to compile the V2_RT_Production from the last source available on GitHub. However I ran into compilation errors in vehicle_twicy.c, caused by what I assumed were missing '#define' directives (i.e 'OVMS_TWIZY_BATTMON' & 'OVMS_TWIZY_CFG'). I didn't see them referenced anywhere but in the version comments at the start of the file:
- Twizy battery monitor compiler switch: OVMS_TWIZY_BATTMON
So I added these two, but I don't know if they were supposed to be left out. Incidentally, I ran into a new compilation error:
Error - section '.romdata_net_msg.o' can not fit the section. Section '.romdata_net_msg.o' length=0x000000a8
Which as I understand is an issue relative to the length of the file being too large to pass compilation. I'm fairly new to PIC programming, so I may have misinterpreted some of these compilation errors. I imagine there is a lot of work in progress on the code so maybe the version I pulled was not a stable one ? Any remark or advice is most welcome! DIAG communication Probably noob error: I tried connecting through the DIAG port with minicom. I set minicom to 9600 Bds / 8N1, as specified in the developers documentation, but had no success. I think that I'm closed since since I received data, but it was just gibberish encoding errors. Since these errors are often caused by a wrong baud setting, I tried different baud values without success. I hope somebody can point out something that I could have missed. I have read the manual, but, well... you never know. TL;DR - Can I send SMS CFG commands to Twizy 2.6.5 firmware? - Is there any specific advice on how to get started on OVMS source and compile it for the Twizy? - Communication with DIAG port on minicom only speaks gibberish although I have (supposedly) correct settings. Could I have missed something? Anyway, I hope I'm not bothering you with all my questions. Sorry for the long e-mail. I look forward to reading from you ! Julien Nozais
Hi Julien, welcome :) Am 22.09.2014 um 16:55 schrieb Julien NOZAIS:
*MSG commands*
My current situation is that I have upgraded my OVMS module to 2.6.5 firmware with the .hex file provided on GitHub. I have also successfully connected to the module via SMS commands and Android App. Most of the basic commands that I tried worked.
I say 'most', because I have set the #15 'write' bit to '1' and cleared the #14 bit as well. However, I don't seem to be able to send CFG commands via SMS (such as CFG SPEED <speed> for example) in the way that the twizy manual describes it. All I get are push notifications forwarding my SMS to the app. Is there something I'm missing? :(
Yes. That's having read the last page of the manual and/or having browsed through this list's archive... ;) The Github hex files are missing the SEVCON functions. You need to download the latest hex release from the german forum or compile yourself. To compile yourself you need to define these (and only these) compiler flags: OVMS_CAR_NONE OVMS_CAR_RENAULTTWIZY OVMS_HW_V2 OVMS_DIAGMODULE OVMS_INTERNALGPS OVMS_TWIZY_BATTMON OVMS_TWIZY_CFG ...and you need to manually exclude source files "acc.c", "logging.c" and all other "vehicle*.c" from the build, because otherwise...
Error - section '.romdata_net_msg.o' can not fit the section. Section '.romdata_net_msg.o' length=0x000000a8
... this will happen ;) Just use the context menu "properties" on the files to exclude them.
*DIAG communication*
Probably noob error: I tried connecting through the DIAG port with minicom. I set minicom to 9600 Bds / 8N1, as specified in the developers documentation, but had no success. I think that I'm closed since since I received data, but it was just gibberish encoding errors. Since these errors are often caused by a wrong baud setting, I tried different baud values without success. I hope somebody can point out something that I could have missed. I have read the manual, but, well... you never know.
Be sure to also disable any flow control. Depending on your serial adapter, another parameter init and/or hardware reconnect may be necessary. Also make sure your serial device is writable by your login, to be sure launch minicom as root.
I look forward to reading from you !
I look forward to reading about your project :) Regards, Michael -- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Hi Michael,
The Github hex files are missing the SEVCON functions. You need to download the latest hex release from the german forum or compile yourself.
thank you for the clarification. I was not sure what functionnalities were covered by that hex file. I wanted to be able to build the hex on my own since I'll need to make some changes to the code during my project.
To compile yourself you need to define these (and only these) compiler flags: OVMS_CAR_NONE [..] ...and you need to manually exclude source files "acc.c", "logging.c" and all other "vehicle*.c" from the build
I have removed the "-DOVMS_LOGGINGMODULE" option in the makefile and added "OVMS_TWIZY_BATTMON" and "OVMS_TWIZY_CFG". The other compiler flags were already present so there was no need to add them. (I was I confused at first because I added "#define" for the whole list of compiler flags in "ovms.def", and it didn't turn out well). I have excluded "acc.c" and "logging.c" from the build, but I have kept "vehicle.c", "vehicle_none.c" and "vehicle_twizy.c" as I assumed they were necessary. I don't have compilation errors any more, so I guess I didn't do everything wrong. :) I will now flash the module and test if the CFG commands work.
Be sure to also disable any flow control. Depending on your serial adapter, another parameter init and/or hardware reconnect may be necessary. Also make sure your serial device is writable by your login, to be sure launch minicom as root.
Thank you for the suggestions, I am going to explore all possibilities. I have already tried logging in root, and I sudo all the time, but unfortunately that didn't help. I will look into any parameters specific to my hardware and maybe try with a different computer / cable / terminal. I'll keep you posted on any advance I make. Regards, Julien
Hi, quick update.
I will look into any parameters specific to my hardware and maybe try with a different computer / cable / terminal.
The first computer I tried to connect with is a custom onboard and I don't have access to USB ports. I managed to successfuly connect to the DIAG port using USB to RS232 adapter on a laptop (same parameters with minicom) and I also entered SETUP mode but didn't do anything with it yet. I don't have an explanation on why it didn't work with the other cable/computer though. :s I'll have to look into it since I ultimately have to use the onboard computer.
I don't have compilation errors any more, so I guess I didn't do everything wrong. :) I will now flash the module and test if the CFG commands work.
Nothing wrong with my build, I am in 2.6.6 and I can do CFG commands. I have played a bit with the SPEED command, keeping it simple for now. :) I freaked out a bit when the car started beeping as I wasn't (still am not) familiar with the power cycle thing. Correct me if I'm wrong, I understood that doing a power cycle means starting the car by turning the key on the first notch, waiting 10-15 sec (I noticed a red led blinking on the board at that point), then turning it off and on again. Is it the standard way to do it ? Regards, Julien
Julien, Am 24.09.2014 um 16:30 schrieb Julien NOZAIS:
Nothing wrong with my build, I am in 2.6.6 and I can do CFG commands. I have played a bit with the SPEED command, keeping it simple for now. :) I freaked out a bit when the car started beeping as I wasn't (still am not) familiar with the power cycle thing.
Correct me if I'm wrong, I understood that doing a power cycle means starting the car by turning the key on the first notch, waiting 10-15 sec (I noticed a red led blinking on the board at that point), then turning it off and on again. Is it the standard way to do it ?
Power cycle means switching off and on again -- a reset would do as well if the Twizy had a reset button. To change some power map setup you normally turn the key to the first notch, issue the CFG command(s), turn off and then on as usual. First notch is necessary to allow for the SEVCON PRE-OP state. While in "GO" state, you can still change any config that doesn't need PRE-OP state. See manual for details, especially the section on the SimpleConsole and example profiles. PRE-OP state will sometimes stick (presumably due to some internal value checks), then you need to do a power cycle to resolve. Regards, Michael -- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Hi Michael,
Power cycle means switching off and on again -- a reset would do as well if the Twizy had a reset button. To change some power map setup you normally turn the key to the first notch, issue the CFG command(s), turn off and then on as usual.
Thank you very much, it clears out the doubts I had on the process. I'll keep on going forward and will update when I have made some progress. Regards, Julien
participants (2)
-
Julien NOZAIS -
Michael Balzer