Commit 7fe41b08 authored by Florian Kaltenberger's avatar Florian Kaltenberger

moving EMOS to extras


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7222 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 8119385a
\documentclass[10pt,a4paper]{article}
%\usepackage{epsfig,amsmath,amsfonts,url,subfigure,verbatim}
\begin{document}
\author{Florian Kaltenberger (\texttt{florian.kaltenberger@eurecom.fr})}
\title{EMOS Multiuser Measurement Manual}
\maketitle
\section{EMOS Multiuser Measurement Manual}
\subsection{Checklist}
Each user should have the following equipment
\begin{itemize}
\item Laptop
\item Power supply
\item Car power adaptor
\item GPS
\item CBMIMO1 Card (Availiable cards: 2, 6, 7, 11. Card 10 has a bad frequency response and card 12 crashes after some time)
\item 2 Batteries
\item Antennas
\item This Manual
\item Route and Time
\item Walkie Talkie
\end{itemize}
\subsection{Startup}
\begin{itemize}
\item Login using the name written on the laptop (password {\tt linux})
\item Power up the CBMIMO1 card, connect the antennas to the two outer connectors on the card, and insert it in the card slot
\item Connect the USB GPS receiver
\item Open a terminal window and change directory:\\
{\tt cd EMOS/emos\_gui}
\item Load the kernel module as root:\\
{\tt sudo make install\_cbmimo1\_softmodem\_emos}\\
(provide password {\tt linux} if asked)\\
The leds on the card should now be ``moving''
\item Start the GPS daemon as root:\\
{\tt sudo gpsd -f /dev/ttyUSB0} (provide password {\tt linux} if asked)
\item Start the GUI:\\
{\tt cd src}\\
{\tt ./emos\_gui -n4}
%Start with {\tt ./emos\_gui -nx}, where {\tt x} is the number of base station antennas.
\end{itemize}
\subsection{Operation}
\begin{itemize}
\item Turn on the GUI by clicking the ``PWR'' button.
\item Make sure, there are no error messages.
\item If the terminal can synchronize to the base station, the displays should turn on and the two rightmost leds on the card should stay on.
\item Bring the GUI into multiuser mode by pressing the ``terminal mode'' button.
\item Make sure you set the terminal number to the number indicated on your laptop.
\item Now you are ready to turn on the recorder by pressing ``record''. The terminal now waits for the base station to signal the recording flag. Upon receiving the flag, the terminal will record the estimated channel. When the recording flag goes off, the data is stored to file, the file index is increased, and the terminal goes into standby again.
\end{itemize}
\subsection{Troubleshooting}
\paragraph{Card does not synchronize}
Most probably you are in an area with no or too little signal.
\begin{itemize}
\item Make sure you stay on the measurement routes.
\item Make sure the antennas are connected correctly.
\item Check for other error messages on the GUI.
\end{itemize}
\paragraph{Channel displays do not refresh}
Most probably the card has crashed or there is a problem with the fifo.
\begin{itemize}
\item Stop recording and exit the GUI
\item Remove the kernel module:\\
{\tt cd ~/EMOS/emos\_gui}\\
{\tt sudo make remove\_cbmimo1\_emos}
\item Remove the card and the power
\item Load the kernel module as described above
\item Restart the GUI
\end{itemize}
\paragraph{No GPS data availiable}
\begin{itemize}
\item Make sure the GPS is connected correctly and that it can see the satelites (led on GPS constantly on)
\item Have you started the GPS daemon {\tt gpsd -f /dev/ttyUSB0}
\item Restart the GUI
\end{itemize}
\paragraph{GUI does not record or records permanently}
\begin{itemize}
\item Make sure you are in multiuser mode and you turned on record
\item Make sure there is enough disk space
\item Make sure that the record path (``config'' button) is set to ~/EMOS/data/
\end{itemize}
\paragraph{Computer freezes}
\begin{itemize}
\item Reboot
\end{itemize}
\end{document}
\ No newline at end of file
This diff is collapsed.
SRC = emos_dump.c dump_size.c
OBJ = emos_dump.o dump_size.o
CFLAGS += $(shell rtai-config --lxrt-cflags)
LDFLAGS = $(shell rtai-config --lxrt-ldflags) -lpthread -llxrt -lm -lgps -lforms
CFLAGS += -m32 -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1
CFLAGS += -DOPENAIR_LTE -DENABLE_FXP -DOPENAIR1 #-DDLSCH_THREAD -DULSCH_THREAD
CFLAGS += -DEMOS -DEXMIMO
all: emos_dump dump_size
$(OBJ): %.o : %.c
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
emos_dump: emos_dump.c
$(CC) $(CFLAGS) $(LDFLAGS) emos_dump.c -o emos_dump
dump_size: dump_size.c
$(CC) $(CFLAGS) $(LDFLAGS) dump_size.c -o dump_size
clean:
rm -rf emos_dump dump_size
rm -rf $(OBJ)
show:
@echo $(CFLAGS)
@echo $(OBJ)
beautiful:
astyle --style=gnu -s2 $(SRC)
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "gps.h"
#include "SCHED/phy_procedures_emos.h"
int main(void)
{
printf("MAX_CQI_BITS = %d;\n",MAX_CQI_BITS);
printf("PHY_measurements_size = %d;\n",sizeof(PHY_MEASUREMENTS));
printf("PHY_measurements_eNb_size = %d;\n",sizeof(PHY_MEASUREMENTS_eNB));
//printf("UCI_data_t_size = %d;\n",sizeof(UCI_DATA_t));
//printf("DCI_alloc_t_size = %d;\n",sizeof(DCI_ALLOC_t));
printf("eNb_UE_stats_size = %d;\n",sizeof(LTE_eNB_UE_stats));
printf("fifo_dump_emos_UE_size = %d;\n",sizeof(fifo_dump_emos_UE));
printf("fifo_dump_emos_eNb_size = %d;\n",sizeof(fifo_dump_emos_eNB));
printf("gps_fix_t_size = %d\n",sizeof(struct gps_fix_t));
return(0);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file emod_dump.c
* \brief reads data from a fifo and dumps it to disk
* \author F. Kaltenberger, Leonardo Cardoso
* \date 2012
* \version 0.2
* \company Eurecom
* \email: florian.kaltenberger@eurecom.fr
* \note
* \warning
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <math.h>
#include <time.h>
#include <gps.h>
#include <forms.h>
#include "SCHED/phy_procedures_emos.h"
#include "emos_dump.h"
int end=0;
static void endme(int dummy)
{
printf("SIGINT received\n");
end=1;
}
/*
#define TIMESTAMP_SIZE 8
#define PDU_ERRORS_SIZE 4
#define RX_RSSI_SIZE 2
#define COMPLEX16_SIZE 4
#define NO_OF_OFDM_CARRIERS 256
#define CHANNEL_BUFFER_SIZE (NB_ANTENNAS*COMPLEX16_SIZE*NO_OF_OFDM_CARRIERS+TIMESTAMP_SIZE+PDU_ERRORS_SIZE+RX_RSSI_SIZE) //in bytes
*/
#define NO_ESTIMATES_DISK 100 //No. of estimates that are aquired before dumped to disk
int main (int argc, char **argv)
{
char c, eNB_flag=0;
char *fifo2file_buffer, *fifo2file_ptr;
int fifo, counter=0, bytes;
FILE *dumpfile_id;
char dumpfile_name[1024];
time_t starttime_tmp;
struct tm starttime;
int channel_buffer_size;
time_t timer;
struct tm *now;
struct gps_data_t *gps_data = NULL;
struct gps_fix_t dummy_gps_data;
while ((c = getopt (argc, argv, "he")) != -1) {
switch (c) {
case 'e':
eNB_flag=1;
break;
case 'h':
printf("EMOS FIFO to file dump.\n");
printf("Usage: %s -h(elp) -e(NB) (default=ue)\n",argv[0]);
exit(0);
default:
break;
}
}
timer = time(NULL);
now = localtime(&timer);
memset(&dummy_gps_data,1,sizeof(struct gps_fix_t));
gps_data = gps_open("127.0.0.1","2947");
if (gps_data == NULL) {
printf("Could not open GPS\n");
//exit(-1);
}
#if GPSD_API_MAJOR_VERSION>=4
else if (gps_stream(gps_data, WATCH_ENABLE,NULL) != 0)
#else
else if (gps_query(gps_data, "w+x") != 0)
#endif
{
//sprintf(tmptxt,"Error sending command to GPS, gps_data = %x", gps_data);
printf("Error sending command to GPS\n");
//exit(-1);
}
if (eNB_flag==1)
channel_buffer_size = sizeof(fifo_dump_emos_eNB);
else
channel_buffer_size = sizeof(fifo_dump_emos_UE);
// allocate memory for NO_FRAMES_DISK channes estimations
fifo2file_buffer = malloc(NO_ESTIMATES_DISK*channel_buffer_size);
fifo2file_ptr = fifo2file_buffer;
if (fifo2file_buffer == NULL) {
printf("Cound not allocate memory for fifo2file_buffer\n");
exit(EXIT_FAILURE);
}
if ((fifo = open(CHANSOUNDER_FIFO_DEV, O_RDONLY)) < 0) {
fprintf(stderr, "Error opening the fifo\n");
exit(EXIT_FAILURE);
}
time(&starttime_tmp);
localtime_r(&starttime_tmp,&starttime);
snprintf(dumpfile_name,1024,"%s_data_%d%02d%02d_%02d%02d%02d.EMOS",
(eNB_flag==1) ? "eNB" : "UE",
1900+starttime.tm_year, starttime.tm_mon+1, starttime.tm_mday, starttime.tm_hour, starttime.tm_min, starttime.tm_sec);
dumpfile_id = fopen(dumpfile_name,"w");
if (dumpfile_id == NULL) {
fprintf(stderr, "Error opening dumpfile\n");
exit(EXIT_FAILURE);
}
signal(SIGINT, endme);
printf("starting dump, channel_buffer_size=%d ...\n",channel_buffer_size);
while (!end) {
bytes = rtf_read_all_at_once(fifo, fifo2file_ptr, channel_buffer_size);
/*
if (eNB_flag==1)
printf("eNB: count %d, frame %d, read: %d bytes from the fifo\n",counter, ((fifo_dump_emos_eNB*)fifo2file_ptr)->frame_tx,bytes);
else
printf("UE: count %d, frame %d, read: %d bytes from the fifo\n",counter, ((fifo_dump_emos_UE*)fifo2file_ptr)->frame_rx,bytes);
*/
fifo2file_ptr += channel_buffer_size;
counter ++;
if (counter == NO_ESTIMATES_DISK) {
//reset stuff
fifo2file_ptr = fifo2file_buffer;
counter = 0;
//flush buffer to disk
if (eNB_flag==1)
printf("eNB: count %d, frame %d, flushing buffer to disk\n",
counter, ((fifo_dump_emos_eNB*)fifo2file_ptr)->frame_tx);
else
printf("UE: count %d, frame %d, flushing buffer to disk\n",
counter, ((fifo_dump_emos_UE*)fifo2file_ptr)->frame_rx);
if (fwrite(fifo2file_buffer, sizeof(char), NO_ESTIMATES_DISK*channel_buffer_size, dumpfile_id) != NO_ESTIMATES_DISK*channel_buffer_size) {
fprintf(stderr, "Error writing to dumpfile\n");
exit(EXIT_FAILURE);
}
if (gps_data) {
if (gps_poll(gps_data) != 0) {
printf("problem polling data from gps\n");
} else {
printf("lat %g, lon %g\n",gps_data->fix.latitude,gps_data->fix.longitude);
}
if (fwrite(&(gps_data->fix), sizeof(char), sizeof(struct gps_fix_t), dumpfile_id) != sizeof(struct gps_fix_t)) {
printf("Error writing to dumpfile, stopping recording\n");
exit(EXIT_FAILURE);
}
} else {
printf("WARNING: No GPS data available, storing dummy packet\n");
if (fwrite(&(dummy_gps_data), sizeof(char), sizeof(struct gps_fix_t), dumpfile_id) != sizeof(struct gps_fix_t)) {
printf("Error writing to dumpfile, stopping recording\n");
exit(EXIT_FAILURE);
}
}
}
}
free(fifo2file_buffer);
fclose(dumpfile_id);
close(fifo);
return 0;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#define CHANSOUNDER_FIFO_DEV "/dev/rtf3"
This diff is collapsed.
gps_trace: gps.c
gcc gps.c -Wall -g -I/usr/include/X11 -lgps -lforms -o gps_trace
read_iw: read_iw.c
gcc read_iw.c -Wall -g -o read_iw
\ No newline at end of file
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <gps.h>
#include <forms.h>
struct gps_data_t *gps_data = NULL;
struct gps_fix_t dummy_gps_data;
FILE *dumpfile_id = NULL;
void gps_data_callback(int gps_fd, void* data)
{
//char tmptxt[1024];
time_t timer;
struct tm *now;
timer = time(NULL);
//printf("GPS timer called\n");
if (gps_data) {
if (gps_poll(gps_data) != 0) {
//sprintf(tmptxt,"Error polling data from GPS, gps_data = %x", gps_data);
printf("Error polling data from GPS\n");
} else
now = localtime(&timer);
printf("%04d%02d%02d%02d%02d%02d,%g,%g\n",
now->tm_year+1900,now->tm_mon+1,now->tm_mday,now->tm_hour, now->tm_min, now->tm_sec,
//asctime(localtime(&timer)),
gps_data->fix.latitude,gps_data->fix.longitude);
}
//fl_set_timer(ob, 0.05);
//write GPS
if (gps_data) {
if (fwrite(&(gps_data->fix), sizeof(char), sizeof(struct gps_fix_t), dumpfile_id) != sizeof(struct gps_fix_t)) {
printf("Error writing to dumpfile, stopping recording\n");
}
} else {
printf("WARNING: No GPS data available, storing dummy packet\n");
if (fwrite(&(dummy_gps_data), sizeof(char), sizeof(struct gps_fix_t), dumpfile_id) != sizeof(struct gps_fix_t)) {
printf("Error writing to dumpfile, stopping recording\n");
}
}
}
void stop_gps(int sig)
{
// stop gps
if (gps_data)
fl_remove_io_callback(gps_data->gps_fd, FL_READ , &gps_data_callback);
// close the GPS
if (gps_data)
gps_close(gps_data);
fclose(dumpfile_id);
dumpfile_id = NULL;
fl_finish();
exit(0);
}
int main(int argc, char *argv[])
{
time_t timer;
char log_filename[256], date_str[128];
struct tm *now;
timer = time(NULL);
now = localtime(&timer);
// open GPS
gps_data = gps_open("127.0.0.1","2947");
if (gps_data == NULL) {
printf("Could not open GPS\n");
exit(-1);
} else if (gps_stream(gps_data, WATCH_ENABLE,NULL) != 0) {
//sprintf(tmptxt,"Error sending command to GPS, gps_data = %x", gps_data);
printf("Error sending command to GPS\n");
exit(-1);
}
strftime(date_str, 128, "%Y%m%d_%H%M%S", now);
sprintf(log_filename,"gps_trace_%s.log", date_str);
dumpfile_id = fopen(log_filename,"w");
if (dumpfile_id == NULL) {
printf("Error opening dumpfile\n");