Go Down

Topic: Detect Linino Boot from Sketch (Read 24223 times) previous topic - next topic

mamu

Is there a way to detect from Arduino sketch if Linino does still boot or does a reboot?

I ask because I figured out that initial Serial1 connection speed when Linino boots is 250K. And when you try to connect using 115200 baud, it will not boot correctly. So I would like to do my connection with Serial1 after boot is completed.

federicofissore

One very naive way I use is to send \n to Serial1 and read the result if available. If at some point that result is "root@Arduino", then linino is ready

mamu

I will try.
Two more questions:

  • Is there a chance to get notified when user presses the Yun RST button?

  • And is it true that I have to set the initial connection speed to be 250K and only can switch to 115200 after boot completed?


federicofissore



  • Is there a chance to get notified when user presses the Yun RST button?



Sure: take a look at triggerhappy. This is how we catch it now https://github.com/arduino/linino/blob/master/trunk/package/linino/yun-conf/files/etc/triggerhappy/triggers.d/reset.conf


  • And is it true that I have to set the initial connection speed to be 250K and only can switch to 115200 after boot completed?



Frankly speaking, I don't even understand how you can switch it back to 115200. I think you can switch to a lower speed before boot is completed, if you mind not to print anything for the first 30/40 seconds

mamu

Not sure how trigger-happy could help me detecting in an Arduino sketch that Linino is rebooting.

When I try to initial start YunSerialTerminal with 115200 I get output like the one below. Couldn't changing the connection speed be done by calling Serial1.begin(115200) when sketch is running?

Code: [Select]
-?MN'àC
J- 5ÈJL8úVx
?-á?J~8k?Màñ?NbÛXJ?J? nCÈHNbO6!J]? 7nV? mñO¬]!H7n\7JønD}ÈJJ&+>!
)?Aï\(6°o¬])tHnV? ¯HO&ñ(o¬Mi:?N!Vs?JJJW}H-6Ð?BO6?i?¬]1$}? {?V?N }.g%¬:?.fÊJjÈgNùM Zm.?5 q MH9=?,HaNì?Hj^6?NXVì]?H>Ê: V^N*}M¡¡M 1Èq
>C-áQìH6M6)L(lÀV?&+M÷ìJéW?Â]Aì-ΰL?J?ÊZHÏ°L??JéW?M©??;\?jÊÊzZÏ°L)þûÙ6hÊHî{v?Jl?Xij!h}Ì>LoHO6xhXè?ù (pèèpèhX!] ^COu'?JN Àa$}Jj0(~6?ÈZQLZ?kI?8g,> ü
HL ?gF.k^C?&¹N? H>H-?j¢_á5h< HM·J?K?,k~@J?j?:ÈMVV?\ùO¬}&?(îÌ?^é]nk$ÃNø?(Xvá,
OVéó6?M9h(6X«·hÈJ(hnXáç6f
qwÈ?jh8¤??? N9?I?J¡6sJ^>XL!
=ñ6JaÓ>hJK¡?ZN3.G V~B`Î?%?
? 5?Z%à=?-l!j?J<]=f'X&Ûl!j?JLH;ñMn?J-I (± ?I?JXx?|ùð?H{hXH?JùJÀJHJÜ??j? 8?IHLÈë?IhLl?J?(;üVkoa^,NlH?I?JH¯~?K?JJ?J!=þ?J?laNOom?XN'H.lO,H?J?}*]??I?JHF>/?J?J?N)«Ú?J?8_ñ?]Ê&(? - H?J?&'Ï^núH6¯?I?JHn]Jfo?J?J?N)?-ì!j?JN>¼?^áMá\?l.È*7,=q?
|÷DH?I?J±&h6ÊlnÈf%*ñ}.7H>ÊHwwlH?I?Jg?ú¡H=Î]QL\vXù~?mÈH·?K
XH?J?ókjM6Hf_?VX]]È1??JÌM&~¡jÎ5XjyÊxjÛH9È{>/QÈJxfVÌ[Î<¡?Ìj?J*~fJOá~ª.I?
VO,H?JÈ,1,Ú?ÈZLNó(j?Jª± !j?J=Oá\,q(ØM±·?-Î=YJXi \wH?I?J}


federicofissore

Ah sorry for the misunderstanding, you asked to be notified when the user presses the button, not about when has ended what the pressed button has caused.

The gerbish is because of the wrong serial speed: 250K is the number, but I guess you already know that

bilica

Hi,

I would be interested to know if there is a way to let the sketch know that linino has rebooted (or is going to reboot).

Is there a way to issue reset-mcu just after configuring wifi ? Or alternatively to know if it is safe to call Bridge.get() without locking the 32u4 since Linino is booting after a call to Bridge.begin() ?


Ah sorry for the misunderstanding, you asked to be notified when the user presses the button, not about when has ended what the pressed button has caused.

The gerbish is because of the wrong serial speed: 250K is the number, but I guess you already know that

bilica

I did find a way to reset the mcu everytime Linino reboots. As per instructed here
http://wiki.openwrt.org/doc/techref/process.boot

I added a script to be executed at the shutdown process (add a file to /etc/init.d/ called 'resetmcu' and then create a simlink to this file in the directory /etc/rd.c/ with a name that starts with the letter 'K'. For instance, 'K51resetmcu').

\etc\init.d\resetmcu contains:

Code: [Select]

#!/bin/sh /etc/rc.common
START=10
STOP=98
start()
{
}

stop()
{
/usr/bin/reset-mcu
}


I would still like to know though if there is way to identify linino reboot from the 32u4 side.

Any ideas ?

Thanks


Hi,

I would be interested to know if there is a way to let the sketch know that linino has rebooted (or is going to reboot).

Is there a way to issue reset-mcu just after configuring wifi ? Or alternatively to know if it is safe to call Bridge.get() without locking the 32u4 since Linino is booting after a call to Bridge.begin() ?


Ah sorry for the misunderstanding, you asked to be notified when the user presses the button, not about when has ended what the pressed button has caused.

The gerbish is because of the wrong serial speed: 250K is the number, but I guess you already know that


Sea2605

I'm also currious to find a way to let the sketch know linino is ready!
And vice versa!

I'd like to execute a python-file on my SD (via runshellcommand in the sketch) the moment
the linino + arduino both are ready...

I have this idea:
somehow it must be possible to send a variable ( e.g. int "1" for ON) to the sketch via a python-skript.
Then the Sketch would know that the linino is ready.

Problem:
If the linino already booted, but the arduino didn't, we have the same problem the other way around... the arduino wouldn't get that variable, because the linino wouldn't know when the arduino is ready...

help!

Go Up