Programming alternatives for python

Until now I was using Python on the linino, to process data coming in at serial 1.
However, python turns out to be too inefficient/slow for the purpose.

After spending 20+ hours of investigation I still don't have the slightest clue how to continue my project. Ideally I would like to create a C++ or C program to run on the yun, but there it seems there is no clear guide anywhere to be found.

Is there anyone out here that can help me to create at least a simple example C/C++ program like 'hello world' that i can run on the Yuns Linino? I could use some help as I am stuck, between all kind of information about all kinds of toolchains, without knowing what is good information and what is not.

Next, the question remains: IF i can eventually program something in C/C++ for the yun... would it be possible to read/write serial data from/to the arduino side?

Hope that someone can help me in any way

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 ...

Here is a thread that will get you to "HelloOpenWrt" In c++ Compiling small C++ Program - #19 by noblepepper - Arduino Yún - Arduino Forum. Using a precompiled SDK is good for simple programs but anything tied tightly to kernel version needs to match the yun system requires a build root compiled to match linino.

Did you try Lua? :expressionless:

Ralf

JosAH:
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 ...

(Hey, een Nederlander! Can you perhaps contact me at denpries at gmail dot com?)

Do you perhaps have a guide you found suitable to use for setting up the system? Do you also use the serial data from the arduino part, or know if it is possible?

noblepepper:
Here is a thread that will get you to "HelloOpenWrt" In c++ Compiling small C++ Program - #19 by noblepepper - Arduino Yún - Arduino Forum. Using a precompiled SDK is good for simple programs but anything tied tightly to kernel version needs to match the yun system requires a build root compiled to match linino.

Whups! You lost me already :stuck_out_tongue: i think my main problem is that i miss the knowledge about the very basic knowledge. What exactly do you mean with 'build root compiled to match linino'? And why is a precompiled SDK not suitable in most occasions? I really miss the 'why' and 'why not' in most stories i read. Could you be so kind to elaborate and enlighten me?

Using a precompiled SDK is good for simple programs but anything tied tightly to kernel version needs to match the yun system requires a build root compiled to match linino

PCWorxLA:
Did you try Lua? :expressionless:

Ralf

No. In fact, i never heard of it, but that is my loss :stuck_out_tongue:

I quickly compared it with python
http://lua-users.org/wiki/LuaVersusPython
and come speed comparisons

However, i am a bit scared to dive into it. I rather try out java, as it is likely reslting in a higher performance anyway than lua would

Jos;-

Thank you for your recommendation of java, I tried to test Yun's enterprise application support such as oracle, db2, mssql which java is perfect fit but no luck. Can you show us some light?

Best regards,

Sonny Yu

P.S. any thing with Gnu classes is seem working fine. I tried following compiles jikes, ecj, javac.

Whups! You lost me already smiley-razz i think my main problem is that i miss the knowledge about the very basic knowledge. What exactly do you mean with 'build root compiled to match linino'? And why is a precompiled SDK not suitable in most occasions? I really miss the 'why' and 'why not' in most stories i read. Could you be so kind to elaborate and enlighten me?

No problem, the lingo of Openwrt is a bit different. OpenWrt uses a makefile system they call build root to make a cross compilation toolset, see OpenWrt's build system – About [Old OpenWrt Wiki] for all the gory details. I don't really know where the limit is that would require building the linino system I just know it is there. Linino is built on top of a fairly recent Openwrt version called Barrier Breaker, it is the "bleeding edge", the most recent "released" version is Attitude Adjustment which is what I can find the precompiled SDK for.

To evaluate if c/c++ is the route you want to go a precompiled SDK makes it easier to try. This would meet most peoples needs but when I saw I wanted to use c/c++ I built the Linino image so I don't have to worry about the compatibility issues. Here is the info on how to build linino Arduino Playground - Yun. This procedure rarely goes without problems, if all you want to do is use the tool chain to compile programs you can let it go until it bombs and the toolchain is probably functional at that point.

I think any interpretted/scripting language will be slower that c/c++ but they are a LOT easier to get set up. This is Linux, there is a few dozen ways to do anything, you need to decide which way you want to solve your problem.

@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

And to your original question,

Next, the question remains: IF i can eventually program something in C/C++ for the yun... would it be possible to read/write serial data from/to the arduino side?

Of course you can, it is just a standard serial connection, you can use standard linux techniques to use it.

JosAH:
@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

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.

sonnyyu:
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

denpries:

PCWorxLA:
Did you try Lua? :expressionless:

However, i am a bit scared to dive into it. I rather try out java, as it is likely reslting in a higher performance anyway than lua would

What is there to be scared about? I am certain it is less hassle and frustration than trying to get something done in Java.

It seems to be the go-to scripting language of OpenWRT, which is the upstream distro for Linino.

Ralf

JosAH,

I tried to create an extroot, but this already fails

tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf -

I have a micr sd mounted in /mnt/sda1. I get the following after running the command (see below)
Any idea whats going on?

root@Arduino:/# tar -C overlay -cvf - . | tar -C /mnt/sda1 -xf -
./
./
./etc/
./etc/uci-defaults/
./etc/uci-defaults/11_migrate-sysctl
./etc/uci-defaults/luci-i18n-english
./etc/uci-defaults/uboot-envtools
./etc/uci-defaults/10_migrate-shadow
./etc/uci-defaults/03_network-switchX-migration
./etc/uci-defaults/03_network-vlan-migration
./etc/uci-defaults/09_wrt160nl
./etc/uci-defaults/12_network-generate-ula
./etc/uci-defaults/02_network
./etc/uci-defaults/00_inittab-console-fixup
./etc/uci-defaults/luci-theme-bootstrap
./etc/uci-defaults/01_leds
./etc/dropbear/
./etc/dropbear/dropbear_dss_host_key
./etc/dropbear/dropbear_rsa_host_key
./etc/uhttpd.crt
./etc/uhttpd.key
./etc/inittab
./etc/config/
./etc/config/dhcp
./etc/config/luci
./etc/config/fstab
./etc/config/firewall
./etc/config/dropbear
./etc/config/ubootenv
./etc/config/network
./etc/config/ucitrack
./etc/config/system
./etc/config/uhttpd
./etc/config/wireless
': Invalid argument