Pages: [1] 2   Go Down
Author Topic: Anybody know the character limits when writing via the "Bridge"?  (Read 2695 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all!

I'm creating a morse code machine, basically the Yun is hooked up to a morse key and sounder, and you can use the morse key to write a message. The Arduino side of things listens for the key to be pressed, and basically does a really simple task of recording the length (time) of the presses as well as the length (time) of the pauses between presses.

After a delay of lets say 10 seconds, the Arduino stops listening for input and takes the string of pauses/presses and sends them to the Linux side via the Bridge.put() method.

The problem I'm running into is that the data can actually be pretty sizable. I'm doing all of the encoding of the morse on the server side (I want to be able to get the "raw" input values so I can graph them, amongst other things), so I send all of the lengths. So the letters "TTTN" for instance become "0b52a1b151a0b49a1b168a0b210a1b216a0b106a1b76a0b0".

Now, I've been able to send some messages with as many as 240 characters (possibly more, that's not an EXACT count), but soon after that I hid a wall and something (not sure exactly where) fails.

So, all of this is to ask: does anybody know what sort of character length limits live within the Bridge library? Or within the String object itself?

Any tips?

Thanks all!
<3
Logged

Offline Offline
Edison Member
*
Karma: 38
Posts: 1245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not aware of any limits but memory related. The 32u4 has just 2.5 Kbytes of SRAM while the ar9331 has 64Mbytes
The wall you hit, how did it look like? ( = what problem are you experiencing? losing data?)
Logged

Have you upgraded the Yún? If you've just got it, then it needs to be upgraded! Check out the tutorial

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply! Much appreciated smiley

I guess it is perhaps not a character limit of Bridge itself... I recorded a video where I demonstrate the issue I'm having:



Thanks again for any help! And sorry if the video is a bit boring...
Logged

Offline Offline
Edison Member
*
Karma: 38
Posts: 1245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank for your video, can you also attach the sketch? Makes it easier to play with it, just in case
Logged

Have you upgraded the Yún? If you've just got it, then it needs to be upgraded! Check out the tutorial

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I was going to do that but forgot!

Everything is in github:
https://github.com/develpr/morseling

A direct link to the sketch itself is here:
https://github.com/develpr/morseling/blob/master/morseling.ino

The Python code is here:
https://github.com/develpr/morseling/tree/python


Thanks again for any help!!!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, so I've improved/simplified that data that is passed, so I have managed to get a few more characters over, but I still don't understand why things seem to be "crashing" when I seem to have plenty of memory left.

Any ideas would be very very much appreciated!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi shoelessone,
This is a tangential question: how did you make that video of your issue?
Thanks!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi shoelessone,
This is a tangential question: how did you make that video of your issue?
Thanks!

Actually I just used QuickTime Player - basically the built in version of QuickTime that comes with OSX.

If you've got a mac, you can open QuickTime and click file -> new screen recording and that's pretty much it.

I also encoded the video using Handbrake (http://handbrake.fr) to make it a bi (TONS) quicker to upload to youtube, hence the semi-poor quality of the video itself.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I improved my "encoding" (which is way too fancy of a word for what I'm doing smiley), but am still confused/curious about why things might be failing.

To summarize (I'm going to make these numbers up here, for a better idea check out the video smiley), I can use Bridge to send 200 characters from the Linux side to the Arduino without an issue, and with ~900b of memory left. I can also use Bridge to send 400 characters fro the Linux side to the Arduino side, without an issue, with say ~700b of memory left, BUT if I try to send 600 characters across then the arduino side seems to "crash" or something along those lines. Things come back after a while, but the code that should read the characters and spit out the free memory is never run.

Again the video probably demonstrates this a lot better, but I understand people may not want to waste 15 minutes of their lives watching it smiley-wink

Thanks again for any help! <3
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am seeing similar behaviour. I wrote a very simple test to see at what message length things start to crash:

  • the Linino puts random characters using key1  (then waits 3 seconds)
  • the Sketch side gets on key1, and puts the same message on key2 (should happen in the 3 seconds)
  • the Linino gets on key2 and compares with what it had put on key1. If OK, it restarts with a longer message. If it fails it tries another get.


At a message length of 266 (always that length) it seems to FAIL, hereby the resulting script output:

Code:
Trying length 262
put AZORBF9S9C8E1V2YR531TS4GOFRN5YHOLCI5T7KAP1E6SLVH3UPK4SVABTLB7RC80JTCHBPEZHK5ZFE183G5GMHHD552DUBTKJD2PPTU5VANVBHFANI01SIDCEK2PN88REU7V0RJX0T0PS8JPDJX988PBF78Y37XYWHHBOL0FGCZ7AXJPXFKF0MKUH5I2EN89EAN1I9NPWEYVKB5DWCL7NWKTDBDXHQ62MCOOHP348SGNO2J5LPHW8TFVAW9E913T9UGN7
got AZORBF9S9C8E1V2YR531TS4GOFRN5YHOLCI5T7KAP1E6SLVH3UPK4SVABTLB7RC80JTCHBPEZHK5ZFE183G5GMHHD552DUBTKJD2PPTU5VANVBHFANI01SIDCEK2PN88REU7V0RJX0T0PS8JPDJX988PBF78Y37XYWHHBOL0FGCZ7AXJPXFKF0MKUH5I2EN89EAN1I9NPWEYVKB5DWCL7NWKTDBDXHQ62MCOOHP348SGNO2J5LPHW8TFVAW9E913T9UGN7
OK
Trying length 263
put DA4VIB5FV9B8K669U3POPSNQHO1U8NI3JWLBG1LW9YW9028ME309HHPCGW39ZQZQYJ43TIVN367MIIX8N74RPS45V3TFSBX5ZIQGO8FDTP40B10X7A7CLJ3DOGZMDSHNO6V4WWRN1WHAR3GHA094UQ69OKYN46GENJG77C8E322DC16Q3SOTQ5PWE12QD7LOF450ZU5ZUFTLJZCZCL5TA5MBGUCYIEQS9W02F5K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K5NMF91026XV2BE9FS1PQPW93CUY4QDOUA29KI
FAIL
got WY8XFBQL8ND0WMVVE1TU409M90YJXC2VMUAD6FSVFUNWD112NPD5ZP389X7SNOIF6D6Z46EY1Z2NBL3I46244MF88NBPGRUIRREXZWZBS5TFI4XMBZXZVIUR2VLYV9FSHBCMWWQ23TNQ8229RKFWX3Q27APKLWCLP80IDVH0NNQU4HJF2DPG3RN1EYH3FGUFHDS2SH34JH34TITEPPA9IB7QWXV7AMEMNXBK5NMF91026XV2BE9FS1PQPW93CUY4QDOUA29KI
FAIL

From that length on it seems the datastore is no longer updated from the Sketch side....possibly it crashed. When resetting the Sketch side things work again.

If anyone is interested, you can find the scripts I used here http://myyafa.blogspot.be/2013/11/bridge-communication-part1.html

Quote
and with ~900b of memory left

As a side question: how did you find out how many free memory you have?

I was also wondering, if instead of a memory problem, it could be caused by a time-out somewhere?
« Last Edit: November 16, 2013, 06:57:16 pm by NewLine » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was also wondering, if instead of a memory problem, it could be caused by a time-out somewhere?
Hm, Bridge is more on the slower site. So maybe. Have you made tests using more that 3s waiting time?
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried with different time delays on both sides. Didn't make a difference. As you can see, the data store just doesn't update.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


As a side question: how did you find out how many free memory you have?

I was also wondering, if instead of a memory problem, it could be caused by a time-out somewhere?

Thank you SO much for replying here! This is driving me crazy, and it sounds like you are having a similar issue!

The memory question: I'm using a library called "FreeMemory" (or maybe it's called AvailableMemory, I don't know): http://playground.arduino.cc/Code/AvailableMemory - see the sketch lines 142/143.

https://github.com/develpr/morseling/blob/master/morseling.ino#L142,L143


Your testing strategy is great by the way. If it really is a 266 character limit of some sort suppose I could always split up the data into multiple "buffers" or whatever and use Bridge to chain them together, it's just a bit of a pain.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any luck NewLine?

I've started implementing a buffer, but it's a bit of a pain smiley-sad
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I abandoned using "long" messages, and will also send them in smaller parts.
Logged

Pages: [1] 2   Go Up
Jump to: