Startup time of arduino pro mini with mysensors 2.2 - took 10 sec (guess its the radio), can I execute some code immediately (<1sec)?
-
yes, so in the before() function read the eeprom value and set it in analogWrite. hardware pull-up is optional because the delay between switching power on and before function call will be short enough, bit if You use the pull-up the delay will be even shorter.
-
@alterfritz
Try to add the "on" command not in setup() (this requires presetation() to be already passed) and use a before()-routine instead.@rejoe2 like this... btw - this forum is fanastic... responses more or less in real time... :-)
...
void presentation()
{
analogWrite( LED_PIN,255);}
.... -
@rejoe2 like this... btw - this forum is fanastic... responses more or less in real time... :-)
...
void presentation()
{
analogWrite( LED_PIN,255);}
....sorry ... mean before ...like this
void before()
{
analogWrite( LED_PIN,255);}
This seems to have done the trick... LED switch on immediately! Thanks!
Btw... I also try the mysbootloader. This wirless update is great, however - does this bootloader slows down bootup time?
-
yes, because the code that will run in the node must be first uploaded to it. the bootup time will be dependent on the code size.
-
@alterfritz Yes, update-bootloader tries to connect to GW for updates first seconds (around 20). So it is not dependend on code size...
Additional note: Waiting for RF connection to be established can also be prevented by using#define MY_TRANSPORT_WAIT_READY_MS ... -
@alterfritz Yes, update-bootloader tries to connect to GW for updates first seconds (around 20). So it is not dependend on code size...
Additional note: Waiting for RF connection to be established can also be prevented by using#define MY_TRANSPORT_WAIT_READY_MS ...So
#define MY_TRANSPORT_WAIT_READY_MS 1000
Will wait for 1 sec? -
So
#define MY_TRANSPORT_WAIT_READY_MS 1000
Will wait for 1 sec?@alterfritz Exactly. After trying to connect to the controller for 1 sec., the node will execute normal code like any other "just-arduino".
Pls note: as there is no connection to the controller, the node may miss relevant info typically provided by the controller. Things like myControllerConfig, last values for counters etc... If you use this, you should make sure, these are set correctly later on. -
So - thanks for all your help. Great forum. Let me summarize what I understand so far:
1.) by using the before() procedbure I can execute immediately. Quickly tested. Seems perfect for me... however... :-)
2.) I really like this mysbootloader. But by using this it always takes up around 20 sec to boot up. There is NO way to switch on my LED directly when I power it up...Correct?
-
So - thanks for all your help. Great forum. Let me summarize what I understand so far:
1.) by using the before() procedbure I can execute immediately. Quickly tested. Seems perfect for me... however... :-)
2.) I really like this mysbootloader. But by using this it always takes up around 20 sec to boot up. There is NO way to switch on my LED directly when I power it up...Correct?
@alterfritz Speaking about software: Not exactly, there is one thing you could still do: Compile the bootloader yourself with light switched on... :grinning:
-
@alterfritz Speaking about software: Not exactly, there is one thing you could still do: Compile the bootloader yourself with light switched on... :grinning:
@rejoe2 Right... :-) I may look into this. For now I will try to get a stable version and load it without bootloader directly via usbasp...