• Home
  • Help
  • Search
  • Login
  • Register
  Show Posts
Pages: 1 2 3 [4]
46  Linux Stuff / General Linux questions / Re: Setting the time & date on the guruplug on: May 20, 2010, 08:50:10 AM
As far as I can tell, I have Debian GNU/Linux 5.0.4 "lenny" installed. Maybe from an older script?
I just did check:

Code:
sheevaplug-debian:~# apt-get install ntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  ntp-doc
The following NEW packages will be installed:
  ntp
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Which confirms that it hadn't been installed yet. In looking in the current RFS rebuild script available here:
http://plugcomputer.org/plugwiki/images/d/d7/Debian_rfs.tar.bz2

I see that ntp is indeed slated for install:

Code:
# Install ntp.
PACKAGE_LIST=`echo ${PACKAGE_LIST} ntp`

Along with this:

Code:
cat >> $TARGET_DIR/etc/rc.local <<EOF

mount -a
date 080808082009
mkdir -p /var/cache/apt/archives/partial

/root/init_setup.sh

EOF

Other packages (obviously) missing from my RFS are lp/lpr[ng], wpasupplicant, there may be more.
Another oddity was in /etc/apt/sources.list:

Code:
deb http://10.82.108.51/kedars/sheevaplug_wifi/builds/packages/ binary/

Hmm.. an internal server. Anyways, I see no need to rebuild the RFS, as I have been tuning it to suit my needs.

No wireless, bluetooth, iptables, samba, avahi-daemon.
I've blacklisted visor, ipv6, btmrvl, btmrvl_sdio, bluetooth, libertas, and libertas_sdio.

Code:
sheevaplug-debian:~# lsmod
Module                  Size  Used by
kl5kusb105             10174  0
usbserial              28876  1 kl5kusb105

I have installed cups, nfs-user-server, and build-essential

FWIW, Jim
47  General Category / Success stories / Dataloging with the guruplug server on: May 19, 2010, 03:59:56 PM
One of the main reasons I purchased the gplug was to log the output from my grid tied PV array. I have a fronius IG 3000 inverter http://www.fronius.com/cps/rde/xchg/SID-7042C1B4-F4045AC7/fronius_usa/hs.xsl/2714_1475.htm with an installed Interface Easy Card, which allows serial communication, albeit in some proprietary format. A kind soul named David Stone wrote a program called fslurp to access the data, and hosted it on sourceforge http://sourceforge.net/projects/fslurp/. fslurp needs to be compiled to obtain a binary executable, so I needed some dev tools.

Code:
apt-get install build-essential

fslurp compiled without errors, and all seemed good. The next step was to get serial access to the inverter. Out of my parts drawer I found a USB to serial dongle with no markings on it. Plugged it in, looked at dmesg, and found the following:

Code:
sheevaplug-debian:~# dmesg
<snip>
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for Handspring Visor / Palm OS
USB Serial support registered for Sony Clie 3.5
USB Serial support registered for Sony Clie 5.0
visor 1-1.3:1.0: Handspring Visor / Palm OS converter detected
usb 1-1.3: Handspring Visor / Palm OS converter now attached to ttyUSB0
usb 1-1.3: Handspring Visor / Palm OS converter now attached to ttyUSB1
usbcore: registered new interface driver visor
visor: USB HandSpring Visor / Palm OS driver
USB Serial support registered for KL5KUSB105D / PalmConnect
usbcore: registered new interface driver kl5kusb105d
kl5kusb105: v0.3a:KLSI KL5KUSB105 chipset USB->Serial Converter driver
<snip

Two ttyUSB devices? I never did figure that out, and it made it impossible (for me) to write a bash script to access it. Unplugging/replugging would then tie it to ttyUSB2, I ended up making an entry in /etc/modprobe.d/blacklist:

Code:
sheevaplug-debian:~# cat /etc/modprobe.d/blacklist | grep visor
blacklist visor

And now the dongle is identified as ttyUSB0 on bootup. I don't know the ramifications of blacklisting visor, maybe some day I'll find out. But wait, there's more! the gplug has two USB ports and I may plug any number of things into the vacant port and disrupt the naming sequence. So I created a udev rule which will link the USB/serial dongle to /dev/fronius upon bootup, or whenever it is plugged in. Extracting the information from udev:

Code:
sheevaplug-debian:~# udevinfo -p /sys/class/tty/ttyUSB2 -a

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0':
    KERNEL=="ttyUSB0"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty':
    KERNELS=="tty"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0':
    KERNELS=="ttyUSB0"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="kl5kusb105d"
    ATTRS{port_number}=="0"

  looking at parent device '/devices/platform/orion-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0':
    KERNELS=="1-1.3:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="kl5kusb105d"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="03"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{modalias}=="usb:v0830p0080d0100dcFFdsc00dp00icFFisc00ip00"
    ATTRS{supports_autosuspend}=="0"

  looking at parent device '/devices/platform/orion-ehci.0/usb1/1-1/1-1.3':
    KERNELS=="1-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}==" 94mA"
    ATTRS{urbnum}=="6358"
    ATTRS{idVendor}=="0830"
    ATTRS{idProduct}=="0080"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bDeviceClass}=="ff"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="4"
    ATTRS{version}==" 1.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Palm Computing, Inc."
    ATTRS{product}=="USB Serial Adaptor"
    ATTRS{serial}=="00447582"

  looking at parent device '/devices/platform/orion-ehci.0/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="138"
    ATTRS{idVendor}=="05e3"
    ATTRS{idProduct}=="0608"
    ATTRS{bcdDevice}=="7760"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="4"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{product}=="USB2.0 Hub"

  looking at parent device '/devices/platform/orion-ehci.0/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="24"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="1"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.32-00007-g56678ec ehci_hcd"
    ATTRS{product}=="Marvell Orion EHCI"
    ATTRS{serial}=="orion-ehci.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/platform/orion-ehci.0':
    KERNELS=="orion-ehci.0"
    SUBSYSTEMS=="platform"
    DRIVERS=="orion-ehci"
    ATTRS{modalias}=="platform:orion-ehci"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

I was able to write a rule in /etc/udev/rules.d/50-udev.rules:

Code:
sheevaplug-debian:~# cat /etc/udev/rules.d/50-udev.rules | grep fronius
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="00447582", SYMLINK+="fronius"


Which gives me /dev/fronius

Code:
sheevaplug-debian:~# ls -l /dev | grep fronius
lrwxrwxrwx 1 root root           7 1969-12-31 17:00 fronius -> ttyUSB0

Now for the script. I needed to set the env variable TZ=America/Denver because a shell script executed by cron runs with limited variables, and I wanted the timestamp to be in local time.

Code:
sheevaplug-debian:~# cat fronius.sh
#!/bin/bash
TZ='America/Denver'; export TZ
/root/fslurp-0.6/fslurp -r all -d , -p /dev/fronius >> /media/sda1/fronius.log

And the crontab entry to get data once a minute:

Code:
sheevaplug-debian:~# cat /var/spool/cron/crontabs/root | grep fronius
* * * * * /root/fronius.sh

And a sample of the logfile:

Code:
sheevaplug-debian:~# tail -f /media/sda1/fronius.log
Wed May 19 16:15:01 2010,Wed May 19 16:15:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,915,3.75,244,59.98,5.37,181,12,2795,245,241,206,8.87,8349,2872,250,0,236,6080.33
Wed May 19 16:16:02 2010,Wed May 19 16:16:02 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,900,3.69,244,59.97,5.34,179,12,2795,245,241,206,8.88,8349,2872,250,0,236,6080.33
Wed May 19 16:17:02 2010,Wed May 19 16:17:02 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,892,3.64,245,59.98,5.41,179,12,2795,245,241,206,8.90,8349,2872,250,0,236,6080.33
Wed May 19 16:18:01 2010,Wed May 19 16:18:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,815,3.34,244,59.98,4.91,180,12,2795,245,241,206,8.92,8349,2872,250,0,236,6080.33
Wed May 19 16:19:01 2010,Wed May 19 16:19:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,883,3.63,244,59.99,4.97,193,12,2795,245,241,206,8.93,8349,2872,250,0,236,6080.33
Wed May 19 16:20:01 2010,Wed May 19 16:20:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,946,3.86,245,59.98,5.64,178,12,2795,245,241,206,8.95,8349,2872,250,0,236,6080.33
Wed May 19 16:21:01 2010,Wed May 19 16:21:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,1066,4.37,244,59.98,6.55,173,12,2795,245,241,206,8.97,8349,2872,250,0,236,6080.33
Wed May 19 16:22:01 2010,Wed May 19 16:22:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,1103,4.52,244,59.97,6.40,183,12,2795,245,241,206,8.98,8349,2872,250,0,236,6080.50
Wed May 19 16:23:01 2010,Wed May 19 16:23:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,1193,4.89,244,59.99,6.71,189,12,2795,245,241,206,9.00,8349,2872,250,0,236,6080.50
Wed May 19 16:24:01 2010,Wed May 19 16:24:01 2010,2,1.2.2,0x1,FRONIUS IG 3000 1-phase inverter,1240,5.08,244,59.96,7.36,179,12,2795,245,241,206,9.02,8349,2872,250,0,236,6080.50

FRONIUS IG 3000 1-phase inverter,915, is a sample of the current output in watts (yes it is snowing today in paradise!)

FWIW, Jim
 
48  Linux Stuff / General Linux questions / Setting the time & date on the guruplug on: May 17, 2010, 10:04:12 AM
When my plug booted, the time as reported by the date command always indicated Aug 8 2009.
I found this in /etc/rc/local: date 080808082009
After commenting it out, installing ntpdate,
Code:
# apt-get install ntpdate
and inserting the appropriate command into /etc/rc.local
Code:
# echo "ntpdate us.pool.ntp.org" >> /etc/rc.local
The time & date are set upon booting, except they are displayed as UTC.
running tzselect
Code:
# tzselect
allows one to change the timezone, and following directions and inserting (in my case)
Code:
# echo "TZ='America/Denver'; export TZ" >> .profile
makes it permanent. I also found in /etc/timezone: Etc/UTC, which I changed to Etc/America/Denver
Code:
# date
Mon May 17 11:01:09 MDT 2010
All is good.

HTH,
49  Hardware and U-Boot firmware / Hardware / Re: semi-dead GuruPlug: not much jtag serial output on: May 16, 2010, 04:34:05 PM
Recheck your terminal emulator settings: 115200 8N1, no flow control.
I suspect it my be the flow control.
Details here:
http://code.google.com/p/guruplug/downloads/detail?name=GuruPlug%20Server-Quick%20Start%20Guide-100507.pdf
50  Hardware and U-Boot firmware / Hardware / Re: guruplug server plus arrived... but jtag board doco anywhere? on: May 15, 2010, 01:30:07 PM
Where did you get the drivers for the jtag board from?  I could not get it to be recognized though I only tried a W7-64 machine.

I believe ftdi drivers are included with current linux distros, I'm using Mepis Linux 8.0
Here's a link to the ftdi website where you can get drivers.
http://www.ftdichip.com/Drivers/VCP.htm
51  Hardware and U-Boot firmware / Hardware / Re: guruplug server plus arrived... but jtag board doco anywhere? on: May 14, 2010, 11:55:29 AM
But im curious about whether i need to plug in both those cables just to get to the serial console?

I was able to get serial access  using the jtag board. Switch set to uart, use the uart port and 4 wire jumper to connect to the plug, and mini usb connector to computer.
I used minicom, ttyUSB0, 115200 8N1, no flow control. You can watch it boot, and then login.

HTH,

Edit: Here's a link to documentation that you were requesting.

http://code.google.com/p/guruplug/downloads/detail?name=GuruPlug%20Server-Quick%20Start%20Guide-100507.pdf
Pages: 1 2 3 [4]