• Home
  • Help
  • Search
  • Login
  • Register
  Show Posts
Pages: [1]
1  Linux Stuff / General Linux questions / Re: How to clone a SheevaPlug? on: April 15, 2010, 07:15:20 AM

Thank you so much to everybody!
Anyway, just to let you know:

1. I used the script provided by pingtoo, just using -z instead of -J and creating a .tar.gz file containing the whole NAND filesystem.
2. I copied the rootfs.tar.gz file created in the point 1. on my USB stick, overwriting the original rootfs.tar.gz provided with the installer-1.0.
3. Following the installer-1.0 procedure, I installed the cloned filesystem coming from one sheevaplug onto another one.
4. Well done.

Many thanx to everybody, especially pingtoo and snake!
2  Linux Stuff / General Linux questions / Re: How to clone a SheevaPlug? on: April 14, 2010, 05:47:15 AM

Ok, I'm not feeling sorry anymore!  Grin


Thank you for your kind help, but it's like we are speaking different languages!  Smiley I'm understanding just a little bit of what you are telling me, and anyway I don't imagine how to replicate it using the sheevaplug! Anyway, thank you again! Smiley


Your solution seems to be the simplest one: I'll try it and post the results as soon as possible! If everything will work fine, you saved my day!
3  Linux Stuff / General Linux questions / Re: How to clone a SheevaPlug? on: April 13, 2010, 08:23:41 AM

I'm sorry if I wasn't clear: that's because of my english! Smiley
By the term "reconfigure" I intended "install the whole operating system on a brand new sheevaplug", as guessed by fragfutter.
Thank you for your kindness and sorry again!


What I'm trying to do is back-up (clone?) the whole NAND content on an USB-stick, and then clone it back on a different sheevaplug.
I understand what you says, but I don't know how to replicate in real life! Could you please be a little more specific and write down some step-by-step examples? Let's say: I used the pingtoo's script and now have my USB pen drive filled with my .tar.xz file. Now what? Smiley

Thank you both!!!
4  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: April 13, 2010, 03:52:29 AM

Found and solved the problem! Maybe it will be useful to someone else.
It was very simple!

While in basic the "print #" statement prints a string ending with a newline character, the Java .write statement doesn't! It was a simple matter to add a "\r" at the end of the string to send on the rs485 converter the correct command.

Now the system is working properly.
Contact me if you need some help!
5  Linux Stuff / General Linux questions / Re: How to clone a SheevaPlug? on: April 13, 2010, 03:48:43 AM

Very clever and interesting! Thank you for your precious help.
Next point in this topic, now, should be how to reconfigure a sheevaplug using the .tar.xz file created.
Could you please help me?

Thank you in advance!
6  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: March 15, 2010, 06:40:39 AM
So ok.
I managed the RS485 converter to work.
I'm actually writing a Java program to acquire data from my serial-connected sensors using rxtx lib.

The good news is that I can send coomands on the rs485 converter (a green blinking LED tells that the port is receiving something).
The bad news is that no data come back from the converter!

I had a basic program (written to work under a Windows system) that was working. The important part is:

open "COM9:9600,n,8,1,cs,ds,rs" for random as #dgh

for tryW = 1 to 10
        print #dgh, "$aRB"
        GOSUB  [delay]
        H$ = input$(#dgh,lof(#dgh))
        if left$(H$,1)="*" then exit for
next tryW
aa = val(mid$(H$,2,9))/100
bb = val(mid$(H$,13,9))/100
cc = val(mid$(H$,24,9))/100
dd = val(mid$(H$,35,9))/100

and similar for...next loops for the other sensors.

I'm trying to replicate this behaviour through my Java code:

String  defaultPort = "COM10";
portList = CommPortIdentifier.getPortIdentifiers();
serialPort = (SerialPort)portId.open("DataReading", 2000);
serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
outputStream = serialPort.getOutputStream();
inputStream = serialPort.getInputStream();

int available = 0, k = 0;
boolean check = true;      
for (int i=0; i<10; i++) {
   while (check) {
      available = inputStream.available();
      if (available > 0) {
         check = false;
      if (k == 100)
         check = false;
   check = true;
   k = 0;
   System.out.println("Available data: " + available);
   if (available > 0) {
      int prova = inputStream.read(byteArray, 0, available);
      System.out.println("Read: " + prova);
   } else {
      System.out.println("No data found!");

A lot of things are messing in this pseudo-code I wrote, but the point is that the ouputStream.write seems to do correctly his dirty jpb, while the instruction "inputStream.available()" constantly returns 0, even when it should find some data.

My only thought is related with the "open" command in basic:

open "COM9:9600,n,8,1,cs,ds,rs" for random as #dgh

Should I use the same parameters (cs, ds, rs) in my Java program too? How?
Or the problem is buried much deeper, probably in the way RS485 protocol should be used? Maybe I'm wrong, but in the basic code I was using nothing seems to be too hard to understand and implement in a similar Java program. The result, however, is that the basic code is working, while my Java code not!

Please, help me!
7  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: March 11, 2010, 12:22:35 PM
Thank you again for all of your efforts in helping me! I appreciate very much!

I was figuring that the problem was related with the old kernel shipped with the Sheevaplug - and I was right!
I just installed the Installer-1.0 and (after some pain!) I was able to correctly see a /dev/ttyUSB0 device.

I have installed openjdk to install my Java programs and everything is going on fine.
I'm going to use an USB HDSPA modem to upload data to a remote server, and it works very well.

Next step will be to control the RS485 port via a Java program. I'm currently using librxtx-java that seems to work fine.

@CarlMLE: I'm not able to write a complex C program, so I really need Java code (that is much simpler for me). Anyway probably you could help me again: my old acquisition software is written in basic and it mainly just open the com port, write a string on it to ask data, listen to get data (written in a string with a command like this

str$ = input$(#comport, lof(#comport))

and closes the com port. I'm trying to replicate the same behavior in my new Java program, but on the read the program hangs waiting for data. Do you have some advices, since it's my very first attempt to control a com port through a Java program? Thank you in advance!
8  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: March 08, 2010, 04:13:57 AM
Thank you for your replies!

I'm not sure I understand what dlh was telling, anyway it seems that the very first step is to have a properly working driver.
I tried to install the 1.0 Installer, but I was not lucky. Maybe I'm missing some points, but when I start the runme.exe with "nand" option, I get some informations and then everything seems to suddenly stop. I'm going to try it again, probably I will be able to have a ftdi_sio driver correctly loaded. By the way: why /proc/modules/ is empty?

Stay tuned, I'll let you know how things are going on!
9  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: March 05, 2010, 02:57:49 AM
Nobody can help me?

Anyway, I tried a different approach: i connected the converter http://www.dghcorp.com/usb/ on a laptop PC provided with Ubuntu 9.10

uname -srvmo
Linux 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:05:19 UTC 2010 i686 GNU/Linux

dmesg gave

[ 1509.896135] usb 2-2: new full speed USB device using uhci_hcd and address 3
[ 1510.092662] usb 2-2: configuration #1 chosen from 1 choice
[ 1510.099264] ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected
[ 1510.099325] usb 2-2: Detected FT232BM
[ 1510.099329] usb 2-2: Number of endpoints 2
[ 1510.099334] usb 2-2: Endpoint 1 MaxPacketSize 64
[ 1510.099339] usb 2-2: Endpoint 2 MaxPacketSize 64
[ 1510.099343] usb 2-2: Setting MaxPacketSize 64
[ 1510.101350] usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0


Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

while in /dev/ I found three devices:
  • /dev/serial/by-id/usb-FTDI_USB_TO_RS-422_485_ADAPTER_FTDYJ9MY-if00-port0
  • /dev/serial/by-path/pci-0000:00:1d.0-usb-0:2:1.0-port0
  • /dev/ttyUSB0

Finally, lsmod has detected a new module

usbserial              36264  1 ftdi_sio

I still didn't wrote any line of java code to communicate with the sensors, but I'm very confident that on the laptop I will be able to use them.
So my question is: is there a way to load the correct ftdi_sio driver in the Sheevaplug? How? Can someone out there help me providing a step-by-step (very, very verbose!) guide? I would really appreciate your efforts!
10  Linux Stuff / General Linux questions / Re: RS485 to USB - How to? on: March 04, 2010, 07:03:25 AM
Very good!

usbdev1.2etc. has suddenly disappeared and, after reconnecting the converter, dmesg says

usb 1-1: USB disconnect, address 2
usb 1-1: new full speed USB device using ehci_marvell and address 3
usb 1-1: configuration #1 chosen from 1 choice

and in /dev/ I was able to find

usbdev1.3  usbdev1.3_ep00  usbdev1.3_ep02  usbdev1.3_ep81

Does this mean that I can communicate with the converter?
11  Linux Stuff / General Linux questions / RS485 to USB - How to? on: March 04, 2010, 06:47:00 AM

I'm a quasi-newbie in Linux technical questions, so sorry for any inaccuracy! Sorry for my english, too!

I bought a Sheevaplug and I need to use it to acquire data from some sensors connected to the Sheeva's USB plug via a RS485_to_USB converter. The chip installed on the converter is a ftdi ft232bl, and the converter itself is this one: http://www.dghcorp.com/usb/ .

When I connect the converter to the USB using dmesg I got this

usb 1-1: new full speed USB device using ehci_marvell and address 2
usb 1-1: configuration #1 chosen from 1 choice

Actually I don't know:
1. if the kernel has some drivers for this kind of converter (I found some drivers for the 2.4.x kernels, but none for the 2.6.x ones);
2. which is the correct device name in /dev/ to use: I thought I was able to find a /dev/usb/ttyUSBx device, but I'm just finding some ttys and usbdev1.x [tty, tty0, tty1, ...., tty63, ttyS0, ..., ttyS3, ttyp0, ..., ttypf, usbdev1.1, usbdev1.1_ep00, usbdev1.1_ep81, usbdev1.2, usbdev1.2_ep00, usbdev1.2_ep02, usbdev1.2_ep81].

I really need some help, so I hope someone out there can give me some advices (some GOOD advices!  Smiley )!!!

Thank you in advance!
Pages: [1]