[Ovmsdev] Flashing Lights

Mark Webb-Johnson mark at webb-johnson.net
Tue May 8 19:37:07 HKT 2012


Not too bad.

I've re-worked the low priority interrupt handler stuff used to drive the comms port to also drive these LEDs off timer#1. That makes the entire LED subsystem self-sustaining and I don't need to change other parts of the code to maintain the animation.

Tricky stuff to get right, and I haven't had so much fun with blinking lights since basic electronics classes all those years ago using 555 ICs.

1 time period on, then 3 off, gives a nice clear countable display.

One experiment that didn't work was to leave the timings for the two LEDs independent. It is too hard to count flashes of green when a red led next to it is flashing a different code at a different start time. My current approach is to synchronize the two to start the codes at the same time, for a set fixed time period. If one is flashing less digits than the other, then it just waits, before they both start together again.

Next step is the code for solid on (easy), then startup animation, then I update the modem driver logic. In the modem code, it is much easier now, as we don't need to do any flashing animation at all. Just a function call to tell the led code what digit to show, and the led will start flashing that at the next cycle.

With luck, so long as I haven't messed anything up, I should be done with the leds this week.

I've also done the code changes for volt/ampera support stub, and some minor bug-fixes.

Then, timed-charges command support, and I'm moving on to the charge and drive logs.

Regards, Mark

On 8 May, 2012, at 11:23 AM, William Petefish wrote:

> Mark,
> 
> How goes the coding?
> 
> William
> 
> On Sun, May 6, 2012 at 2:41 PM, Udo Werges <Udo.Werges at t-online.de> wrote:
> sounds good, the changes will give a lot more information via the flashing LEDs.
>  
> pro voting
> 
> Udo
> Germany
> 
> mobil +49171 374 7978
> e-mail udo.werges at t-online.de
> eFax +49322 23 73 9801
> 
> 
> -----Original Message-----
> > Date: Sat, 05 May 2012 10:46:57 +0200
> > Subject: Re: [Ovmsdev] Flashing Lights
> > From: William Petefish <william.petefish at gmail.com>
> > To: OVMS Developers <ovmsdev at lists.teslaclub.hk>
> 
> >
> #6 has my vote. It may be more complex in code, but easier to impliment on existing hardware.
> I guess it could act similar to the old OBD that cars had prior to OBD2.
> William
> On May 5, 2012 2:36 AM, "Mark Webb-Johnson" <mark at webb-johnson.net> wrote:
> 
> I've been getting frustrated lately trying to help users diagnose problems early-on in the GSM connection sequence. We've had problems with SIMs cards getting recognised (broken sim cards), with sim locks (PIN lock on), with general modem comms issues, and with lack of GSM signal - and all these show up as the same red flash, red solid, red flash, red-green-alternate indicators. Without getting out a USB-serial cable and laptop, it is real hard to diagnose.
> 
> Talking this through with Bennett, and others, I think we can do better, and I suggest the following changes:
> 
> Take the LED control out of the individual code files and have them controlled by a central module with its own timer. This module would be told at a high level what to do with the LED (eg; make the green led flash 7 times) and would make it so.
> 
> Both LEDs off would indicate NO POWER.
> 
> On startup, animate both LEDs for a short time to demonstrate that they both work.
> 
> Change init code to (a) use AT to verify modem is connected, (b) check for SIM connected and readable, (c) check for SIM PIN lock, (d) initialize modem to our required settings, and (e) AT+COPS for cellular signal search. By splitting this up, to separate check states, we can individually alert on a failure at a particular state.
> 
> In general, use the green LED to show status, and the red LED to show the last error (cleared whenever a state is successful).
> 
> On startup, you would see the green led count up through each stage, and if it got stuck at a particular stage the blinks would tell you where it is. If there was an error at any stage, the red LED would indicate the error code.
> 
> For blinking, I suggest just off for a second, then rapidly blink the code, then off for a second, then rapidly blink the code, etc.
> 
> Once we reach a final GOOD state (either GSM with GPRS disabled, or GPRS connected to server), we would just turn both LEDs to a steady blinking pattern (perhaps on for a second, off for a second).
> 
> As well as the obvious clarity to diagnostics that this brings, it would also be for general use to see at a glance if the module is working correctly and is connected to the server ok.
> 
> What do people think?
> 
> Regards, Mark.
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20120508/3190c801/attachment.htm>


More information about the OvmsDev mailing list