Strona 6 z 6

Re: FOTA

: pn lis 19, 2018 5:55 pm
autor: lesny8
Z logu na bazie widać, że moduł próbował zrobić aktualizację, zapisał czas, swoje id i parametry z jakimi szukał
Być może, wgrałeś wersje do modułu z innym kluczem i nie przechodzi walidacji, albo w ogóle nie pobiera pliku, jeśli dioda nie mruga, bo nie znajduje wpisu, albo ma problem z rozwiązaniem nazwy.
Musisz sprawdzić wszystko dwa razy. Sprawdź wygenerowane klucze, czy czasem sobie nie nadpisałeś. Sprawdź rsa_public_key_bytes.

Najlepiej to zacznij od nowa.
Przejrzyj plik supla_update.c i zdejmij komentarz z każdego supla_log, możesz również wewnątrz każdej funkcji dodać własny log. Zapisz zmiany, skompiluj i wgraj do modułu, uruchom terminal i nasłuchuj.
Aha i wersja w supla_esp.h ma być "2.7.2". W tabeli esp_update będzie "2.7.3".

Skompiluj user1 i user2, podpisz kluczem z właściwej pary i wyślij na serwer www.

Zaloguj się do modułu w trybie konfiguracyjnym przestaw FirmwareUpdate=YES i zapisz. 1x Cfg lub restart modułu.
Obserwuj co się będzie pojawiało w terminalu, jakie logi dostaniesz, na pewno się wyjaśni.

Re: FOTA

: wt lis 20, 2018 10:43 am
autor: kris.sg
Dzięki @lesny8 za pomoc już fota pięknie działa
problemem była literówka :)
w bazie w pozycji device_name miałem wpis "gniazdko_neo", a moduł miał nazwę "gniazdko neo"

pozdrawiam
Krzysiek

Re: FOTA

: czw maja 16, 2019 2:45 pm
autor: Esteta
Cześć,

może to głupie pytanie, ale czy plik "user1" wgrywamy po kablu podpisany czy nie (czy obojętne ) ?
Rozumiem, że w celu aktualizacji kompilujemy i wrzucamy na www ob podpisane pliki?

Coś nie mogę tego ogarnąć :(

Re: FOTA

: czw maja 16, 2019 5:07 pm
autor: lesny8
Tak. Do modułu po kablu wygrywamy nie podpisany user1.

Tak. Na www wypychamy oba podpisane pliki.

Re: FOTA

: śr wrz 25, 2019 6:33 am
autor: Esteta
Czy na bazie robimy coś jeszcze?
Gdyby nie było, ja już miałem

Code: Select all

DELIMITER $$
--
-- Procedures
--
DROP PROCEDURE IF EXISTS `supla_get_device_firmware_url`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `supla_get_device_firmware_url` (IN `device_id` INT, IN `platform` TINYINT, IN `fparam1` INT, IN `fparam2` INT, IN `fparam3` INT, IN `fparam4` INT, OUT `protocols` TINYINT, OUT `host` VARCHAR(100), OUT `port` INT, OUT `path` VARCHAR(100)) NO SQL
BEGIN

SET @protocols = 0;
SET @host = '';
SET @port = 0;
SET @path = '';

SET @fparam1 = fparam1;
SET @fparam2 = fparam2;
Chyba niestety nie ogarniam, jak sprawdzić czy to mam i tym bardziej jak to dodać :oops:

Re: FOTA

: śr wrz 25, 2019 9:31 pm
autor: lesny8
Zaloguj się do RPi po SSH i kopiuj-wklej

Kod: Zaznacz cały

source supla-docker/.env
docker exec supla-db mysql -u supla --password=$DB_PASSWORD supla -e "show procedure status where name='supla_get_device_firmware_url'"

Re: FOTA

: czw wrz 26, 2019 7:29 am
autor: Esteta
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
supla supla_get_device_firmware_url PROCEDURE supla@% 2019-05-07 06:58:45 2019-05-07 06:58:45 DEFINER utf8 utf8_general_ci latin1_swedish_ci

Re: FOTA

: czw wrz 26, 2019 9:56 am
autor: lesny8
Czyli jest :D
To z czym masz problem?

Re: FOTA

: czw wrz 26, 2019 10:05 am
autor: Esteta
Problemu nie mam.
Nie wiedziałem tylko, jak to sprawdzić i ewentualnie dodać.
Nie ogarniam trochę operacji na tej bazie :(
Dzięki za pomoc :)

Re: FOTA

: sob gru 07, 2019 6:02 pm
autor: kris.sg
mam pytanie czy da się skompilować nettle na rpi4 ?
robię według poradnika z pierwszej strony i mam taki błąd przy próbie kompilacji :

Kod: Zaznacz cały

pi@raspberrypi:~/SUPLA/nettle-3.3 $ ./configure
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for -R flag... using -Wl,-rpath,
Searching for libraries
checking /usr/local/lib/lib... not found
checking /usr/local/lib... added
checking /sw/local/lib... not found
checking /sw/lib... not found
checking /usr/gnu/lib... not found
checking /opt/gnu/lib... not found
checking /sw/gnu/lib... not found
checking /usr/freeware/lib... not found
checking /usr/pkg/lib... not found
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ifunc support... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking if LD -Wl,--version-script works... yes
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking for nm... nm
checking for objdump... objdump
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether ln -s works... yes
checking for build system executable suffix... 
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for uid_t in sys/types.h... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking size of long... 4
checking size of size_t... 4
checking openssl/blowfish.h usability... yes
checking openssl/blowfish.h presence... yes
checking for openssl/blowfish.h... yes
checking openssl/des.h usability... yes
checking openssl/des.h presence... yes
checking for openssl/des.h... yes
checking openssl/cast.h usability... yes
checking openssl/cast.h presence... yes
checking for openssl/cast.h... yes
checking openssl/aes.h usability... yes
checking openssl/aes.h presence... yes
checking for openssl/aes.h... yes
checking openssl/ecdsa.h usability... yes
checking openssl/ecdsa.h presence... yes
checking for openssl/ecdsa.h... yes
checking valgrind/memcheck.h usability... no
checking valgrind/memcheck.h presence... no
checking for valgrind/memcheck.h... no
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlopen in -ldl... yes
checking for working alloca.h... yes
checking for alloca... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for strerror... yes
checking for secure_getenv... yes
checking for getline... yes
checking whether byte ordering is bigendian... no
checking for __attribute__... yes
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in nettle-stdint.h (assuming C99 compatible system)
checking for fcntl file locking... yes
checking for __gmpz_powm_sec in -lgmp... yes
checking for GMP limb size... 32 bits
checking if /proc/cpuinfo claims neon support... yes
configure: Looking for assembler files in arm/neon arm/v6 arm.
checking CCPIC... -fpic
checking if globals are prefixed by underscore... no
checking for ELF-style .type,%function pseudo-ops... yes
checking for ELF-style .type,#function pseudo-ops... yes
checking for COFF-style .type directive... no
checking if we should use a .note.GNU-stack section... yes
checking if .align assembly directive is logarithmic... yes
checking for m4... m4
checking for makeinfo... not-found
checking for BF_ecb_encrypt in -lcrypto... yes
checking for library containing clock_gettime... none required
configure: creating ./config.status
config.status: creating config.make
config.status: creating config.m4
config.status: creating Makefile
config.status: creating version.h
config.status: creating tools/Makefile
config.status: creating testsuite/Makefile
config.status: creating examples/Makefile
config.status: creating nettle.pc
config.status: creating hogweed.pc
config.status: creating libnettle.map
config.status: creating libhogweed.map
config.status: creating config.h
config.status: linking arm/v6/aes-encrypt-internal.asm to aes-encrypt-internal.asm
config.status: linking arm/v6/aes-decrypt-internal.asm to aes-decrypt-internal.asm
config.status: linking arm/memxor.asm to memxor.asm
config.status: linking arm/memxor3.asm to memxor3.asm
config.status: linking arm/neon/chacha-core-internal.asm to chacha-core-internal.asm
config.status: linking arm/neon/salsa20-core-internal.asm to salsa20-core-internal.asm
config.status: linking arm/v6/sha1-compress.asm to sha1-compress.asm
config.status: linking arm/v6/sha256-compress.asm to sha256-compress.asm
config.status: linking arm/neon/sha512-compress.asm to sha512-compress.asm
config.status: linking arm/neon/sha3-permute.asm to sha3-permute.asm
config.status: linking arm/neon/umac-nh.asm to umac-nh.asm
config.status: linking arm/neon/umac-nh-n.asm to umac-nh-n.asm
config.status: linking arm/machine.m4 to machine.m4
config.status: linking arm/ecc-192-modp.asm to ecc-192-modp.asm
config.status: linking arm/ecc-224-modp.asm to ecc-224-modp.asm
config.status: linking arm/ecc-256-redc.asm to ecc-256-redc.asm
config.status: linking arm/ecc-384-modp.asm to ecc-384-modp.asm
config.status: linking arm/ecc-521-modp.asm to ecc-521-modp.asm
config.status: executing dummy-dep-files commands
config.status: executing nettle-stdint.h commands
config.status: creating nettle-stdint.h : __NETTLE_STDINT_H
configure: summary of build options:

  Version:           nettle 3.3
  Host type:         armv7l-unknown-linux-gnueabihf
  ABI:               standard
  Assembly files:    arm/neon arm/v6 arm
  Install prefix:    /usr/local
  Library directory: ${exec_prefix}/lib
  Compiler:          gcc
  Static libraries:  yes
  Shared libraries:  yes
  Public key crypto: yes
  Using mini-gmp:    no
  Documentation:     no

pi@raspberrypi:~/SUPLA/nettle-3.3 $ make
make all-here
make[1]: Wejście do katalogu '/home/pi/SUPLA/nettle-3.3'
gcc -O `test -f aesdata.c || echo './'`aesdata.c \
-o aesdata
gcc -O `test -f desdata.c || echo './'`desdata.c \
-o desdata
gcc -O `test -f twofishdata.c || echo './'`twofishdata.c \
-o twofishdata
gcc -O `test -f shadata.c || echo './'`shadata.c -lm \
-o shadata
gcc -O `test -f gcmdata.c || echo './'`gcmdata.c \
-o gcmdata
gcc -I.  -DHAVE_CONFIG_H -g -O2 -ggdb3 -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -fpic -MT getopt.o -MD -MP -MF getopt.o.d -c getopt.c \
&& true
gcc -I.  -DHAVE_CONFIG_H -g -O2 -ggdb3 -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -fpic -MT getopt1.o -MD -MP -MF getopt1.o.d -c getopt1.c \
&& true
gcc -I.  -DHAVE_CONFIG_H -g -O2 -ggdb3 -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -fpic -MT nettle-internal.o -MD -MP -MF nettle-internal.o.d -c nettle-internal.c \
&& true
nettle-internal.c:55:3: warning: cast between incompatible function types from ‘int (*)(struct des_ctx *, const uint8_t *)’ {aka ‘int (*)(struct des_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
   (nettle_set_key_func *) des_set_key,
   ^
nettle-internal.c:56:3: warning: cast between incompatible function types from ‘int (*)(struct des_ctx *, const uint8_t *)’ {aka ‘int (*)(struct des_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
   (nettle_set_key_func *) des_set_key,
   ^
nettle-internal.c:65:2: warning: cast between incompatible function types from ‘int (*)(struct des3_ctx *, const uint8_t *)’ {aka ‘int (*)(struct des3_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
  (nettle_set_key_func *) des3_set_key,
  ^
nettle-internal.c:66:2: warning: cast between incompatible function types from ‘int (*)(struct des3_ctx *, const uint8_t *)’ {aka ‘int (*)(struct des3_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
  (nettle_set_key_func *) des3_set_key,
  ^
nettle-internal.c:77:5: warning: cast between incompatible function types from ‘int (*)(struct blowfish_ctx *, const uint8_t *)’ {aka ‘int (*)(struct blowfish_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
     (nettle_set_key_func *) blowfish128_set_key,
     ^
nettle-internal.c:78:5: warning: cast between incompatible function types from ‘int (*)(struct blowfish_ctx *, const uint8_t *)’ {aka ‘int (*)(struct blowfish_ctx *, const unsigned char *)’} to ‘void (*)(void *, const uint8_t *)’ {aka ‘void (*)(void *, const unsigned char *)’} [-Wcast-function-type]
     (nettle_set_key_func *) blowfish128_set_key,
     ^
m4 ./asm.m4 machine.m4 config.m4 aes-decrypt-internal.asm >aes-decrypt-internal.s
/bin/sh: 1: m4: not found
make[1]: *** [Makefile:375: aes-decrypt-internal.o] Błąd 127
make[1]: Opuszczenie katalogu '/home/pi/SUPLA/nettle-3.3'
make: *** [Makefile:49: all] Błąd 2
próbowałem też na najnowszej wersji 3.5 ale też sypie błędami

szukałem w necie pomocy i doczytałem, że buster ma bibliotekę nettle : libnettle6-3.4.1-1, ale chyba jest niekompatybilna ?

Kod: Zaznacz cały

pi@raspberrypi:~/SUPLA/supla-esp-signtool/Release $ make
Building file: ../src/sigtool.c
Invoking: Cross GCC Compiler
gcc -O3 -Wall -c -fmessage-length=0 -std=c99 -MMD -MP -MF"src/sigtool.d" -MT"src/sigtool.d" -o "src/sigtool.o" "../src/sigtool.c"
../src/sigtool.c:28:10: fatal error: nettle/bignum.h: Nie ma takiego pliku ani katalogu
 #include <nettle/bignum.h>
          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/subdir.mk:20: src/sigtool.o] Błąd 1