No announcement yet.

Limp/dead mode

  • Filter
  • Time
  • Show
Clear All
new posts

  • tonton81
    I have a solution! and given the solution, the same fix also gained a few new features as well. I was going through the .H & .CPP files and found a few things.
    a few new features:
    1) With SD usage of about 1.6GB for a uLCD-70DT, the delay from setup() is now from 5500 down to 200ms after a reset before you can do contrast etc. I will explain this in a bit
    2) Hot plug ability at the expense of a few ms from library timing out in HOST only mode (no display), i would say this is equivalent to ~ 100-500ms delay in loop(), but will not prevent the rest of your HOST code to function without the display.
    3) If you hot plug your display, no need to restart your host, the settings are streamed live without reinitializing the baud rate and settings.
    4) you can start your host controller without the lcd connected, and it will run fine at the reduced (100-500ms) delay each loop cycle, after which, if you plug your lcd in later on after the HOST is online, it'll run at full speed and no need to reinitialize the LCD Class

    So, while I am by any way no means an expert on library modifications, I will invite others who are willing to improve upon this code to more efficiently handle the task, and while it may not be a perfect solution, a limp mode or totally frozen host is worth sacrificing a 100-500ms delay for each loop cycle

    Oh! and no longer need to wait for LCD to boot. I am using 200000 baud on arduino mega, RX2/TX2 and the delay is now delay(200) before setting contrast.

    in genieArduino.h

    #define TIMEOUT_PERIOD 1000 // leave at 1000
    #define RESYNC_PERIOD 1 // make this 1, 0 will lock up without lcd, going higher will delay loop cycles if lcd is disconnected.
    in genieArduino.cpp

    goto this area and add command in bold (break

    ////////////////////// Genie::WaitForIdle ////////////////////////
    // Wait for the link to become idle or for the timeout period,
    // whichever comes first.
    void Genie::WaitForIdle (void) {
    uint16_t do_event_result;
    long timeout = millis() + Timeout;
    for ( ; millis() < timeout;) {
    do_event_result = DoEvents(false);
    // if there was a character received from the
    // display restart the timeout because doEvents
    // is in the process of receiving something
    if (do_event_result == GENIE_EVENT_RXCHAR) {
    timeout = millis() + Timeout;
    if (GetLinkState() == GENIE_LINK_IDLE) {
    Error = ERROR_TIMEOUT;
    Last edited by tonton81; 10th April 2016, 12:26 AM.

    Leave a comment:

  • James_4DSystems
    Hi tonton81

    Thanks for the feedback.
    The library is open source, you are welcome to change it as you see fit. Fork the repository and make your own changes, you have the full source code for the library there.
    The library was originally provided for people to start with something easily, but its been adopted by so many as the only option, when it is not the only option.
    The full ViSi-Genie protocol is outlined in our ViSi-Genie documentation, and this library was just a way to provide customers to get going faster.
    Yes the library is dependent on the display being there, and thus so is the host, as that is what the library was designed for, to have the LCD connected. It was never made with the thought in mind that a user might disconnect the display, nor was it in mind for this library to be used in Industry. Not saying it cant be, but it was never the design for it to do so.

    Your comments are noted though, and we can put this on our list of things to improve when we have a resource available, but if you want a faster result you might want to look at doing these improvements yourself, if you are able.

    Or, you can use ViSi and write your own protocol and library from scratch - maybe with features like connection/disconnection detection, and anything else you require.

    I hope this helps somewhat, but I suspect it wasn't the answer you were looking for.


    Leave a comment:

  • tonton81
    started a topic Limp/dead mode

    Limp/dead mode

    Why is it that when the screen is not connected during HOST boot OR it is disconnected during processing of HOST send/receives, the host either goes into LIMP mode or freezes altogether, this is on arduino mega2560, I think you should have a timeout in your library or verification if your display is actually connected rather than letting the host limp or freeze completely, this makes the HOST entirely dependant on the lcd! If the lcd ever fails in future, your project will stop working along with it! Not a very good thing to do, specially in an industrial environment, This also happens if you use 2 lcds, remove one, boot the host, and watch it extremely lag or freeze altogether, please fix this issue with the library, disconnected devices should NOT freeze the host
    Displays tested: uLCD43-PT + uLCD70-DT