e mój głupi błąd ale po wstawieniu tabulacji i tak nie działa
walcze dalej
Nie jesteś zalogowany. Proszę się zalogować lub zarejestrować.
eko.one.pl → Posty przez cyniu88
e mój głupi błąd ale po wstawieniu tabulacji i tak nie działa
walcze dalej
czy mógłby ktoś zerknąć czy ten Makefile jest ok dla helloworld'a cpp
##############################################
# OpenWrt Makefile for helloworld program
#
#
# Most of the variables used here are defined in
# the include directives below. We just need to
# specify a basic description of the package,
# where to build our program, where to find
# the source files, and where to install the
# compiled program on the router.
#
# Be very careful of spacing in this file.
# Indents should be tabs, not spaces, and
# there should be no trailing whitespace in
# lines that are not commented.
#
##############################################
include $(TOPDIR)/rules.mk
# Name and release number of this package
PKG_NAME:=helloworld
PKG_RELEASE:=1
# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
# Specify package information for this program.
# The variables defined here should be self explanatory.
# If you are running Kamikaze, delete the DESCRIPTION
# variable below and uncomment the Kamikaze define
# directive for the description below
define Package/helloworld
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Helloworld -- prints a snarky message
# DESCRIPTION:=\
If you can't figure out what this program does, \\\
you're probably brain-dead and need immediate \\\
medical attention.
endef
# Uncomment portion below for Kamikaze and delete DESCRIPTION variable above
define Package/helloworld/description
If you can't figure out what this program does, you're probably
brain-dead and need immediate medical attention.
endef
# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default. The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
#########################################################################################
# The Build/Compile directive needs to be specified in order to customize compilation
# and linking of our program. We need to link to uClibc++ and to specify that we
# do NOT want to link to the standard template library.
#
# To do this we define the LIBS variable. To prevent linking to the standard libraries we
# add "-nodefaultlibs" to the $(LIBS) variable and then specify "-lgcc -lc" to ensure that
# there are no unresolved references to internal GCC library subroutines. Finally
# "-luClibc++" to link to the uClibc++ library. Note the capital C in that flag, as
# this flag is case sensitive. Also, we need to specify "-nostdinc++"
# in the compiler flags to tell the compiler that c++ standard template library functions
# and data structures will be linked to in specified external libraries and not the
# standard libraries.
#########################################################################################
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
LIBS="-nodefaultlibs -lgcc -lc -luClibc++" \
LDFLAGS="$(EXTRA_LDFLAGS)" \
CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS) -nostdinc++" \
$(TARGET_CONFIGURE_OPTS) \
CROSS="$(TARGET_CROSS)" \
ARCH="$(ARCH)" \
$(1);
endef
# Specify where and how to install the program. Since we only have one file,
# the helloworld executable, install it by copying it to the /bin directory on
# the router. The $(1) variable represents the root directory on the router running
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
# directory if it does not already exist. Likewise $(INSTALL_BIN) contains the
# command to copy the binary file from its current location (in our case the build
# directory) to the install directory.
define Package/helloworld/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/bin/
endef
# This line executes the necessary commands to compile our program.
# The above define directives specify all the information needed, but this
# line calls BuildPackage which in turn actually uses this information to
# build a package.
$(eval $(call BuildPackage,helloworld))po dostaje komunikat
make[2]: Leaving directory `/home/cyniu/programy_c/attitude_adjustment/package/toolchain'
make[2]: Entering directory `/home/cyniu/programy_c/attitude_adjustment/package/helloworld'
Makefile:111: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
make[2]: Leaving directory `/home/cyniu/programy_c/attitude_adjustment/package/helloworld'
make[1]: *** [package/helloworld/compile] Error 2
make[1]: Leaving directory `/home/cyniu/programy_c/attitude_adjustment'
make: *** [package/helloworld/compile] Błąd 2
cyniu@debian-cyniu:~/programy_c/attitude_adjustment$ a nie ma nigdzie Taba ;/
dziwna sprawa mam 2 routery A ( gargulec 1.5.10.13 (r38093), by obsy ) i B (gargulec 1.5.2 (by arteq) (Kompil. 2011-12-28 / r29608))
adres A 192.168.2.1
adres B 192.168.2.160 WAN do LAN A
listener na B i talker na B adres: 127.0.0.1 wszystko działa
listener na A i talker na B adres: 192.168.2.1 wszystko działa
listener na B i talker na A adres: 192.168.2.160 i nie działa ale dla czego ?
Witam,
czy mógłby ktoś sprawdzić czy programy z tego kursu http://cpp0x.pl/kursy/Kurs-WinSock-C++/ … Serwer/276
działają u was na routerze ?
mam dwa routery z Gargulcem i po skompilowaniu SOCK_STREAM gada pięknie ale już SOCK_DGRAM nic nie odbiera.
czy na to ma wpływ wersja jądra openWRT ?
no daje linux embedded i potem w zestawie narzędzi gdy wybieram kompilator do daje ADI mips/amr linux generic elf
ale w sumie po chwili wszystko wraca na unknown
co jeszcze muszę podać w QT Creator poza kompilatorem mips-openwrt-linux-uclibc-gcc ze skompilowanego SDK na dany router ?
po wyborze kompilatora program się buduje jednak na openwrt nie działa
root@Gargoyle:~/test# ./program
./program: line 1: syntax error: unexpected "("
ale za to na debianie śmiga ![]()
cześć
mam takie pytanie teoretyczne, używam pod linuksem programu QT Creator czy gdyby podać mu ścieżkę kompilatora gcc openwrt z toolchaina to dało by się skompilować jakieś programy ?
hmy jeśli to chodzi o to to UPC przyznaje mi IP tylko po zmianie adresu MAC po mojej stronie czyli niby zmienne a stałe jest
u mnie nic ![]()
a wszystko działa
czy coś się zmieniło ??
zainstalowałem vim-full i po :syntax on dostaje komunikat że brak pliku syntax.vim skąd mogę go wziąć dla openwrt bo z debiana nie działa
Cześć
jak mogę automatycznie wywołać skrypt sh po zalogowaniu się do router przez ssh ?
pytanie z innej beczki.
czy to normalne ze ściągając plik przez kompa transfer to 3MB/s
aa przez wget'a max to 1,2 MB /s
moje_IP=` elinks www.mojeip.com.pl | grep -A2 Twoje | tail -n1 | sed -e 's/ //g'` przypisuje do zmiennej moje_IP numer Twojego IP a wysłanie to już jak wolisz ja wysyłam np plik na serwer FTP
poradziłem sobie inaczej adres ip Wan biorę z tego pliku /var/state/network
super i o to chodzi
a jeszcze przy okazji gdzie router trzyma adres ip Wan ?
cześć
jak z pod konsoli wyświetlić nazwy klientów podłączonych pod wifi tak jak w gui GG
iw dev wlan0 station dump
pokazuje adresy MAC jednak w GG na stronie podane są nazwy maszyn
nie ja mam w Cronie uruchamianie skryptu pobieranie.sh a w nim treść
#/bin/bash
licznik=` wc -l plik.txt |awk '{print $1}'`licznik2=0
echo $licznik
echo $licznik2
clear
echo "wybrac lokalizacje? t/n?"
read lok
echo "wybrano $lok " #clear
if [ $lok = t ]
then
echo "podaj sciezke zapisu np FTP/seriale/ "
read lokalizacja
else
echo " nie wybrano lokalizacji"
lokalizacja=FTP/fi
#clear
echo " wyslac sms'a po pobraniu plikow? t/n"
read sms
clear
echo "--------------------while--------------------------"while [ "$licznik2" != "$licznik" ]
do
licznik2=$(($licznik2+1))
echo "petla wykonuje sie po raz $licznik2 "
nazwa=`sed -n "$licznik2"p plik.txt | awk '{print $1}'`
adres=`sed -n "$licznik2"p plik.txt | awk '{print $2}'`echo $nazwa
echo $adreswget -c -O "$lokalizacja$nazwa" "$adres"
sleep 10
echo $sms
gg.sh ******* "pobralem pliki $nazwa jest to $licznik2 plik z $licznik"
done
i po pobraniu plików wysyła komunikat na GG
u mnie działa to normalnie w jednym pliku daje polecenie wget i reszta po tej linijce wykonuje się po pobraniu plików przez wget ( w moim przypadku następuje wysłanie sms )
no właśnie może nawet nie trzeba by komunikować się z Arduino tylko czy dałoby się na takiej diodzie wygenerować programowo pseudo PWM przez zapis do pliku ? czy trzeba ustawiać bezpośrednio rejestr ?Z
tak by router sterował obrotami silnika 12V
chciałbym wykorzystać 3 "ledy" do komunikacji z arduino przez własny protokół
v4.23
a widzisz o tym nie pomyślałem ale w takim razie mogę nimi "migać" w mikrosekundach a nie w sekundach jak w shell'u
?
Cześć
jest szansa dowiedzieć się jak zapalać i gasić diody z poziomu programu w C a nie z poziomu shell'a ?
chodzi o procesor ar71xx a router TL-WR740N
gdzie i jakie rejestry trzeba ustawiać albo gdzie szukać takich info ? w kodzie openWRT ?
oba Gargoyle z czego na delta Wersja Gargoyle 1.5.2 na kodzie Backfire 10.03.1 Rewizja OpenWrt r29608
tak mam ale czy można podawać hasło do ssh w skrypcie ? czy trzeba zawsze wpisywać z palca ? zależny mi na tym żeby było bez mojego udziału
Cześć,
ma pytanie o poradę/podpowiedź,
posiadam dwa routery z OpenWRT Gargoyle dla przykładu nazwijmy je Alpha i Delta
router Alpha znajduje się w mieście A a Delta w B
teraz jak uruchamiać skrypty na routerze Delta tak by uruchamiał je router Alpha ( np. Alpha jak wykryje ruch Delta włączy czerwoną lampkę )
eko.one.pl → Posty przez cyniu88
Forum oparte o PunBB, wspierane przez Informer Technologies, Inc