Show Posts
Pages: 1 [2] 3 4
16  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
17  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.
18  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 ...
19  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
20  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)
21  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.
22  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
23  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
24  Products / Arduino Yún / atmel starts python bridge process on: December 10, 2013, 11:02:56 am
Greetings,

Because my python skills are worse then rusty, I want to do the same by using Java. I installed jamvm and now Im pulling my hair out on how the Atmel side starts that python bridge process when the brudge is started on the Atmel side ...

Tips or suggestions anyone?

Kind regards,

Jos

ps . Im typing this on a darn tablet.sorry for the typos. Stupid tablets ...
25  Using Arduino / Programming Questions / Re: Base prefix notation on: May 04, 2013, 05:15:38 am
Quote
int c3=076; <--- This is troublesome
int c4=098; <--- Ahhhh!!!!!! (actually throws a compiler error!)

I don't know why it always makes me crack up, but I love this comment in the 2nd edition of K&R:
Quote
Everyone's favorite trivial change: 8 and 9 are not octal digits

So pre-ANSI, your 098 might not have thrown an error, but I have no idea what it would do.

Those old compilers (from the mid 70s of the previous century) just considered, say, 099 to be equal to 8*9+9 == 81.

kind regards,

Jos
26  International / Nederlands / Re: Leren programmeren on: April 18, 2013, 01:35:23 am
Als je dat boek wilt  kopen, let dan op dat je de tweede editie koopt; er staat 'ANSI C' op de kaft; de eerste editie komt uit de 70er jaren, nog ver voordat die taal door de standarisatiemolen ging.

vriendelijke groet,

Jos
27  International / Nederlands / Re: Leren programmeren on: April 11, 2013, 04:13:15 am
Het boek waar Rob naar verwijst lijkt heel dun, maar de bladzijden zijn ook heel dun; het is de 'bijbel' voor de C programmeertaal (zeer aan te bevelen). Bjarne Stroustup (de maker van C++) heeft 'n dergelijk boek "The C++ programming language"; er is nu 'n derde editie (of 'n vierde?) en je kunt er iemand mee doodgooien; het is 'n 'brick of a book' en het kost je wel 'n jaartje om 't helemaal door te werken en te begrijpen (<--- waarschuwing). Voor de Arduino kun je heel goed met 'alleen' C terecht ...

vriendelijke groet,

Jos
28  Using Arduino / Programming Questions / Re: Need preprocessor advice on: April 10, 2013, 04:34:24 am
Use the '#ifndef' preprocessor directive instead; it makes your (nested) conditions less convoluted.

kind regards,

Jos
29  Using Arduino / Programming Questions / Re: Boolean memory size on: March 24, 2013, 05:08:55 am
A boolean takes up one byte in C++ (zero or not zero for false/true); you can use bit fields in C/C++ that take up single bits; eight of them (one bit each) take up a single byte again.

kind regards,

Jos
30  International / Nederlands / Re: Beginnen met een Uno of een Mega? on: March 20, 2013, 08:01:02 am
Zelf heb ik 'n Arduino 2560 Mega (en ben dus zwaar bevooroordeeld ;-) maar ik vind de 8KB RAM die er in zit nog niet echt veel; als je kunt kiezen raad ik de 2560 Mega aan: lekker veel digitale pinnen (54), 16 analoge poorten, vier USB in/uItgangen, 6 timers en nog steeds veel te weinig RAM ...

vriendelijke groet,

Jos
Pages: 1 [2] 3 4