Go Down

Topic: New oscilloscope for arduino (Mac only) (Read 4449 times) previous topic - next topic

Ok, I've tried with this new release but still after a while, screen freezes :(

I think to have found the problem which seems to appear on Mac but not in PC sinc eyou said it always worked on PC. When java scope scree freezes, i quit your arduino-scope.jar then relauch it & it works ok then after a while it freezes again. Looking at the structure of your arduino.pde, wether I launch or not lauch java scope, it just spools via loop() any activity coming from Mac or PC.

If you don't mind, could you send me a zip with a Mac oriented java builder script along with your java scope libraries.

Thank you

Alvaro

You only need j2sdk, ant and the git checkout.

You will need to place "rxtxcomm.jar" on a directory named "lib", inside "Java-UI".

typing "ant" on "Java-UI" directory should build the java version with no hassle.

I suspect you're either losing bytes or some kind of corruption. Maybe try with a slower baud rate ?

Álvaro

#17
Nov 22, 2009, 07:41 pm Last Edit: Nov 22, 2009, 09:06 pm by selfonlypath Reason: 1
Ok ALvaro, I've finally figured out why i could not run or find ant on my Macintosh.
Xcode developper Tools were in my Tiger DVD so I installed on my Mac.
Got many tools now and among them, ant works fine.
I just typed ant and building went succesfully with build.xml file you provided me after creating a lib directory containing RXTXcomm.jar file.

Only bad news, screen scope still freezes after a while :( I was hoping my Mac java compile version would have created a more stable jar code than the one you made via PC.

Alvaro

Try decreasing the baud rate to 57600 in both sketch and java.

If it does not freeze using 57600, then it's certainly some problem with either RXTXcomm for Mac, or bad USB cable, or bad drivers, or... anything else.

Anyway if this does not solve it, I'll implement a "retry" in java version so that it restarts sampling if arduino does not respond.

Álvaro

#19
Nov 23, 2009, 07:04 pm Last Edit: Nov 23, 2009, 07:36 pm by selfonlypath Reason: 1
Ok, i'm totally new with Xcode but i've successfully modified the sketch and java code to generate arduinsocope.jar running at 57600 baud. Now, the scope image works fine, no freezing at all :)

The double channel views works for Prescaler of 128, 64 & 32 but stops working properly at Prescaler 16 (some green & yellow pulse glitches on both views plus yellow view has incorrect low level value having in mind I generate PWM signal).

If I select single channel with Prescaler 16 & 8, it works fine but gives incorrect views with Prescaler 4 or 2.

Thank you for everything.

Alvaro

Quote
Ok, i'm totally new with Xcode but i've successfully modified the sketch and java code to generate arduinsocope.jar running at 57600 baud. Now, the scope image works fine, no freezing at all

Good. But it should handle 115k....

Quote
The double channel views works for Prescaler of 128, 64 & 32 but stops working properly at Prescaler 16 (some green & yellow pulse glitches on both views plus yellow view has incorrect low level value having in mind I generate PWM signal).


Yes. And there is not much I can do on both issues.... ;(

At prescale 16, switching channel back and forth every sample seems to have some problems (maybe the S&H circuitry of ADC). I can try another approach, but won't be hard-real-time.

Less than 16 my ISR cannot cope with ADC speed. I'm working on an optimized version (assembly) to see if it can be a bit faster.

Álvaro

Quote
Good. But it should handle 115k....

??? It is not working at 115K on my Mac because after a while it freezes so you asked to try at 57,6k which i've just done ;)

I would like to know something. Let's keep your sketch unchanged but try two ways to interface with arduino respecting your specific protocol for exchanging scope views sampled by arduino.

Method 1: your java script

Method 2: your C++ code

In both cases, arduino is sending via standard serial command so I assume both methods receive correctly such commands hence the frames of 962 samples.

Is it possible that method2 will handle or react faster than method 1 to digest the frame ? I mean, does java encapsulation tends to create extra CPU so at one point it cannot connect at high baud rate via USB port as opposed as an optimzed sofwtare running with C++ ?

Alvaro

Quote
Is it possible that method2 will handle or react faster than method 1 to digest the frame ? I mean, does java encapsulation tends to create extra CPU so at one point it cannot connect at high baud rate via USB port as opposed as an optimzed sofwtare running with C++ ?


If this was true, you'd see checksum errors in packets, which you do not. So problem lies in communication from your mac to arduino, not the other way around. Somehow the START_SAMPLING command is reaching arduino in a bad state. I don't have that problem here. I might miss some weird initialization of RXTXcomm which your mac needs, but I do not need.

Plus, 115200 baud is not that high baud rate. I can receive from arduino (not transmit though) at 200000 with not many errors.

Álvaro

Quote
It is not working at 115K on my Mac because after a while it freezes

Finally found the root cause by using arduino version 17 which provides a specific FTDI driver taking care of USB serial issues that i've run into with version 15 ;)

For iMac G5 running with Tiger (Mac OS 10.4), i've found best now to download & use (RXTXcomm.jar / librxtxSerial.jnilib) from http://rxtx.qbang.org/pub/rxtx/ - choose rxtx-2.2pre1-bins.zip version

ICPK

Hi everyone, this is my first post and I only just got my Arduino yesterday, so please bear with me:

I'm trying to get Alvaros oscilloscope running on my Intel Mac (10.6).
I've installed XCode and downloaded RXTXcomm.jar / librxtxSerial.jnilib and placed these in the Java library folder, as well as downloading arduino-oscope-snapshot-20091112.

I then compiled oscope.pde and protocol.h on the Arduino desktop and uploaded it to the Arduino.

However cannot start arduino-oscope.jar, it just seems to crash the moment you open it.

Where am I going wrong? All help appreciated!


Alvaro

Quote
However cannot start arduino-oscope.jar, it just seems to crash the moment you open it.


Hi,

does the UI show up and crashes after you select the serial port or before it ?

Can you try launching the app in a shell to see the output errors ?

Álvaro

ICPK

Hi Alvaro,

Thank you for your reply. The UI never shows up the app just crashes. I tried opening it through Terminal but it crashes there as well, however I don't know how to see the error outputs other than to check the log in control panel. From there it seems there is a problem with the RXTXcomm.jar / librxtxSerial.jnilib installation:

"26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]      Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib:  no suitable image found.  Did find:  /Library/Java/Extensions/librxtxSerial.jnilib: no matching architecture in universal wrapper
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1861)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1754)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.lang.Runtime.loadLibrary0(Runtime.java:823)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.lang.System.loadLibrary(System.java:1045)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at com.alvie.arduino.oscope.Protocol.getPortList(Protocol.java:332)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at com.alvie.arduino.oscope.ArduinoOscopeImpl.populateSerialMenu(ArduinoOscopeImpl.java:84)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at com.alvie.arduino.oscope.ArduinoOscopeImpl.createAndShowGUI(ArduinoOscopeImpl.java:128)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at com.alvie.arduino.oscope.ArduinoOscope$1.run(ArduinoOscope.java:28)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
26/04/2010 17:50:10      [0x0-0x1544543].com.apple.JarLauncher[17901]            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)"


I'll try to install from another source in the thread and see what happens, unless you have some other suggestion?

Alvaro

You sure you installed the right librxtx ? Are you using an Intel or PowerPC mac ?

Go Up