I am using a gen4-uLCD-70D-SB with a Particle Photon and the library at https://github.com/4dsystems/ViSi-Ge...rticle-Library .
I have made 4 ViSi-Genie widgets which I update via:
I expected that I could send updates to the smart display as quickly as the serial bus would take the messages, more or less. I observe 8,800 - 9,500 calls to
during each call to
, which occurs for every
call.
Infrequently sending updated state works fine, and 1 widget works fine: but I need a high refresh rate on 6 of my visualizations. I've instrumented the Genie library to find the point of contention, can you help me break this 30 millisecond hard cap per-update?
Below is a small excerpt from my logs for the 4 smart widgets. One by one they block and take 28-29 millis to idle, then the loop warn fires indicating that I cannot keep up with the rate of incoming events due to this busy loop of waiting for the idle state. Separate, more verbose logging confirms that the actual message itself, once the library allows it, takes about 1 millisecond to transit the wire, including the checksumming.
The impact of 30ms per widget is plainly visible at 4 widgets, and puts back-pressure on my upstream message bus. Once I have all 6 configured (and the additional 4 low-frequency widgets) this will be a major problem!
I have made 4 ViSi-Genie widgets which I update via:
Code:
genie.WriteObject(GENIE_OBJ_ISMARTGAUGE, object_index, new_state);
Code:
DoEvents(false)
Code:
Genie::WaitForIdle
Code:
WriteObject
Infrequently sending updated state works fine, and 1 widget works fine: but I need a high refresh rate on 6 of my visualizations. I've instrumented the Genie library to find the point of contention, can you help me break this 30 millisecond hard cap per-update?
Below is a small excerpt from my logs for the 4 smart widgets. One by one they block and take 28-29 millis to idle, then the loop warn fires indicating that I cannot keep up with the rate of incoming events due to this busy loop of waiting for the idle state. Separate, more verbose logging confirms that the actual message itself, once the library allows it, takes about 1 millisecond to transit the wire, including the checksumming.
Code:
0000041384 [app.genie] INFO: Link idle achieved. State iterations: 8875, avg latency: 0, max latency: 1, operation latency: 28 0000041384 [app.widgets.numeric] INFO: State update. Old: 339, New: 339, Latency: 28ms 0000041414 [app.genie] INFO: Link idle achieved. State iterations: 9549, avg latency: 0, max latency: 1, operation latency: 29 0000041415 [app.widgets.numeric] INFO: State update. Old: 339, New: 339, Latency: 30ms 0000041444 [app.genie] INFO: Link idle achieved. State iterations: 9146, avg latency: 0, max latency: 1, operation latency: 28 0000041445 [app.widgets.numeric] INFO: State update. Old: 339, New: 339, Latency: 29ms 0000041474 [app.genie] INFO: Link idle achieved. State iterations: 9087, avg latency: 0, max latency: 1, operation latency: 28 0000041474 [app.widgets.numeric] INFO: State update. Old: 339, New: 339, Latency: 28ms WARN: Loop falling behind. Target: 50, Actual: 119 0000041503 [app.genie] INFO: Link idle achieved. State iterations: 8784, avg latency: 0, max latency: 1, operation latency: 28 0000041503 [app.widgets.numeric] INFO: State update. Old: 368, New: 368, Latency: 28ms 0000041533 [app.genie] INFO: Link idle achieved. State iterations: 9546, avg latency: 0, max latency: 1, operation latency: 29 0000041534 [app.widgets.numeric] INFO: State update. Old: 368, New: 368, Latency: 30ms 0000041563 [app.genie] INFO: Link idle achieved. State iterations: 9170, avg latency: 0, max latency: 1, operation latency: 28 0000041564 [app.widgets.numeric] INFO: State update. Old: 368, New: 368, Latency: 29ms 0000041593 [app.genie] INFO: Link idle achieved. State iterations: 9132, avg latency: 0, max latency: 1, operation latency: 28 0000041594 [app.widgets.numeric] INFO: State update. Old: 368, New: 368, Latency: 29ms WARN: Loop falling behind. Target: 50, Actual: 119 0000041623 [app.genie] INFO: Link idle achieved. State iterations: 9159, avg latency: 0, max latency: 1, operation latency: 29 0000041623 [app.widgets.numeric] INFO: State update. Old: 398, New: 398, Latency: 29ms 0000041653 [app.genie] INFO: Link idle achieved. State iterations: 9578, avg latency: 0, max latency: 1, operation latency: 29 0000041654 [app.widgets.numeric] INFO: State update. Old: 398, New: 398, Latency: 30ms 0000041683 [app.genie] INFO: Link idle achieved. State iterations: 9229, avg latency: 0, max latency: 1, operation latency: 28 0000041684 [app.widgets.numeric] INFO: State update. Old: 398, New: 398, Latency: 29ms 0000041714 [app.genie] INFO: Link idle achieved. State iterations: 9490, avg latency: 0, max latency: 1, operation latency: 29 0000041715 [app.widgets.numeric] INFO: State update. Old: 398, New: 398, Latency: 30ms WARN: Loop falling behind. Target: 50, Actual: 122
Comment