Posted: Sat Mar 09, 2019 10:14 pm
Some good news and a few things are pretty clear as required in my opinion. After extensive testing here is what I know. All comments below include removing all power sources including USB.
1) the simulated channel test script above worked fine first try and continued to work after each power cycling
2) power cycling has been suggested but is absolutely required for a new flash to be recognized at next power up. If you don't, you can get a number of mixed results.
3) the power cycling requirement is not limited to lua or shiftX2 but also to recognize loading a new config .rcp file. While the CAN bus mapping window might show the CAN channels in the app immediately after loading a .rcp file, the dashboard and other functions can't see them until power cycled.
4) one power cycle is often not enough, it might take 2 or 3 and in between you might see behavior that's a combination of scripts and/or mixing script with the default "scanning" lights. Hard to believe maybe, but given the methodical testing I did, it's true.
5) the sleep(500) is required, without it the simulated channel test script and real scripts don't work right
I even went a step further and borrowed a friends RC Track Mk2 and updated firmware to 2.15.0, then repeated all my testing. The exact same behavior occured, and given #3 above it's clear to me its inherent in RC Track Mk2 and not ShiftX2.
After all this I can make real scripts work as intended right from power up!
I would suggest the sleep(500) become standard in published sample code and API documentation. I would also suggest publishing pretty prominently that multiple power cycles may be required for any config change to register.
Thanks for the support, I consider this solved. Hopefully my suggestions will happen so others can save the hours of head scratching.
1) the simulated channel test script above worked fine first try and continued to work after each power cycling
2) power cycling has been suggested but is absolutely required for a new flash to be recognized at next power up. If you don't, you can get a number of mixed results.
3) the power cycling requirement is not limited to lua or shiftX2 but also to recognize loading a new config .rcp file. While the CAN bus mapping window might show the CAN channels in the app immediately after loading a .rcp file, the dashboard and other functions can't see them until power cycled.
4) one power cycle is often not enough, it might take 2 or 3 and in between you might see behavior that's a combination of scripts and/or mixing script with the default "scanning" lights. Hard to believe maybe, but given the methodical testing I did, it's true.
5) the sleep(500) is required, without it the simulated channel test script and real scripts don't work right
I even went a step further and borrowed a friends RC Track Mk2 and updated firmware to 2.15.0, then repeated all my testing. The exact same behavior occured, and given #3 above it's clear to me its inherent in RC Track Mk2 and not ShiftX2.
After all this I can make real scripts work as intended right from power up!
I would suggest the sleep(500) become standard in published sample code and API documentation. I would also suggest publishing pretty prominently that multiple power cycles may be required for any config change to register.
Thanks for the support, I consider this solved. Hopefully my suggestions will happen so others can save the hours of head scratching.