Show Posts
Pages: [1] 2 3 ... 13
1  Products / Arduino Yún / Re: Is it possible to use arduino YUN as modbus master and slave at same time? on: July 18, 2014, 01:21:55 pm
Assuming you have written the implementations for both Master and Slave, you then just assign each to a different serial port.

If you are asking how to write the modbus implementations I suggest downloading the Modicon Modbus Protocol Specification or visit: http://www.libstock.com/ and download my master and slave projects which include the source code written in C for PIC's.

Slave => http://www.libstock.com/projects/view/355/serial-modbus-slave
Master => http://www.libstock.com/projects/view/441/serial-modbus-master

It should be quite straight forward to port to Ardunio Yun.

Kind Regards,
Simon
2  Products / Arduino Yún / Re: jamvm out of memory on: May 12, 2014, 03:37:09 pm
Robert, author of jamvm has been helping me to resolve some of the issues I've been experiencing.  I have tested the same project on a Beaglebone Black running openJDK and it works fine.  Unfortunately it won't run on jamvm on the Yun.  Robert was saying that the Virtual Machine used by jamvm on the Yun is GNU and no longer supported.  However openJDK uses IcedTea.

At the moment I'm a bit screwed as I need a java virtual machine capable of running my project.
3  Products / Arduino Yún / Re: Anyone built RXTX for Yun? on: May 12, 2014, 02:12:47 pm
Right now I'm struggling to get it working, I've looked a the source, but I really can't see how it could work.  I have used it before on PC systems so I know it works, but I just can't see how.
4  Products / Arduino Yún / Re: Anyone built RXTX for Yun? on: May 12, 2014, 01:45:19 pm
Sorry if I'm being thick....I don't follow, what I was trying to do was run a java application on the Yun using jamvm, with RXTX native library and RXTXcomm.jar

I thought what you were saying was that I could use JSSC on the Yun as an alternative to RXTX.
5  Products / Arduino Yún / Re: jamvm out of memory on: May 12, 2014, 11:52:37 am
@sonnyyu, followed the link, not really sure what it is and  how it can help?
6  Products / Arduino Yún / Re: Anyone built RXTX for Yun? on: May 12, 2014, 11:47:52 am
Are you saying they're is an .so native library for the Yun already available?
7  Products / Arduino Yún / Re: jamvm out of memory on: May 12, 2014, 03:53:47 am
Thanks will have a go tonight.
8  Products / Arduino Yún / Re: jamvm out of memory on: May 11, 2014, 01:03:31 pm
According to the jamvm help:
-Xms is the initial size of the heap,
-Xmx, is the maxium size of the heap.
-Xss, is the stack size

Code:
Unrecognised command line option: -h
Usage: java [-options] class [arg1 arg2 ...]
                 (to run a class file)
   or  java [-options] -jar jarfile [arg1 arg2 ...]
                 (to run a standalone jar file)

where options include:
  -client          compatibility (ignored)
  -server          compatibility (ignored)

  -cp              <jar/zip files and directories separated by :>
  -classpath       <jar/zip files and directories separated by :>
                   locations where to find application classes
  -D<name>=<value> set a system property
  -verbose[:class|gc|jni]
                   :class print out information about class loading, etc.
                   :gc print out results of garbage collection
                   :jni print out native method dynamic resolution
  -version         print out version number and copyright information
  -showversion     show version number and copyright and continue
  -fullversion     show jpackage-compatible version number and exit
  -? -help         print out this message
  -X               show help on non-standard options
root@SPlatten:/opt# java -X
  -Xbootclasspath:<jar/zip files and directories separated by :>
                   locations where to find the system classes
  -Xbootclasspath/a:<jar/zip files and directories separated by :>
                   locations are appended to the bootstrap class path
  -Xbootclasspath/p:<jar/zip files and directories separated by :>
                   locations are prepended to the bootstrap class path
  -Xbootclasspath/c:<jar/zip files and directories separated by :>
                   locations where to find Classpath's classes
  -Xbootclasspath/v:<jar/zip files and directories separated by :>
                   locations where to find JamVM's classes
  -Xasyncgc        turn on asynchronous garbage collection
  -Xcompactalways  always compact the heap when garbage-collecting
  -Xnocompact      turn off heap-compaction
  -Xms<size>       set the initial size of the heap
                   (default = MAX(physical memory/64, 1M))
  -Xmx<size>       set the maximum size of the heap
                   (default = MIN(physical memory/4, 1024M))
  -Xss<size>       set the Java stack size for each thread (default = 256K)
                   size may be followed by K,k or M,m (e.g. 2M)
9  Products / Arduino Yún / Re: jamvm out of memory on: May 11, 2014, 12:44:25 pm
Sorry to say it didn't help...

http://pastebin.com/ZaPg87VN

10  Products / Arduino Yún / Re: jamvm out of memory on: May 11, 2014, 12:31:02 pm
First attempt failed, ran out of space, trying again this time 16384
11  Products / Arduino Yún / Re: jamvm out of memory on: May 11, 2014, 12:08:33 pm
After a long time with -Xms32M it finally came back with just:
Code:
Bus error

I've tried creating a swap image:
Code:
dd if=/dev/zero of=/swapfile bs=1024 count=65536

I'm still waiting for it to complete, I can see the swapfile being created in another session.
12  Products / Arduino Yún / Re: jamvm out of memory on: May 11, 2014, 07:10:12 am
Thank you, I'll give it a go, going to run application with -verbose first see if that helps uncover anything.
13  Products / Arduino Yún / jamvm out of memory on: May 11, 2014, 04:31:17 am
Having installed a simple application and run this sucessfully on the Yun using jamvm, I ten uploaded my project and ran it:
Code:
root@SPlatten:/opt# java -jar DSgateway.jar
Exception in thread "main" java.lang.OutOfMemoryError
   at java.io.InputStreamReader.read(InputStreamReader.java:379)
   at java.io.BufferedReader.fill(BufferedReader.java:370)
   at java.io.BufferedReader.readLine(BufferedReader.java:469)
   at gnu.java.util.jar.JarUtils.read_attributes(JarUtils.java:194)
   at gnu.java.util.jar.JarUtils.readMainSection(JarUtils.java:140)
   at gnu.java.util.jar.JarUtils.readMFManifest(JarUtils.java:101)
   at java.util.jar.Manifest.read(Manifest.java:162)
   at java.util.jar.Manifest.<init>(Manifest.java:89)
   at java.util.jar.JarFile.readManifest(JarFile.java:303)
   at java.util.jar.JarFile.<init>(JarFile.java:268)
   at gnu.java.net.protocol.jar.Connection$JarFileCache.get(Connection.java:99)
   at gnu.java.net.protocol.jar.Connection.connect(Connection.java:141)
   at gnu.java.net.protocol.jar.Connection.getJarFile(Connection.java:170)
   at gnu.java.net.loader.JarURLLoader.initialize(JarURLLoader.java:85)
   at gnu.java.net.loader.JarURLLoader.<init>(JarURLLoader.java:76)
   at gnu.java.net.loader.JarURLLoader.initialize(JarURLLoader.java:143)
   at gnu.java.net.loader.JarURLLoader.<init>(JarURLLoader.java:76)
   at java.net.URLClassLoader.addURLImpl(URLClassLoader.java:387)
   at java.net.URLClassLoader.addURLs(URLClassLoader.java:418)
   at java.net.URLClassLoader.<init>(URLClassLoader.java:217)
   at java.lang.ClassLoader$1.<init>(ClassLoader.java:1099)
   at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:1099)
   at java.lang.ClassLoader.defaultGetSystemClassLoader(ClassLoader.java:1084)
   at java.lang.VMClassLoader.getSystemClassLoader(VMClassLoader.java:296)
   at java.lang.ClassLoader$StaticData.<clinit>(ClassLoader.java:154)
   at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:799)

I'm not aware that I have any large memory requirements, the classes I've written don't have any large static arrays, it is likely to be really out of memory?
14  Products / Arduino Yún / Re: Testing serial port on: May 11, 2014, 03:00:01 am
Thank you, will give it a try and repeat tests now....it worked smiley

ttyUSB0 now appears.
15  Products / Arduino Yún / Re: Testing serial port on: May 11, 2014, 02:04:56 am
Before connecting:
Code:
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS13
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyATH0
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS15
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS14
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS12
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS11
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS10
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS9
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS8
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS7
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS6
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS5
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS4
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS3
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS2
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS1
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS0
crw-rw-rw-    0 0        0               0 Jan  1  1970 tty
Then  connected USB to Serial adapter and power cycled Yun, after:
Code:
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS11
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyATH0
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS15
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS14
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS13
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS12
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS10
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS9
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS8
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS7
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS6
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS5
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS4
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS3
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS2
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS1
crw-rw-rw-    0 0        0               0 Jan  1  1970 ttyS0
crw-rw-rw-    0 0        0               0 Jan  1  1970 tty
18 tty devices before and 18 after...I've tried 3 different USB to Serial adapters and the result is the same everytime.
Pages: [1] 2 3 ... 13