Show Posts
Pages: 1 [2] 3 4 5
16  Products / Arduino Yún / Re: Java on: February 26, 2014, 05:42:18 am
I stored the following one-liner 'java' script in the same directory where the jamvm executable file is stored:

exec jamvm -Xbootclasspath:/opt/usr/share/jamvm/classes.zip:/opt/usr/share/classpath/glibj.zip $1 $2 $3 $4 $5 $6 $7 $8 $9

the path /opt is a symbolic link to /mnt/sda1/opt where the entire shebang is stored on my sd card. As a convenience this allows my to do: 'java MyClass', without that horrible command line needed for jamvm.

kind regards,

Jos
17  Products / Arduino Yún / which major/minor device numbers? on: February 25, 2014, 08:18:42 am
Greetings,

I want to hook up a simple serial device to the master USB port; I read that openwrt doesn't dynamically create an interface in /dev, so I want to mknod c <major> <minor> ttyUSBx but what are the <major>  and <minor> device numbers supposed to be?

In /dev//bus/usb/001 I find this:

crw-r--r--    1 root     root      189,   0 Feb 25 14:07 001
crw-r--r--    1 root     root      189,   1 Feb 25 14:07 002
crw-r--r--    1 root     root      189,   2 Feb 25 14:07 003

... so I guess that the <major> device number is supposed to be 189, but the moment I connect my simple serial device a new entry is created in the directory mentioned above.

I have the following USB modules installed:

kmod-usb-acm - 3.8.3-1
kmod-usb-core - 3.8.3-1
kmod-usb-storage - 3.8.3-1
kmod-usb2 - 3.8.3-1
libusb-1.0 - 1.0.9-1
libusb-compat - 0.1.4-1
usbutils - 006-1

So, basically, my question is: what are the <major> and <minor> device numbers supposed to be? (and does the name of the interface really matter?)

kind regards,

Jos
18  Products / Arduino Yún / Re: Programming alternatives for python on: February 23, 2014, 05:02:28 am
I try to use JDBC but failed.  Oracle support  latest Java SE Embedded version 7 Update 51  for ARMv5, ARMv6/ARMv7, ARMv7 only. I will try Arduino TRE once it is available.

I was afraid of that; Java support for the MIPS processor(s) is lousy; the only alternative I found was jamvm and the Gnu classes ... I'm also curious about the 'official' Java implementation for the ARM processor(s).

kind regards,

Jos
19  Products / Arduino Yún / Re: Programming alternatives for python on: February 21, 2014, 09:48:34 am
@sonnyyu & denpries; jamvm implements quite an old version of the JVM (version 1.5) but the biggest burden are the Gnu classpath classes: they're incomplete and have quite a few bugs all over the place; they can be fixed of course or 'programmed around' them (I did the latter). My Java stuff acts as the 'other' side of a bridge, so it must be started by the Atmega and System.in/out/err are 'automagically' coupled to /dev/ttyATH0; on the AtMega side it's simply the Serial1 stream ...

I don't know if those 'big' databases run on that Java configuration; have you tried Derby/JavaDB? It comes bundled with the JavaSE 1.6 distribution (it's all written in Java itself).

kind regards,

Jos
20  Products / Arduino Yún / Re: Programming alternatives for python on: February 20, 2014, 08:31:16 am
I use java (the jamvm jvm with the Gnu 'classpath' classes); java has many benefits over plain C/C+ and its pretty fast.

kind regards,

Jos

ps. if you install it on /mnt/sda1, make sure the disk is formatted as an ext2/3/4 filing system because the jamvm wants to create a couple of symbolic links ...
21  Products / Arduino Yún / Re: Using Serial and Bridge at the same time on: February 15, 2014, 08:23:15 am
I´m showing my stupidity here, I´m sure, but if the two processsors can ommunicate over Serial1/-dev/ttyATH0, what´s the use for a second line?

kind regards,

Jos
22  Products / Arduino Yún / Re: Using Serial and Bridge at the same time on: February 14, 2014, 02:24:59 am
@mamu: that article mentions the driver but doesn't supply a link; do you happen to know where/how  it can be downloaded/installed? Thanks.

kind regards,

Jos
23  Products / Arduino Yún / Re: usb problem on: February 05, 2014, 02:00:01 pm
I guess I'm out of luck then, i.e. I need the communication connection between the two processors (Serial1 <--> /dev/ttyATH0) but I can't connect my GPRS device to the AtMega processor through its Serial object. hm, I may have to use a SoftSerial object but I lose two pins, so I have to sacrifice a few other devices because now I don't have any pins left ...

thanks for thinking with me; much appreciated and

kind regards,

Jos
24  Products / Arduino Yún / Re: usb problem on: February 05, 2014, 11:16:46 am
Allow me to explain my configuration: after the Linux (Linino) side has
booted, a Java program is started (jamvm) and its System.in and System.out
streams are hooked up to /dev/ATH0; before that program starts I set the
connection to 'raw' mode. On the AtMega side I read from the Serial1 object,
process the command and send back the reply (I have a dedicated sketch running
on the AtMega side).

If I kill jamvm I can still write commmands to /dev/ATH0 and read replies
from it by using the shell; everything works fine, similar as the 'bridge'
(I peeked in the Python code for details ;-)

On the AtMega side I implemented two simple commands to read from the Serial
object and write to it. As far as I know, the Serial object is connected to
the other USB bus (see that little connector). I want to connect a simple
GSM (GPRS) device that only speaks serial. I can use it by using the
SoftSerial class, but I don't have any pins left on the AtMega side ...

In short I want to do this:

Serial: communication between the AtMega and the GSM device;
Serial1: communication between the AtMega and the Linux (Linino) side.

The second part works fine but the first part is a show stopper so far ...

kind regards,

Jos

ps. I use Java because I get so much functionality for free in that language.
25  Products / Arduino Yún / usb problem on: February 05, 2014, 06:32:31 am
Greetings,

this is the scenario: the Atmega of my Yun has all of its pins used, except for its external usb bus (the Serial object); the Atmega is controlled by the Atheros Linux side processor. All works fine, even when I hook up the ide serial monitor from the IDE; I can see that the Atmega writes and reads fine to/from the Serial object. I want to connect the usb bus to a small device that has two serial lines, but it doesn't work; after reading this: http://en.wikipedia.org/wiki/USB_On-The-Go I think I understand why; one reason is that I supply power through that same usb bus and it makes the Atmega think it is the 'slave' side of the usb bus (while it isn't in my configuration).

I'm a math guy so I know nothing about hardware (I even leave the soldering to my brother ;-) the current usb configuration doesn't work (for obvious reasons) but I don't know how to make it work (i.e. make the Atmega communicate through its Serial object with the other device). Any help is appreciated (by my brother as well ;-)

kind regards,

Jos

ps. I added a usb/ttl converter between the Atmega and the other device. Both the Atmega and the other device communicate fine  with my laptop ...
26  Products / Arduino Yún / Re: Install packages on SD card with Arduino Yun on: January 26, 2014, 04:51:00 am
Add a line like this: 'dest disk /mnt/sda1' to your /etc/opkg.conf file and you can specify 'disk' as your installation directory; note that your disk needs to be formatter as an ext2 or ext3 filing system if the installed stuff wants to create soft links (FAT doesn't support soft links).

kind regards,

Jos
27  Products / Arduino Yún / Re: atmel starts python bridge process on: December 15, 2013, 01:50:29 pm
Could you please elaborate on what you meant by "I had to install the 'stty' package"?

Of course, I'm sorry, but my IE11 refused to display the forum pages after I logged in (stupid IE stuff ...) The serial1 line is treated full duplex, i.e. what one party sends is send back by the other party and the behaviour confused my simple Java bridge; Java doesn't have any ioctl so I had to set the line to -echo and raw mode in a shell script (that starts javmvm afterwards); the script also sets the line back to echo and sane mode afterwards; I had to install (opkg) the coreutils-stty package for it.

kind regards,

Jos

ps. My laptop is running Chrome now; I got sick and tired of that silly little tablet (my IE11 browser completely goofed, and all I had was my old Linux laptop (it's upstairs) and that silly tablet)
28  Products / Arduino Yún / Re: atmel starts python bridge process on: December 15, 2013, 12:35:45 pm
Nice one Jos, do you have source code to share?

Not yet really, the mechanism works ie the Atmel can start jamvm with my jar file and my java code can pass a few sample commands back to the Atmel side.  My bridge version pushes simple requests to the Atmel side, reads back the reply and sends it back to its TCP connection. The Atmel cant really push messages to the Java bridge (yet). I use the Atmel processor as a dumb device driver ....

Kind regards,

Jos

Ps sorry for the typos, Im typing this on a silly tablet again.
29  Products / Arduino Yún / Re: atmel starts python bridge process on: December 13, 2013, 07:56:13 am
It sets its streams to raw mode (I don't know why yet).

Because the 32u4 and linux sides of the Bridge speak a binary protocol, in order to transfer less bytes and make it faster

While the Atmel processor can send and receive any possible byte values, it is 'ruined' by the Python layer that treats any '\0' value as an end of C string (also see a recent post by user NewLine).

It would be very nice to see a java implementation of the Bridge. Remind that some of that machinery is needed because by default that Serial is used by linux to print its debug messages: that adds noise to the communication and the Bridge filters that out.
There are threads where users have disabled those debug messages (search the forum for "inittab") hence removing the noise

I haven't seen any debug messages passing by at all; I tested the communication layer of my Java attempt of a Bridge and the Linux OS was completely silent. I had to install the 'stty' package to make the terminal line shut up and not echo anything at all (stty -echo raw) and everything works fine now: everything send/received from Serial1 on the Atmel side arrives on the Linux Java side as System.in/System.out. Java can't do any ioctl, that's why I had to install the stty package.

The communication is quite fast: at 250000 baud more than 5000 bytes/second can be send/received correctly (without any CRC calculations)

kind regards,

Jos
30  Products / Arduino Yún / Re: atmel starts python bridge process on: December 11, 2013, 04:23:10 am
I would start by looking at
          void BridgeClass::begin()

in the Bridge.cpp class

Personally I think if it is just because you don't know Python that well, it would be less work to call the couple of Python things from within Java (I assume you can do so).

Thanks for the tip; and you're right: I haven't programmed in Python for years, that's why I want to do it in Java. That jamvm looks promising. I did some further reading on both sides: the Linux side already has a shell running on that serial line. On the Atmel side it is known as Serial1; all the Bridge object does is make the Linux side start up a run-bridge process (a shell script in /usr/bin); the script starts up Python that reads and writes from/to its stdin/stdout streams. It sets its streams to raw mode (I don't know why yet).

Replacing the entire machinery by java should be easy (I don't need all that functionality because I want to use the Atmel as a 'slave' unit that just does the hardware fiddling, orchestrated by the Linux side).

kind regards,

Jos
Pages: 1 [2] 3 4 5