Disable serial port in config.ini

Posted by: andym

Disable serial port in config.ini - 21/09/2002 09:01

Could we get an option in config.ini to stop the player from hogging the serial port? I might finally get my GPS compass written then!
Posted by: image

Re: Disable serial port in config.ini - 21/09/2002 12:50

supress_notify=1?
Posted by: tfabris

Re: Disable serial port in config.ini - 21/09/2002 14:35

I think he means to prevent the Player app from having exclusive control over the serial port while it's running (which prevents a third-party app from making use of the serial port without first terminating the player app).

Wasn't there already a way to work around this? I thought Kim's project already handled this situation.
Posted by: wfaulk

Re: Disable serial port in config.ini - 21/09/2002 15:36

Doesn't starting the player with the `-s-' option do that? I think other folks talked about that here before, but it's not listed in the ``Player Command Line Arguments'' section of the Player App section of Developer Info on riocar.org.

If so, then moving the player app to a different file and replacing the original filename with a script like:
#!/bin/sh

player.new -s- "$@"
should do the trick, I think (read the postscript below).

Edit: It's "-s-", not "-s" (fixed it above), and, apparently, my idea doesn't work. Check out this thread.
Posted by: mtempsch

Re: Disable serial port in config.ini - 21/09/2002 15:43

Looking in the programming forum, the switch might actually be -s-.

/Michael
Posted by: andym

Re: Disable serial port in config.ini - 22/09/2002 03:48

I think a config.ini option is the best way to get it working, is there an official wish list this can get added to? I doubt it's a serious mod anyway.
Posted by: wfaulk

Re: Disable serial port in config.ini - 22/09/2002 11:17

I don't mean to be a naysayer, but you're going to have to modify the init (or something) in order to get your GPS compass to work anyway, right?

At the same time, I doubt that it would be a significant modification, but that doesn't necessarily mean that they'll do it. It's their baby, after all.
Posted by: andym

Re: Disable serial port in config.ini - 22/09/2002 13:16

I'm not really a Linux-head so I'm limited by my knowledge. All I do know is the renaming of the player and using a shell script to launch the player screws hijack up. So really it's either needs to be a mod in the player app or Mark needs to see why the renaming of the player binary stops Hijack from being able to read the config.ini file. Unless someone knows of another way..... anyone? anyone? bueller?
Posted by: smu

Re: Disable serial port in config.ini - 22/09/2002 13:37

The reason HiJack isn't able to read the config.ini when the player is renamed is that it check's for the name of the process that tries to read config.ini and only reads it itself if that name is the name of the player binary.
Solution: Don't rename the player binary, but move it to a different directory. After that, your script needs to chdir to that directory and start the player from there.
Other solution: Rename/replace the init script instead of the player app. The script doesn't do very complicated things anyway, just mounts the partitions, starts the player app in a loop. In that loop, it also starts a shell of the player exits with a certain return/exit level. (See the developer section on riocar.org for more details).

cu,
sven
Posted by: andym

Re: Disable serial port in config.ini - 22/09/2002 13:54

Thanks Sven! I'll give that a go tomorrow. GPS here I come!!!
Posted by: Shonky

Re: Disable serial port in config.ini - 22/09/2002 19:48

I did this in the thread that Bitt linked to earlier and had no success though. I will definitely be interested in a solution though.

Now that I have sourced an empeg tuner, I have to get my Alpine CD changer software/hardware interface to work properly, which requires talking to the serial port. Also have that GPS... hmmm I'm out of serial ports .
Posted by: jaharkes

Re: Disable serial port in config.ini - 23/09/2002 08:05

Along with the gps app I wrote there is a tiny little program (hack_init) that succesfully hacks the init binary to start a wrapper instead of the real player app. It adds the -s- flag to the arguments when it notices that the player is booted in the car. It works for me, otherwise I wouldn't have been able to
get the GPS output in the first place.
Posted by: andym

Re: Disable serial port in config.ini - 23/09/2002 12:38

That sounds cool, does Hijack still work after this mod has been done?
Posted by: jaharkes

Re: Disable serial port in config.ini - 23/09/2002 15:28

Ehh, it should. The player is exec'd with the full name that hijack expects /empeg/bin/player. I need hijack anyway to display the graphics, but I'm not using any of the @AC or whatever modifiers in config.ini.
Posted by: andym

Re: Disable serial port in config.ini - 23/09/2002 15:56

Brilliant! That's what I'll use then. Thanks ever so!
Posted by: andym

Re: Disable serial port in config.ini - 24/09/2002 04:13

In reply to:

Solution: Don't rename the player binary, but move it to a different directory. After that, your script needs to chdir to that directory and start the player from there.




Could someone tell me how to write this in a script? when I type chdir it says command not found.
Posted by: wfaulk

Re: Disable serial port in config.ini - 24/09/2002 06:03

The command is ``cd''. Let us know what other help you might need.
Posted by: andym

Re: Disable serial port in config.ini - 24/09/2002 07:19

Okay, I've copied the chmodded the player app into a directory called 'noserial' inside /empeg/bin. Currently my script looks like this:

#!/bin/bash
cd /empeg/bin/noserial/
player -s-


The player says it can't find the file called 'player'
Posted by: mtempsch

Re: Disable serial port in config.ini - 24/09/2002 08:15

./player -s-

Current directory isn't normally part of $PATH
Also make sure it's executable.

/Michael
Posted by: andym

Re: Disable serial port in config.ini - 24/09/2002 09:32

it still doesn't work. Once I run the player script I get a load of this...

[hijack] ERROR: : "no memory"
/empeg/bin/player: /empeg/bin/noserial/: is a directory
kmalloc: Size (262873) too large
hijack: no memory for parsing config.ini; skipped

[hijack] ERROR: : "no memory"
/empeg/bin/player: /empeg/bin/noserial/: is a directory
kmalloc: Size (262873) too large
hijack: no memory for parsing config.ini; skipped

[hijack] ERROR: : "no memory"
VM: killing process player
buffermem : 331776
page_cache_size : 81
nr_free_pages : 90
num_physpages : 4096
/empeg/bin/player: line 2: 177 Killed /empeg/bin/noserial/
VM: killing process player
buffermem : 331776
page_cache_size : 81
nr_free_pages : 91
num_physpages : 4096
/empeg/bin/player: line 3: 178 Killed player -s-

What am I doing wrong?
Posted by: jaharkes

Re: Disable serial port in config.ini - 24/09/2002 11:54

That won't work, believe me I tried that at first as well.
First of all, as others reported earlier on the BBS /bin/init cannot exec shell scripts, only binaries. So whatever it starts it better be a compiled program.
Second, hijack explicitly matches on /empeg/bin/player, that is the only executable on the system that will see a modified config.ini file.
That's why I wrote hack_init for my gps application.
Posted by: andym

Re: Disable serial port in config.ini - 24/09/2002 14:04

Thanks Yan, I'll download your stuff and use hack_init.
Posted by: mlord

Re: Disable serial port in config.ini - 25/09/2002 19:57

Shouldn't need to hack init: Hijack looks for /sbin/hijack before init during startup..