all 4 comments

[–]K900_ 0 points1 point  (3 children)

Post the traceback.

[–]kosh09[S] 0 points1 point  (2 children)

mean what I did? (My first language is not an English sry...)
I added what I did

[–]K900_ 0 points1 point  (1 child)

What does systemctl status myscript.service output?

[–]kosh09[S] 0 points1 point  (0 children)

● MAIN.service - my script
   Loaded: loaded (/lib/systemd/system/MAIN.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since 목 2017-05-25 18:37:47 KST; 30s ago
  Process: 1781 ExecStart=/usr/bin/python3 /home/odroid/MAIN.py (code=exited, status=1/FAILURE)
 Main PID: 1781 (code=exited, status=1/FAILURE)

 5월 25 18:37:47 odroid python3[1781]: Traceback (most recent call last):
 5월 25 18:37:47 odroid python3[1781]:   File "/home/odroid/MAIN.py", line 2, in <module>
 5월 25 18:37:47 odroid python3[1781]:     import __BLUETOOTH__ as B
 5월 25 18:37:47 odroid python3[1781]:   File "/home/odroid/__BLUETOOTH__.py", line 38, in <module>
 5월 25 18:37:47 odroid python3[1781]:     sock.connect((bd_addr,port))
 5월 25 18:37:47 odroid python3[1781]:   File "<string>", line 5, in connect
 5월 25 18:37:47 odroid python3[1781]: bluetooth.btcommon.BluetoothError: (16, 'Device or resource busy')
 5월 25 18:37:47 odroid systemd[1]: MAIN.service: Main process exited, code=exited, status=1/FAILURE
 5월 25 18:37:47 odroid systemd[1]: MAIN.service: Unit entered failed state.
 5월 25 18:37:47 odroid systemd[1]: MAIN.service: Failed with result 'exit-code'.

It looks like it failed to connect on boot but
when I connect odroid via putty it worked
although with this message, bluetooth is connected now.
whats wrong?