Beaglebone Black event on startup

Hi
I am running Debian on my Beaglebone Black

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
debian@apc:~$ PRETTY_NAME="Debian GNU/Linux 10 (buster)"
debian@apc:~$ NAME="Debian GNU/Linux"
debian@apc:~$ VERSION_ID="10"
debian@apc:~$ VERSION="10 (buster)"
debian@apc:~$ VERSION_CODENAME=buster
debian@apc:~$ ID=debian
debian@apc:~$ HOME_URL="https://www.debian.org/"
debian@apc:~$ SUPPORT_URL="https://www.debian.org/support"
debian@apc:~$ BUG_REPORT_URL="https://bugs.debian.org/"

On power on, the RJ-45 Ethernet Link and Activity LEDs start after about 3 seconds.
Then at around 30 seconds, both of these RJ-45 LEDs go out for about 4 seconds and then come back, after which they run indefinitely.
If I open an SSH session before the 30 second outage, I lose my connection. If I restart it after the 30 second outage, it stays up indefinitely.
I am starting my application as a service on startup and it starts to run before the 30 second outage. The outage seems to damage my app in some way eg the coms on serial port ttyS1 seem to be affected.
Its a little hard to debug what is going wrong but if I restart it after the 30 second outage, it also runs perfectly indefinitely.
Looking at the raw coms from ttyS1, its like the system ticker I using for response timeouts seems to make my coms timeout and retry almost immediately and although my data is recognizable, there are errors in it.

Is this an known issue and is there a work around of some kind.

Thanks
Michael

Hi Again. No response on this one? :disappointed:
I bought another brand new BBB and tested it fresh out of the box with the image it came with and found the same thing, so it is definitely not something I have broken.
If I new what was causing it, maybe there might be a solution to delay my software starting until it has finished booting would help.
Any ideas appreciated.

How are you loading your software?

Have you tried not loading it and do you still have issues with connecting via ssh?

Generally I have found unless optimised, it takes a good 30+ seconds for linux to fully boot.
The fact that you see the leds come on at around 3 -4 seconds, it just the hardware being initialised . The going off around 30 is probably systemd bringing up the network and dhcp getting an address.

If your software needs the network you need to set networking as a dependency in your service file to make sure your program runs after networking.

If your software needs networking, does it handle properly a failure to get/setup a connection ? will it retry ?

you can run the following to get a nice boot chart for systemd

systemd-analyze plot >bootup.svg

That might point to some issues.
Also check syslog.

This is vague… would need more detail on how your app is launched. In general, you seem to need to wait for some state before you invoke (launch) your app.

Is there some test that you could build into your app that tests for the state where the network is up and ready? Have you app fail and restart until this test succeeds.

Example:
suppose being able to “ping www.grc.com” means that the network is ready … then SOMETHING like this MIGHT work:

while true ; do if ping -c1 www.grc.com ; then LAUNCH YOUR APP ; break ; fi ; sleep 10 ; done

good luck
gomer

Hi All

My apps are loaded as a service by Linux on startup eg
sudo systemctl enable adl-supervisor

I have a solution now which works for me, but I would like to know why the network starts up and you can open a SSH session, only to have the Etherent LEDs on the RJ-45 go out and the SSH session drop around the 30 second mark for about a second. Then everything comes right and stays right.

This seems very un-orthordox for a Linux SBC platform, an I would like to know what is happening.

This happens on brand new BBB’s out of the box. I have tried a number of BBB’s.

Thanks

Connect to the debug port and watch it on a terminal. If you use gtkterm click on log and select a file. Then you can go back and review the file and see what is going on.