Outils pour utilisateurs

Outils du site


maison2:configuration_open_wrt:developpement_appli

langage et environnement

  • pour l'instant je choisit le langage C parce que un peux plus structuré que le shell , néanmoins dans mon design j'essayerai de maximisé les choses configurable par shell script.

donc on retrouve les package sous fred@Xubuntu:~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/package :

  • helloworld
  • openhouse
pour compiler on fait sous ~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/make V=99 à V=1

in case of ERROR: please fix package/click/Makefile
To get a more descriptive error message, enter the following from the root directory of your OpenWRT source distribution:
TOPDIR=$PWD make -C package/pkg_name DUMP=1 

ipkg install -force-overwrite openhouse_1_mipsel.ipk

openhouse: can't load library 'libstdc++.so.6'   -> installer la libstdcpp ...

script_install_wl500gp.zip on les met dans /usr/bin pour le garder en flash

création du SDK

 sdk du trunk : svn checkout svn://svn.openwrt.org/openwrt/trunk backfire
 sdk 10.03.1 : svn checkout svn://svn.openwrt.org/openwrt/tags/backfire_10.03.1
 
 make menuconfig
 make -j 4   // <your number of CPUs + 1>

debugage du SDK ar71

fred@Xubuntu 7.10 Gutsy Gibbon:

 strings /lib/libc.so.6 | grep GLIBC : GLIBC_2.0  .. GLIBC_2.6 -> il faudrait passer a une autre distri linux 
  • make menuconfig qui bloque : clean (pas d'effet), test avec sdk relocable (même problème)

test du sdk avec un package sans dépendance

svn export svn://svn.openwrt.org/openwrt/trunk/package/ncurses package/ncurses

le SDK de la 10.03.1 est moisi

dernière modification du tag 10.03.1 r29638 https://dev.openwrt.org/search?changeset=on&q=reloc&page=2&noquickjump=1 r29924 r29925 r29926,r29932,r29933,r29938,r29950,r29961 https://dev.openwrt.org/changeset/29948 ⇒ écrase la modif du patch-specs.sh r29925

conclusion

from https://forum.openwrt.org/viewtopic.php?id=35152 :

hello currently the SDK for backfire 10.30.1 get a problem of relocation (https://forum.openwrt.org/viewforum.php?id=17&p=1) applying only https://dev.openwrt.org/ticket/10822 do not solve the problem

so here a list of change set to download and merge: changeset_r29820.zip changeset_r29821.zip changeset_r29826.zip changeset_r29827.zip changeset_r29828.zip changeset_r29829.zip changeset_r29830.zip changeset_r29831.zip changeset_r29834.zip changeset_r29924.zip changeset_r29925.zip changeset_r29926.zip changeset_r29932.zip changeset_r29933.zip changeset_r29938.zip changeset_r29950.zip changeset_r29961.zip, i am pretty sure that there is too much .zip but it works.

so you unzip all from the oldest to the latest . this will give you 2 folders trunk and branches , you shall merge the 2 folders with the latest files… so in order to help you i made patch_10.03.1_sdk_reloc.zip

here is the procedure to create your SDK for 10.03.1 tag :

mkdir my_sdk_builder
cd my_sdk_builder
svn export svn://svn.openwrt.org/openwrt/tags/backfire_10.03.1
unzip patch_10.03.1_SDK_reloc.zip (force overwrite)
chmod 755 ./script/ext-toolchain.sh
chmod 755 ./script/patch-specs.sh
make menuconfig (Choose your Target System and platfrom and then [x] Build the OpenWrt SDK) -> save your config
make -j 4   //wait 1 hour on a 3 core@3,3Ghz.
 
cp ./bin/target system/your_sdk.zip /home/fred
cd ..
rm my_sdk_builder
unzip your_sdk.zip
cd your_sdk
svn export svn://svn.openwrt.org/openwrt/trunk/package/ncurses package/ncurses
make V=1

alternative au SDK forum openwrt mais je dois refaire un SDK like ...:

svn checkout svn://svn.openwrt.org/openwrt/trunk backfire
./scripts/feeds update
make defconfig
make package/symlinks
make menuconfig

make menuconfig -> check nano and libncurses
make tools/install
make toolchain/install
make target/compile
make package/ncurses/compile
make package/ncurses/install
make package/feeds/packages/nano/compile
make package/feeds/packages/nano/install
make package/index

compiling on OpenWRT router natively

dépendance de openhouse

misc

structure de donnée capteurs

temp :

  • temp real,INT100,str
  • boolean present, last present date , counter of error

humid :

  • temp,Vn,,,, :: real,INT100,str
  • boolean present, last present date , counter of error

inout(2405,2408) :

  • in/out carrier
  • state carrier
  • OFF/ON/AUTO carrier

WS2355 :

_teleinfo_ :

temps execution

N 1 : exe 1=6 us 2=909 us 3=168 us 4=85 us 5=54 us 6=2 us 7=1 us 8=60 us 9=28 us 10=229 us
N 2 : exe 1=5 us 2=585 us 3=76 us 4=7 us 5=24 us 6=2 us 7=1 us 8=43 us 9=39 us 10=47 us
N 3 : exe 1=4 us 2=581 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=48 us 10=49 us
N 4 : exe 1=5 us 2=585 us 3=76 us 4=6 us 5=25 us 6=2 us 7=1 us 8=43 us 9=59 us 10=49 us
N 5 : exe 1=5 us 2=582 us 3=75 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=69 us 10=48 us
N 6 : exe 1=5 us 2=582 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=80 us 10=48 us
N 7 : exe 1=5 us 2=580 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=90 us 10=49 us
N 8 : exe 1=5 us 2=583 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=101 us 10=49 us
N 9 : exe 1=5 us 2=582 us 3=76 us 4=6 us 5=25 us 6=1 us 7=1 us 8=43 us 9=112 us 10=49 us
N 10 : exe 1=5 us 2=583 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=122 us 10=48 us
N 11 : exe 1=5 us 2=586 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=133 us 10=48 us
N 12 : exe 1=5 us 2=581 us 3=77 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=144 us 10=48 us
N 13 : exe 1=5 us 2=583 us 3=76 us 4=6 us 5=25 us 6=2 us 7=1 us 8=43 us 9=155 us 10=49 us
N 14 : exe 1=5 us 2=581 us 3=76 us 4=6 us 5=24 us 6=2 us 7=1 us 8=44 us 9=164 us 10=49 us
N 15 : exe 1=5 us 2=583 us 3=75 us 4=7 us 5=24 us 6=2 us 7=1 us 8=43 us 9=176 us 10=48 us
N 16 : exe 1=5 us 2=582 us 3=76 us 4=7 us 5=24 us 6=2 us 7=1 us 8=43 us 9=186 us 10=49 us
N 17 : exe 1=5 us 2=582 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=196 us 10=49 us
N 18 : exe 1=5 us 2=582 us 3=76 us 4=6 us 5=24 us 6=2 us 7=1 us 8=44 us 9=207 us 10=49 us
N 19 : exe 1=5 us 2=584 us 3=76 us 4=6 us 5=25 us 6=1 us 7=2 us 8=43 us 9=217 us 10=48 us
N 20 : exe 1=5 us 2=582 us 3=76 us 4=6 us 5=24 us 6=2 us 7=1 us 8=43 us 9=228 us 10=49 us
/* TO */  gettimeofday(&tv0, NULL);
  gettimeofday(&tv, NULL); 
  curtime=tv.tv_sec; //6..5us
/* T1 */gettimeofday(&tv1, NULL);
  strftime(buffer,30,"%m-%d-%Y  %T.",localtime(&curtime)); //910..580us
/* T2 */gettimeofday(&tv2, NULL);
    my_log_file = fopen("/tmp/log_fred.txt", "a"); //168..175us
/* T3 */gettimeofday(&tv3, NULL);
    my_log_file_posix_handle = fileno(my_log_file); //85..6us
/* T4 */gettimeofday(&tv4, NULL);
    stat("/tmp/log_fred.txt" ,&statbuf); //54..24
/* T5 */gettimeofday(&tv5, NULL);  
    filesize = (long)statbuf.st_size; //2..1us
/* T6 */gettimeofday(&tv6, NULL);
    if (filesize > 15000)  //2..1us
    {  //purge file content       
       ftruncate(my_log_file_posix_handle, 0);
       printf(" overfilesize!! ");    } //90us
/* T7 */gettimeofday(&tv7, NULL);
    fprintf(my_log_file,"\r\n%s%ld : ",buffer,tv.tv_usec); //60..43us
/* T8 */gettimeofday(&tv8, NULL);
    for (lub_count = 0 ; lub_count < length ; lub_count++) fprintf(my_log_file,"%2X ",string[lub_count]); //28(2)..228(20)us
/* T9 */gettimeofday(&tv9, NULL);
    if (fclose(my_log_file)) {perror("Failed closing log file");errno=0;} //229..48us
/* T10 */gettimeofday(&tv10, NULL); 

test sur les timer (100ms) : WL500GP

openhouse is on the place ... step 3.0 
N 1 :09-28-2010 17:15:11.735055 exe = 1037 us 
N 2 :09-28-2010 17:15:11.834767 exe = 632 us 
N 3 :09-28-2010 17:15:11.934754 exe = 617 us 
N 4 :09-28-2010 17:15:12.34753 exe = 619 us 
N 5 :09-28-2010 17:15:12.134750 exe = 615 us 
N 6 :09-28-2010 17:15:12.234761 exe = 632 us 
N 7 :09-28-2010 17:15:12.334749 exe = 616 us 
N 8 :09-28-2010 17:15:12.434749 exe = 620 us 
N 9 :09-28-2010 17:15:12.534745 exe = 619 us 
N 10 :09-28-2010 17:15:12.634744 exe = 618 us 
N 11 :09-28-2010 17:15:12.734741 exe = 618 us 
N 12 :09-28-2010 17:15:12.834738 exe = 618 us 
N 13 :09-28-2010 17:15:12.934738 exe = 621 us 
N 14 :09-28-2010 17:15:13.34737 exe = 624 us 
N 15 :09-28-2010 17:15:13.134731 exe = 614 us 
N 16 :09-28-2010 17:15:13.234732 exe = 617 us 
N 17 :09-28-2010 17:15:13.334728 exe = 619 us 
N 18 :09-28-2010 17:15:13.434727 exe = 620 us 
N 19 :09-28-2010 17:15:13.534728 exe = 620 us 
N 20 :09-28-2010 17:15:13.634722 exe = 618 us

test sur les timer (100ms) le meme code mais sous xubuntu

N 1 :09-28-2010  16:44:36.150036 exe = 931 us
N 2 :09-28-2010  16:44:36.257081 exe = 61 us
N 3 :09-28-2010  16:44:36.357227 exe = 93 us
N 4 :09-28-2010  16:44:36.460045 exe = 114 us
N 5 :09-28-2010  16:44:36.569603 exe = 67 us
N 6 :09-28-2010  16:44:36.670014 exe = 106 us
N 7 :09-28-2010  16:44:36.770382 exe = 83 us
N 8 :09-28-2010  16:44:36.879419 exe = 37 us
N 9 :09-28-2010  16:44:36.982708 exe = 1068 us
N 10 :09-28-2010  16:44:37.84433 exe = 44 us
N 11 :09-28-2010  16:44:37.185471 exe = 138 us
N 12 :09-28-2010  16:44:37.285987 exe = 143 us
N 13 :09-28-2010  16:44:37.385527 exe = 29 us
N 14 :09-28-2010  16:44:37.486368 exe = 69 us
N 15 :09-28-2010  16:44:37.588239 exe = 37 us
N 16 :09-28-2010  16:44:37.692254 exe = 166 us
N 17 :09-28-2010  16:44:37.791047 exe = 64 us
N 18 :09-28-2010  16:44:37.891477 exe = 89 us
N 19 :09-28-2010  16:44:38.5380 exe = 54 us
N 20 :09-28-2010  16:44:38.115766 exe = 50

test sur les timer (100ms) exe

  gettimeofday(&tv0, NULL);
  gettimeofday(&tv, NULL); 
  curtime=tv.tv_sec;
 
  strftime(buffer,30,"%m-%d-%Y  %T.",localtime(&curtime));
  printf("%s%ld",buffer,tv.tv_usec);
  gettimeofday(&tv1, NULL);
  diff_exe = tv1.tv_usec - tv0.tv_usec;
  printf(" exe = %ld us",diff_exe);
maison2/configuration_open_wrt/developpement_appli.txt · Dernière modification: 04/2012 par fred