Hello, I the software lead of an FSAE team called Schulich Racing at the University of Calgary (We build a 2/3 size formula one car and compete at events). We are trying to use our mangOH to transmit vehicle data to our telemetry web application.
We have a MangOH Red with the WP8548 module. It states that its upload speed is 5.76 Mbps, but we are not able to achieve this. We currently just have the 100 MB sierra sim.
Here is what is happening:
We have a python server running on an EC2 instance which receives data from the mangOH through a C socket. We send a struct with a size of 120 bytes through the socket at 10 Hz (every 100ms). The socket tells us that the packets are being sent successfully, but some of the packets are being lost somewhere. On the python server, we only receive every third (or so) packet. When running the C code for 2 Hz (send every 500ms), there are no issues. The code looks something like this:
void send(struct Data val, int sock) {
send(sock, (struct Data*)(&val), sizeof(val), 0);
}
COMPONENT_INIT {
system("/legato/systems/current/bin/cm data connect");
int sock = 0;
struct sockaddr_in serv_addr;
while ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) {}
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons (8000);
while ( inet_pton (AF_INET, "**SERVER_IP**", &serv_addr.sin_addr) <= 0) {}
while ( connect(sock, ( struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {}
time_t startTime = clock ();
time_t check = 0;
int counter = 0;
while(1) {
check = ( float )( clock() - startTime)/CLOCKS_PER_SEC*1000;
while(check >= 100) {
struct Data val;
//READ VEHICLE DATA INTO STRUCT
sendData(val, sock);
startTime = clock();
check = 0;
}
}
}
Any suggestions would be greatly appreciated. Thank you!