0
Роман Романов

Orange pi zero, ping hangs up

Recommended Posts

Hi there! I has a OPi zero board on armbian ubuntu os.  There is a python scrypt that ping server. Scrypt starts with my service.

service code:

[Unit]
Description=My Script Service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/sudo /usr/bin/python /root/test/qr2.py
RemainAfterExit=no
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target

python ping server like:

try:
	os.system('ping ' + ip + ' -c 4')
    # or 
    # s.scall('ping ' + ip + ' -c 4 )
except:
	print 'ping error'

Sometimes If i start system after power supply scrypt is starting, but then hangs on ping function. In Htop (image) i can see ping process.  There are no python errors or exceptions. It just hangs. But if i use console command to ping  server ip while scrypt hans, it pings well.

If a starts scrypt manualy it works well, no hanging. Also if i execute reboot command in concole, then after restart scrypt do not hangs up. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0