mmalmeida / bdremote-ng

Automatically exported from code.google.com/p/bdremote-ng
GNU General Public License v2.0
0 stars 0 forks source link

Init script not working since Ubuntu 10.04 #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Install on Ubuntu 10.04
2.Create the boot script as per wiki
3. Reboot

What is the expected output? What do you see instead?
We expect the remote to work.
If we run irxevent we expect irw to display the buttons pressed in the remote.
In the general wiki, the comments from "Comment by beejay41,  May 21, 2010"
onwards refer to this issue.
Something has changed in the boot sequence that has made these scripts stop
working. I have tried some different boot priorities, but none worked.

I would like to help fix this issue and update the corresponding wiki page,
but I am failing to diagnose the problem correctly...

Original issue reported on code.google.com by miguelde...@gmail.com on 3 Jun 2010 at 10:29

GoogleCodeExporter commented 9 years ago
To help understand the problem, I attach my current init script (the one 
provided
doesn't work).

This script does not work on startup, but then simply stopping and starting the
service makes it work correctly.

I've tried quite a few different init priorities (starting with the ones 
suggested in
the wiki). 
The one for this particular test case was:
bdremote: S99
bluetooth: S80
lirc: S75

Original comment by miguelde...@gmail.com on 6 Jun 2010 at 12:08

Attachments:

GoogleCodeExporter commented 9 years ago
Did you try to capture the stdout/stderr output of bdremoteng? I mean like 
using "bdremoteng $options &> /tmp/bdr.log" first time it tries to start.

I would like to help .. but I have no recent ubuntu system. The one I have 
works fine with bdremoteng.

Anyway, my guess is that (as crazy as it sounds) that you need to

1. start bluetooth to initialize adapters.
2. wait a few seconds
3. stop bluetooth
4. start bdremote
5. start bluetooth.

Original comment by wo...@wojci.dk on 10 Jun 2010 at 8:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I finally upgraded my ubuntu to the latest version. Stay tuned ..

Original comment by wo...@wojci.dk on 14 Jun 2010 at 6:48

GoogleCodeExporter commented 9 years ago
I was able to reproduce your problem.

After taking a look at the bluez init script, I can see that it waitfs for udev 
to start the bluetooth daemon. So I need a way to determine when bluetooth is 
done initializing so that I can start bdremote. 

# cat /tmp/bdremote-startup.2 
Configuration:
 - listen port : 8888.
 - timeout     : 600 second(s).
 - repeat rate : 10 per secound.
 - repeat delay: 800 ms.
 - release     : not set.
 - LIRC names  : 0.
 - event output: 0.
 - debug       : 1.
                 LIRC thread(1) sock(1) callback(1),
                 bluetooth interface(1) implementation(1),
                 queue(1),
                 spare(1),
                 main(1).
 - iface addr  : 00:19:86:00:13:86.
 - remote addr : 00:19:C1:58:C3:B7.
 - detach      : 0.
 - user        : wojci.
 - group       : wojci.
 - log         : '/tmp/bdremote.log'.
 - battery
 - script    : '/home/wojci/batterychange.sh'.
capture_bluez.c:503 -> 23:39:8:
Using BT address: 00:19:86:00:13:86.
capture_bluez.c:514 -> 23:39:8:
Opened HIDP socket.. 
bdremoteng.c:191 -> 23:39:8:
InitcaptureLoop failed.

It looks like blueooth is not initialized at the time bdremote tries to start.

Original comment by wo...@wojci.dk on 15 Jun 2010 at 9:54

GoogleCodeExporter commented 9 years ago
Updated my media box to 10.04. I added 
"DisablePlugins? = input" to my bluez config as some user suggested. With this, 
I don't have to stop bluez before starting bdremoteng. Bdremoteng starts as 
usual followed by lirc. Do you want me to post my init scripts?

Original comment by wo...@wojci.dk on 17 Jun 2010 at 11:08

GoogleCodeExporter commented 9 years ago
Yes, can you please post them?

By the way, what options did you run bdremote with in comment #5 to have the 
part "capture_bluez.c" onwards in the bdremote-startup.2 log file? Is this the 
regular log?

Original comment by miguelde...@gmail.com on 18 Jun 2010 at 11:33

GoogleCodeExporter commented 9 years ago
I updated http://code.google.com/p/bdremote-ng/wiki/initscripts with the ones I 
am using currently.

The application first tries to initialize bluez and then forks and opens a 
logfile. Not forking (with -n) will give you the output that I pasted.

See if you can make it work with my init scripts. And let me know if there is 
anything else that I can do for you.

Original comment by wo...@wojci.dk on 19 Jun 2010 at 7:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am giving your scripts a try, but right now it is only working if I manually 
start the bdremote-ng service after startup. Running cat on 
/tmp/bdremote-startup.2 yields:
Configuration:
 - listen port : 8888.
 - timeout     : 600 second(s).
 - repeat rate : 10 per secound.
 - repeat delay: 800 ms.
 - release     : not set.
 - LIRC names  : 0.
 - event output: 0.
 - debug       : 1.
                 LIRC thread(1) sock(1) callback(1),
                 bluetooth interface(1) implementation(1),
                 queue(1),
                 spare(1),
                 main(1).
 - iface addr  : 00:09:DD:50:33:5A.
 - remote addr : 00:19:C1:58:E6:53.
 - detach      : 0.
 - user        : miguel.
 - group       : users.
 - log         : '/tmp/bdremote.log'.
 - battery
 - script    : not set.
capture_bluez.c:496 -> 23:41:24:
Unable to use interface address: 00:09:DD:50:33:5A.
bdremoteng.c:191 -> 23:41

Original comment by miguelde...@gmail.com on 23 Jun 2010 at 10:45

GoogleCodeExporter commented 9 years ago
See if you can use the bt_ready.sh script that I added to 
http://code.google.com/p/bdremote-ng/wiki/initscripts. I call it before trying 
to stop bluez, start bdremote and start bluez again.

Original comment by wo...@wojci.dk on 27 Jul 2010 at 9:47