|
 |
|
05-28-2009, 09:40 AM
|
#61
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Quote: Originally Posted by Bugbyte 
Ok, this is what apt-get uses to find software to install, and you just have the main support (binary) repo. If other repos exist or you create your own you can add them to this file and run 'apt-get update' to pickup the changes. This is where a "normal" ubuntu install would come in handy as a reference.
You should be able to add a line to get the sources from that repo though with
deb-src http://ports.ubuntu.com[/url] jaunty main restricted universe multiverse
Quote: Originally Posted by Bugbyte 
locate is an unknown command for my system. However, I found out how to use apt-get search [filename] and looked for eeprom_93cx6. But I'm confused. apt searches the repository -or it searches my computer?
Edit: Nevermind. It turns out I had to install mlocate.
You mean 'apt-cache search ..' right? This searches the metadata stored about available packages as well as those installed. As you can see there is a lot more to a package than just some files zipped up. The metadata is put into a database and allows you to determine if files have been modified (permissions, size, md5 checksum etc.), what versions you have and what dependencies packages have (which is how apt-get can install required packages for you automagically).
'locate' (from slocate or mlocate) is a handy tool to earch you local filesystem quickly. updatedb just updates the cached data - most distros have a cron job running this daily to keep it current but if you don't use it often, its just as easy to run updatedb before using it.
This just helps find stuf when you are unsure where they are.
Quote: Originally Posted by Bugbyte 
Searching for eeprom_93cx6 returned nothing, however but I think that is what apt-get search does for me, yes?
It means you don't have it installed. Most modules are not packages so you can't just install them with apt-get. You need to build them for your kernel, and possibly build the whole kernel to do so. When I get the chance I'll see if I can find this out for you. The search results you showed in your original post just show that the kernel header files contain header files for this so its at least supported on this kernel.
You can broaden your search with apt-cache search by using just 'eeprom' say to see if any packages exist with a slightly different name but I doubt it. This is handy when looking for other packages though so worth knowing
sudo apt-cache search eeprom | less
I'm not sure what user you login as but usually you want to avoid being root unless you really have to. When you need super power, you can use the command 'sudo' to run the command as root. It will prompt you for *your* password and actually remembers it for a minute or two so you don't have to enter a password every time. If you are logged in as root you can omit this.
'less' allows you to page through results by hitting the space bar. You can search for things by typing '/' (or '?' to search backwards) then the word, then enter. You'll see matches highlighted and you can jump to the next match by pressing 'n'.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
05-28-2009, 10:53 AM
|
#62
|
|
Admin. Don't bug or I'll byte.
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,142
|
Thanks for the pointers! I usually log in as root, but that's because I don't have a good handle on how to create a user ID.
I've ordered about 5 books on Ubuntu Linux, php, perl and SQL to get me oriented on how to do stuff right. For example, I installed proFTPd so I could put files on the plug but I've done something wrong and it doesn't recognize the command ftp: These books will help me to understand the file structure, how to add modules and make packages and so forth.
Aside from just trying to figure out the structure of the new (to me) OS, I'm going to concentrate on getting the following things working:
1. Apache web server (already installed, but need to ensure it is configured properly)
2. PHP server (again, already installed, but need to ensure proper configuration)
3. mySQL server (installed, same issue as above)
4. FTP server (ditto)
5. Add a wireless USB dongle - will need to locate and install packages
6. Take chunkyks OBDII Linux interface, recompile it for the Sheeva, see if it works
7. Write Perl script to access the OBDII data and relay it to a web page
8. Write javascript web page that displays something simple like RPM and MPH
9. Try to access that from the iPhone
10. Do the same as 6-10 using Kev000's Fusion Brain module.
That ought to keep me busy for awhile!
|
|
|
05-28-2009, 01:36 PM
|
#63
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Quote: Originally Posted by Bugbyte 
Thanks for the pointers! I usually log in as root, but that's because I don't have a good handle on how to create a user ID.
Ok, do this as root to create the user
# adduser bugbyte
You will be prrompted to enter a password twice. The other prompts you can supply info or just hit enter if you don't want to enter them until the end where you want to press 'y'.
Now to give that user sudo rights, run
# visudo
This is a wrapper script to avoid multiple people editing the sudo config file (/etc/sudoers) at the same time. As such you will be in the editor vi. If you prefer some other editor like joe, you can run
# EDITOR=joe visudo
But for vi here is how you can add a line to give the user bugbyte full root access when needed
1. use the arrow keys to scroll down to the line that looks like
root ALL=(ALL) ALL
2. Change it to be
root,bugbyte ALL=(ALL) ALL
In vi you want to get your cursor after the t in root and press 'i' to get into insert mode, type ',bugbyte', then hit escape to get out of edit mode and then type ':wq' to save and quit.
You can now ssh in as bugbyte and prefix commands with sudo, or to become root run
$ sudo su -
Quote: Originally Posted by Bugbyte 
I've ordered about 5 books on Ubuntu Linux, php, perl and SQL to get me oriented on how to do stuff right. For example, I installed proFTPd so I could put files on the plug but I've done something wrong and it doesn't recognize the command ftp: These books will help me to understand the file structure, how to add modules and make packages and so forth.
Aside from just trying to figure out the structure of the new (to me) OS, I'm going to concentrate on getting the following things working:
1. Apache web server (already installed, but need to ensure it is configured properly)
2. PHP server (again, already installed, but need to ensure proper configuration)
3. mySQL server (installed, same issue as above)
4. FTP server (ditto)
5. Add a wireless USB dongle - will need to locate and install packages
6. Take chunkyks OBDII Linux interface, recompile it for the Sheeva, see if it works
7. Write Perl script to access the OBDII data and relay it to a web page
8. Write javascript web page that displays something simple like RPM and MPH
9. Try to access that from the iPhone
10. Do the same as 6-10 using Kev000's Fusion Brain module.
That ought to keep me busy for awhile!
Yeah that's a nice size list. I'm less familiar with debian based systems than rpm based systems and have not used 9.04 yet or Id just rattle of the first 4 for you. They should be easy in any event.
5 shouldn't be too big of a deal but will probably require you to learn as much as the other
8 should be easy and you can gets lots of help with that.
For the others I can't comment although I plan on doing #10 myself. Although I will say the vehicles I want to have a carputer in either have no ecu or are OBDI and one idea I had is to take whatever data collection I have and present it in a way that is compatible with OBDII output so I could leverage existing efforts for OBDII monitoring on the display side.
|
|
|
05-28-2009, 02:38 PM
|
#64
|
|
Variable Bitrate
Join Date: Jun 2008
Location: Seattle, WA
Posts: 231
|
BTW, are you sure you need that eeprom_93cx6 module? I don't have it on my system either, but both USB wi-fi adapters I listed in my previous post work fine. At least one of them uses the rtl8187 module, too.
Edit: Never mind, I do have it. I was looking on the wrong machine. Too many linux machines.
-- Kevin
Last edited by kross; 05-28-2009 at 02:41 PM.
|
|
|
05-28-2009, 02:43 PM
|
#65
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
He's probably not sure. Keeping in mind he's a newbie we should explain how to discover these sorts of things.
One thing you want to get used to is watching /var/log/messages for info (same stuff that dmesg outputs goes here). The easiest is to keep multiple ssh sessions open and in one of them run
sudo tail -f /var/log/messages
tail shows the end of a file and with the -f flag it will sit there and keep reading from it, showing you stuff as it gets added in (near) realtime
With tail running, plug in a usb device and watch the log. You'll see if it recognizes it or not. Same when you pull it out you should see messages as it cleans up. Start there and see what you get.
For general usb info try 'lsusb' and 'lsusb -v'
To see modules loaded uses 'lsmod'
hth
charles
|
|
|
05-28-2009, 05:55 PM
|
#66
|
|
Admin. Don't bug or I'll byte.
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,142
|
Quote: Originally Posted by cgalpin 
He's probably not sure. Keeping in mind he's a newbie we should explain how to discover these sorts of things.
Right, I'm not *certain* but I got that information from the plug computing site on a thread about adding a wireless USB dongle to the Sheeva, so at least for the model they mentioned, that was what was needed.
I appreciate the help, everyone.
|
|
|
05-28-2009, 06:08 PM
|
#67
|
|
Maximum Bitrate
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
|
You mentioned proFTPD a few posts earlier. Anything that is a server, and popular, is usually easy to figure out check out this guide: http://www.ubuntugeek.com/settingup-...h-proftpd.html
I believe that after installing the ftp server, restarting is the easiest way for a noob to get it running.
|
|
|
05-28-2009, 07:21 PM
|
#68
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Quote: Originally Posted by Bugbyte 
Right, I'm not *certain* but I got that information from the plug computing site on a thread about adding a wireless USB dongle to the Sheeva, so at least for the model they mentioned, that was what was needed.
Yes it will depend on the chipset of your dongle. Try what you have and if it doesn't work, we can help figure out what chipset it is and what modules you'd need.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
05-29-2009, 09:49 PM
|
#69
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
I needed to install jaunty on my little Fujitsu stylistic LT C500 since I am running gutsy which is now not supported, so figured I'd help you with some of your tasks now that I have at least the same version to play with. It's quite possible you won't have all the same packages available, and I have no disk space limitations to speak of whereas I suspect you will, but here is what you can do to install and test #s 1-4
#1-3 Linux Apache Mysql Php stack (LAMP)
I know you have apache, php, and mysql already installed, but if you have any trouble or just want to be sure, you can do it the lazy man's way with
sudo tasksel install lamp-server
Then you want to confirm it's working. We can test all 3 in one fell swoop with something that you might also mind useful in the future - phpmyadmin. So install it with
sudo apt-get install phpmyadmin
It will prompt you for your root mysql password, and then setup a phpmysqladmin user and prompt you for a password for that. Everything else is taken care of for you and you can run it by going to
http://PLUGIP/phpmyadmin
The login is phpmyadmin/passyougaveduringtheinstall
You can of course go old-school and make your own test page under /var/www. Assuming you are doing this as root (for permissions), run
echo "<?php phpinfo() ?>" > /var/www/phpinfo.php
And then you can hit the page at
http://PLUGIP/phpinfo.php
#4 proftpd
I assume you chose standalone when prompted during the server install, but in your case inetd would actually be lower resource use imo. But I think ftp is a dead protocol anyway, so I won't digress
Verify it's in standalone mode with
grep ServerType /etc/proftpd/proftpd.conf
You should get back
ServerType standalone
Start proftpd with
sudo /etc/init.d/proftpd start
You can now ftp to the server (not as root by default). You can test locally with
ftp localhost
And login as your non root user. Or from any other machine on the network. By default you can access your own home directory, but you'd need to do some configuration to allow access to other directories. If for some reason it doesn't auto start after a reboot, run
update-rc.d proftpd defaults
And it should start automatically on subsequent reboots.
I'd personally transfer files over ssh (see fugu on a mac, or winscp on windows). You can even setup passwordless keys and make it super easy.
hth
charles
|
|
|
06-02-2009, 10:00 PM
|
#70
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
My Fusion Brain arrived yesterday so I can give you a head start on #10
Kev's dbus daemon comes with a copy of FB so you just need to download it. I'm sure it will be hosted somewhere at some point but for now you can dig it up from this thread here:
http://www.mp3car.com/vbulletin/1315226-post12.html
http://www.mp3car.com/vbulletin/atta...nux-fbd.tar.gz
First you'll need to install some dependencies (again this is on x86 so you may not have all of these in the sheeva repo)
Code:
sudo apt-get install libusb-0.1-4 libusb-dev
I doubt you have room for this since one of it's dependencies is qt4-doc which takes 51M alone, but you can install qt4-dev-tools in you need/want the qbusviewer. I found it handy but you can do without it.
Code:
sudo apt-get install qt4-dev-tools #(optional)
Get the tarball on the device and build with
Code:
tar xzf fbd.tar.gz
cd fbd/
qmake
make
Then you need to copy one file to be able to run the daemon
Code:
sudo cp FusionBrain.conf /etc/dbus-1/system.d/
At this point you may need to restart dbus (not sure but it can't hurt)
Code:
sudo /etc/init.d/dbus restart
With your Fusion Brain plugged in start fbd as root
And you should see something like
Code:
root@jaunty:/home/cgalpin/fbd# ./fbd
Fusion Brain V4 found!
Attempting to open interface...
Fusion Brain connected!
If you want to just test from the commandline you can use dbus-send
Set the first digital output on (you should see the lcd come on)
Code:
dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int32:0 boolean:true
Turn off the 3rd digital output
Code:
dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int32:2 boolean:false
And so on. I ran into problems reading analog output and I think the daemon is only partially completed but its a great start!
I also tried a php-dbus package (seems to be anothr one being developed for pecl, but it's not ready yet). It's easy to try.
Download and install:
You'll need to add this to your php configuration and the most maintainable way is to add a file to /etc/php5/apache2/conf.d You need to be root to do this and an easy way is
Code:
sudo su -
echo "extension=dbus.so" > /etc/php5/apache2/conf.d/dbus.ini
^D
I also found the default memory settings were too low so you might as well fix that up front. Edit php.ini as root
Code:
sudo vi /etc/php5/apache2/php.ini
And change memory_limit = 16M to memory_limit = 32M (although even at 32M i get the occasional memory error with this)
You will need to restart apache for these changes to be picked up
Code:
sudo /etc/init.d/apache2 restart
Now you can make a test script - say /var/www/dbus.php and run it as http://PLUGIP/dbus.php
On my system I had to create the file as root and give my non-root user ownership or you can just edit it as root. Here is a little script to turn the digital outputs on/off
# turn digital output 0 on
http://PLUGIP/dbus.php?do=0&value=1
# turn digital output1 off
http://PLUGIP/dbus.php?do=1&value=0
and so on.
PHP Code:
<?php
$do = isset($_GET['do']) ? (int)$_GET['do'] : 0;
$value = isset($_GET['value']) ? (bool)$_GET['value'] : true;
$timeout = 1; # seconds
echo "Setting digital output $do to " . ($value ? "true" : "false" ) . "..</br>";
$dbus = dbus_bus_get(DBUS_BUS_SYSTEM);
if ( $dbus )
{
$m = new DBusMessage(DBUS_MESSAGE_TYPE_METHOD_CALL);
if ( $m )
{
$m->setDestination("org.openice.fbd");
$m->setPath("/org/openice/fbd");
$m->setInterface("org.openice.fbd.fusionbrain");
$m->setMember("SetSingleOutput");
$m->setAutoStart(true);
$m->appendArgs($do);
$m->appendArgs($value);
$r = $dbus->sendWithReplyAndBlock($m,$timeout);
if ( $r )
{
$tmp = $r->getArgs();
echo "Got reply:<br/>";
print_r($tmp);
}
}
}
?>
Oops - looks like I got a little caried away with the code blocks
hth
charles
|
|
|
06-03-2009, 05:41 AM
|
#71
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Before I forget, I didn't mention that out of the box you can't write to the FB due to permissions restrictions. I chose to add a udev rule to change the owner to my non-root user I run my system as.
To do this you need to identify some distinguishing info about your device - the vendor id and product id should be sufficient and these are shown in the output of "lsusb" otherwise you can use udevadm if you want to get fancy.
Then just create a file /etc/udev/rules.d/50-fb.rules (any name you want as long as it starts with a number - which controls the order it is loaded - and ends in .rules). Inside it put
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000e", OWNER="cgalpin", MODE="0666"
You'll want to change the "04d8", "000e" and "cgalpin" to suit your environment. The rule basically says if you match the device with this vendor id and product id, change the owner to cgalpin and set the permissions to 666.
Then just unplug and re-plugin the FB and device permissions/owner will be changed if your rule is working.
hth
charles
|
|
|
06-03-2009, 05:57 AM
|
#72
|
|
North of the land of Hey Huns
Join Date: Jun 2004
Location: Westminster, MD
Posts: 1,036
|
I should be fixing analog input this weekend, as well as cleaning up some of the digital output code so it works a lot smoother
__________________
RevFE - Try it, you just might like it.
Carbon - Next Generation Touchscreen Browser
Come join us on IRC: irc.efnet.net #mp3car
Audiophiles make me chuckle as they pad my wallet.
|
|
|
06-03-2009, 06:11 AM
|
#73
|
|
licensed to kill
Join Date: Aug 2006
Location: Deep in the Rockies... coding in caves
Posts: 1,038
|
Quote: Originally Posted by cgalpin 
Before I forget, I didn't mention that out of the box you can't write to the FB due to permissions restrictions. I chose to add a udev rule to change the owner to my non-root user I run my system as.
To do this you need to identify some distinguishing info about your device - the vendor id and product id should be sufficient and these are shown in the output of "lsusb" otherwise you can use udevadm if you want to get fancy.
Then just create a file /etc/udev/rules.d/50-fb.rules (any name you want as long as it starts with a number - which controls the order it is loaded - and ends in .rules). Inside it put
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000e", OWNER="cgalpin", MODE="0666"
You'll want to change the "04d8", "000e" and "cgalpin" to suit your environment. The rule basically says if you match the device with this vendor id and product id, change the owner to cgalpin and set the permissions to 666.
Then just unplug and re-plugin the FB and device permissions/owner will be changed if your rule is working.
hth
charles
running fbd as root also solves this issue. I'm kinda torn on the issue: fbd as root but use the system bus, fbd as user, use session bus, but add udev rule... Lose-lose situation
The one thing I haven't been able to test on the fbd is the analog input dbus signal. have you been able to test that?
__________________
LinuxICE - because my car already has enough windows (and because I like speed).
LinuxICE2 beta2 is released!!! get it now!
Follow OpenICE development
|
|
|
06-03-2009, 06:28 AM
|
#74
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Quote: Originally Posted by kev000 
running fbd as root also solves this issue. I'm kinda torn on the issue: fbd as root but use the system bus, fbd as user, use session bus, but add udev rule... Lose-lose situation 
In this application, running fbd as root is fine for sure and I would use it this way. And for Bugbyte he'll definitely want to keep it using the system bus as connecting to the session bus from apache/php opens up a whole can of worms that is not worth getting into if you can avoid it (permissions and X related).
But If you want to use Malcom's GUI or any other direct access as a non-root user you'll need the rule there too of course and this is why I forgot about it - I only needed this when first trying out the FB without dbus.
But in terms of setting up a system, this should be pretty easy to automate too if we want to make it easy for people to use this (a udev script that calls a slightly smarter script to determine the right user to give permissions, or just broaden the permissions a bit to a group the primary user should already be in, etc.)
Quote: Originally Posted by kev000 
The one thing I haven't been able to test on the fbd is the analog input dbus signal. have you been able to test that?
I only got as far as trying to get an analog value and it segfaults at any attempt. I have not tried registering for any signals. I am not if it's a fbd or Fb issue. I plan on getting familiar with the code but don't expect to be able to spend too much time on this for the next few days.
I'll tell you I was a bit surprised to see the polling. Maybe I shouldn't have, but I kind of expected the FB to be doing the polling and expose the changes as signals to the outside world. Not sure what else the chip is doing with it's cycles  On my crappy little carputer this polling takes a fair amount of cpu - as much as 10% shown by top, which worries me. And I am not sure why, but the php calls to dbus seem to take a lot of memory when I'd expect it to take little to none.
But really cool stuff - getting me excited enough to follow through on a lot of stuff I keep talking about doing but never do
I'd really like to help with this, even if just doing grunt work like developing tests, documenting it and making sample test programs in various languages, although I should be able to contribute more significantly than that if it's wanted.
charles
p.s. Sorry if I have butchered people's names. I think I called you Kevin at some point and know know it's Kevron. As you can tell I don't get into the whole clever naming scheme, and never know what to call people
|
|
|
06-03-2009, 03:25 PM
|
#75
|
|
Admin. Don't bug or I'll byte.
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,142
|
Quote: Originally Posted by cgalpin 
I know you have apache, php, and mysql already installed, but if you have any trouble or just want to be sure, you can do it the lazy man's way with
sudo tasksel install lamp-server
Then you want to confirm it's working. We can test all 3 in one fell swoop with something that you might also mind useful in the future - phpmyadmin. So install it with
sudo apt-get install phpmyadmin
It will prompt you for your root mysql password, and then setup a phpmysqladmin user and prompt you for a password for that. Everything else is taken care of for you and you can run it by going to
http://PLUGIP/phpmyadmin
The login is phpmyadmin/passyougaveduringtheinstall
You can of course go old-school and make your own test page under /var/www. Assuming you are doing this as root (for permissions), run
echo "<?php phpinfo() ?>" > /var/www/phpinfo.php
And then you can hit the page at
http://PLUGIP/phpinfo.php
Awesome! Thanks for the help!
Okay, I tried to install phpmyadmin but I mistyped the root password and it failed. It said:
"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
dbconfig-common: phpmyadmin configure: trying again.
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
*** WARNING: ucf was run from a maintainer script that uses debconf, but
the script did not pass --debconf-ok to ucf. The maintainer
script should be fixed to not stop debconf before calling ucf,
and pass it this parameter. For now, ucf will revert to using
old-style, non-debconf prompting. Ugh!
Please inform the package maintainer about this problem.
Replacing config file /etc/phpmyadmin/config-db.php with new version
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
unable to connect to mysql server.
error encountered creating user: See, this is where my n00bness gets me in trouble. I tried reinstalling it but got:
Building dependency tree
Reading state information... Done
phpmyadmin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. On a side note, issuing http://plugIP/phpinfo.php does give me back a page with all the info on it. I had created that when I installed php. However, phpmyadmin gives me a 404 error.
Also, on proftpd, I set it up as an inet server because it said it would use less resources, but now I get the following:
root@iPlug:~# sudo /etc/init.d/proftpd start
ProFTPd is started from inetd/xinetd.
root@iPlug:~# ftp localhost
-bash: ftp: command not found Sorry for being such a pain. Don't worry, my Perl scripting book and my Linux for dummies book arrived yesterday and I've got about 4 more that deal with php and administering apache server on the way.
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:50 PM.
| |