How can i send more than 48 bytes over Arduino?

Hello,

any help would be appreciated.

Project: Getting some data from Arduino via Sensors, Working with these data via simulink and sending then over UDP to some software.

Problem: I have to send 12 numbers over UDP, that means 12x 8 = 96 bytes. I have tried running the code on my PC and check on Wireshark. Every bytes get sent. But when i try running the code on simulink externaly on the Arduino, i can't receive see anything being sent over UDP (looking in Wireshark). I did some troubleshooting and noticed that i could send max 48 bytes = 8x 6 numbers per UDP on Arduino. Is there a way to change that?

Thank you.

Code?

What hardware are we talking about?

septillion,

I am just using a basic code, just using constants, converting them to bytes and sending them. There aren’t any errors. I tried sending an increasing amounts of constants and i stop receiving UDP transfers after the 7 constants. So i assumed Arduino could be limited to 48 bytes while sending data over Arduino, since my PC, sends more using the same code, not running it on the Arduino.

See attachements for examples.
The first 1 is a code running with 6 numbers (48 bytes)
The 2 lasts are the same code running with 7 numbers, but with different screenshots times.

Thank you.

pylon,

an Arduino Uno Rev. 3, Matlab+Simulink 2017a, Windows 8.1

What is the type of your variables? No commonly used type is more than 4 bytes in size.
byte/char = 1 byte.
int = 2 bytes
long = 4 bytes
float = 4 bytes
Actually most sensor values fit in 2 bytes, some need 4.

Images from Reply #3 so we don’t have to download them. See this Simple Image Guide

To_send_1.png

To_send_3.png

…R

As you can see your images are unreadable. Please don't post pictures of text. Just copy and paste the text,

And post your program.

...R

wvmarle

I would be integrating the vaues from the sensors and dividing, ..., so i chose for the example double variabes, just like displayed on the screenshots.

Robin2,

Ohhhhh, nice to know.

Robin2

the downloaded imges have higher resolutions.

On Arduinos, a double and float are the same - 4 bytes, 6-7 significant digits.

wvmarle,

ok. But my problem still percist. I will try to send 6 floats values at a time.

ok. But my problem still percist. I will try to send 6 floats values at a time.

Post the code where you do that!

an Arduino Uno Rev. 3, Matlab+Simulink 2017a, Windows 8.1

An Arduino UNO doesn't have network connectivity, so you must use some other hardware. The chips used there as well as the software used for it is relevant for this case! Provide the information we're asking for!

ylon,

Yes, i have an ethernet shield. But the data is being sent to Simulink, where it is being computated and sent via UDP (with doesn’t require the shield in the first place). In the Pictures, UDP Packets are beings sent when i use a vector of doubles values smaller than 7. For more or equal 7, not UDP packets are sent, when the code is being executed on the arduino. When i try, to send more than a 7 doubles via UDP, using the same code, but running on the PC, the packets are sent.

Attachement: The example code, i am using. (Added in a Zip file, since the Website doesn’t allow Simulink type files)

Code.zip (422 KB)

I managed to increase the amount of doubles values, i could sent via UDP on the Arduino to 8 by removing the "Pack byte" block.

AKJ:
Robin2

the downloaded imges have higher resolutions.

Perhaps.

But I don't want to clutter up my hard disk with images that are of no value to me.

Help us to help you.

...R

Apparently that (unspecified) library adds some overhead to your data.

Why don't you just use two UDP packets? Use one byte as identifier so you know which piece of information you're sending over and problem solved.

Attachement: The example code, i am using. (Added in a Zip file, since the Website doesn't allow Simulink type files)

First of all, that file is a RAR file and not a Zip (although you called it Code.zip). Then it doesn't contain any code but some pictures and *.slx file. That might be your Simulink configuration but we want to see code, the code that runs on your Arduino.

But the data is being sent to Simulink, where it is being computated and sent via UDP (with doesn't require the shield in the first place).

Bullshit. If not by the Ethernet Shield how else will the Arduino receive that UDP packets?

Which Ethernet Shield do you have? Post a link to the exact hardware you bought!