[Ovmsdev] v1.3.3

Mark Webb-Johnson mark at webb-johnson.net
Wed Sep 12 20:55:45 HKT 2012


Hot on the heels of v1.3.1 comes v1.3.3. Here is the change log:

2012-09-12 1.3.3       Firmware 1.3.3
                       #77 Option for GSM Network selection
                       #74 Car: SETUP (DIAG)  mode for firmware
                       #76 SMS HELP command
                       #75 Car: Basic (stub only) Renault Twizy Support
                       #71 Car: Send line voltage level back to server
                       #70 Car: Send hardware version along with firmware version
                       ### Make QC config use TMC server

Really, no urgent need to update, as this firmware is primarily intended for the China factory to give them a way to QC modules. Towards the end of this month it will be the firmware shipped with all new modules. At the moment, they are shipping with v1.3.1.

The new v1.3.3 firmware, as a side-effect, gives us a way to configure a module without a SMS plan on the SIM (so long as you have a way of getting a PC as a RS232 terminal - not so trivial nowadays). It also gives us a useful diagnostic tool for developers.

When a module running v1.3.3 (or later) is switched on, it will go through the normal startup sequence of RED led on, GREEN led flashing out firmware version. Once that is done, both leds will turn off and the module will wait 10 seconds for you to enter SETUP mode. If nothing is done, it will start normally. If, using a terminal emulator connected to the RS232 port you type SETUP (enter) during this 10 second window, then the firmware will enter SETUP (DIAG) mode.

# OVMS DIAGNOSTICS MODE

(both red and green leds will be flashing 10 at this time)

From there, you can type HELP for help, and issue commands. There is a built-in Tesla simulator (CANTXSTART and CANTXSTOP), allowing two modules to be connected back-to-back and the CAN bus to be exercised, and a few diagnostic screens. The QC configuration for v2 modules has been removed, as this new facility makes it obsolete.

You can also type "S " followed by a SMS command to run SMS commands locally (e.g.; "S STAT", "S MODULE?", "S FEATURES?", etc). The output of the command will be sent back to the terminal. In this way, you can setup the module without requiring a SMS account.

Note that the SETUP (DIAG) mode is kludgy. It relies on the DIAG port as a tap on the uart communications between the modem and the PIC, and on the modem echoing characters typed back. When you type "SETUP", what happens is the "S" goes to the modem which echos it back and the PIC sees it, then "E", "T", "U", "P" and the final ENTER. This string is not recognised by the modem (no "AT" prefix), but is recognised by the PIC in that magic 10 second startup window. Similar for the commands within SETUP mode itself. There is one nasty side-effect of this (which is why I call it kludgy) - if a command/response has an "AT" somewhere in it, then it will be interpreted as a Hayes AT command by the modem. This causes problems with commands like 'stAT', 'feATure", etc. You might see "OK" and "ERROR" responses in the output. It is not perfect, but it works - and is pretty powerful to setup a module.

I've also added a new parameter (#13) to this firmware, which can hold a 'locked' GSM network identifier, and associated GSMLOCK and GSMLOCK? SMS commands. If you set this, the usual AT+COPS=0 command will be changed to one to lock GSM carrier to only the carrier you specify (turning off roaming). This is useful for two reasons: (1) the GSM lock is faster and more reliable, (2) roaming SIMs often have multiple carriers at different rates and this allows you to choose the carrier. However, take care. If you are configuring by SMS, setting GSM lock incorrectly will cause the module to be unable to connect to GSM and you'll have to use the RS232 DIAG port to recover. If you want to see a list of discovered GSM networks, in SETUP mode type "AT+COPS=?".

Finally, a stub implementation of a Renault Twizy module has been added, to serve as a starting point for the developers working on this. The state of this is similar to Volt/Ampera support - just stub at the moment, with no real functionality yet. Progress is being made...

Regards, Mark.

P.S. Here are the instructions, with more information, on the QC steps during SETUP.

Attached are some pictures and firmware, that has SETUP mode that can be used for diagnostics and QC.

Instructions:

You need to make a cable to connect two modules together. The cable should be 1 foot long, 4 core, and have 2 DB9 female ends. Soldering is like attached pictures. +12V, GND, CAN-H and CAN-L cables are just connected 1-to-1. Then, you need to put a 120Ohm (approximate - 100Ohm is also ok) resistor between CAN-H and CAN-L on one end of the cable. You also need to arrange a plug for +12V DC power supply and connect to the +12V and GND pins of the other end.

This cable provides power to both modules, and a can bus the modules can talk on.

With a serial console connected to one module, power up the module (make sure blue LED is on). RED led should be on, and GREEN led will blink 1 then 3 then 2. On the serial console, type SETUP and you should see the module switch to setup mode:

# OVMS DIAGNOSTICS MODE

For this first module, put the module into CANTXSTART mode. This will start it transmitting messages on the CAN bus.

# OVMS DIAGNOSTICS MODE
CANTXSTART
# Starting CAN sim

Leave the first module powered on. You can use this now to QC test many other modules. The module is transmitting CAN bus messages.

Move the serial console to a second module to be tested, power up the module (make sure blue LED is on). RED led should be on, and GREEN led will blink 1 then 3 then 2. On the serial console, type SETUP and you should see the module switch to setup mode:

# OVMS DIAGNOSTICS MODE

For this module, turn on feature #15 with a special command:

# OVMS DIAGNOSTICS MODE
S FEATURE 15 1
ERROR
# Feature has been set.

(do not worry about the ERROR - it is ok).

Then, type the DIAG command:

# OVMS DIAGNOSTICS MODE
DIAG
# DIAG

#  Firmware: 1.3.2/V2
#  SWITCH:   1
#  12V Line: 14.7 V
#  Signal:   0

#  VIN:      ----------------- (TR)
#  SOC:      0% (0 ideal, 0 est miles)

You can see it shows you the firmware version, status of the switch (0 or 1), 12V line voltage, and GSM signal level. It also shows you messages received on the CAN bus from the first module (in CANTXSTART mode).

If all is ok, you should see VIN with some numbers (not ------), and SOC, ideal and est miles also showing numbers. If you get this, then the CAN BUS is working.

Try to change the switch, and DIAG to see it changes ok.

Make sure the blue LED is blinking, and both red and green leds are also blinking together. This tests all the LEDs work.

When finished testing, "S FEATURE 15 0" to disable the can bus active mode and then turn off module under test.

Regards, Mark.






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20120912/2887b999/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20120910-diagcable.png
Type: image/png
Size: 126039 bytes
Desc: not available
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20120912/2887b999/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20120910-diagcable_1.jpeg
Type: image/jpeg
Size: 27745 bytes
Desc: not available
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20120912/2887b999/attachment-0002.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20120910-diagcable_2.jpeg
Type: image/jpeg
Size: 22400 bytes
Desc: not available
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20120912/2887b999/attachment-0003.jpeg>


More information about the OvmsDev mailing list