Supla virtual device MQTT

Beku
Posts: 453
Joined: Tue Nov 06, 2018 1:49 pm

Post

szym3k wrote: Mon Feb 24, 2020 12:09 pm
Beku wrote: Mon Feb 24, 2020 11:56 am A jak ten plik config u ciebie się nazywa?

wprowadź tam jeszcze tą sekcję (przed channel a po location)

[MQTT]
host=
port=1883
username=
password=
client_name=supla-virtual-device

i upewnij się że te dane masz w pliku supla-virtual-device.cfg

Code: Select all

suplalpine:/home/supla/supla-virtual-device# ls
README.md                        src                              supla-virtual-device.cfg         var
install.sh                       supla-virtual-device             supla-virtual-device.cfg.sample
supla-virtual-device.cfg <-

Nie wiem co może być nie tak. Wklejałem też coś z configu z sampla i to samo.
Pod alpine są trochę inne paczki tzn. libressl-dev i build-base, ale to raczej nie powinno mieć wpływu.

Dodałem blok z MQTT

Code: Select all

  GNU nano 4.6                                                                               supla-virtual-device.cfg
[GLOBAL]
device_name=SUPLA VIRTUAL DEVICE


[SERVER]
host=xxx
protocol_version=10


[MQTT]
host=
port=1883
username=
password=
client_name=supla-virtual-device

[LOCATION]
ID=xx
PASSWORD=xxx

[CHANNEL_0]
function=TEMPERATURE
file=/home/supla/supla-filesensors/temp.txt
Nadal to samo :/.
napsisałem "wprowadź tam jeszcze tą sekcję (przed channel a po location)". Wpisałeś ją przed location.

no to wykonaj:

Code: Select all


sudo rm supla-virtual-device
cd src/supla-dev/Debug
make all

i ponownie z katalogu supla-virtual-device

Code: Select all

 ln -s src/supla-dev/Debug/supla-virtual-device supla-virtual-device
uruchom ponownie supla-virtual-device.
Logów powinno być więcej.
szym3k
Posts: 270
Joined: Mon May 15, 2017 10:32 am

Post

Beku wrote: Mon Feb 24, 2020 12:14 pm
napsisałem "wprowadź tam jeszcze tą sekcję (przed channel a po location)". Wpisałeś ją przed location.

no to wykonaj:

Code: Select all


sudo rm supla-virtual-device
cd src/supla-dev/Debug
make all

i ponownie z katalogu supla-virtual-device

Code: Select all

 ln -s src/supla-dev/Debug/supla-virtual-device supla-virtual-device
uruchom ponownie supla-virtual-device.
Logów powinno być więcej.
Poprawiłem miejsce MQTT - to samo.

Log po wykonaniu komend.

Code: Select all

suplalpine:/home/supla/supla-virtual-device# ./supla-virtual-device
SUPLA-VIRTUAL-DEVICE v1.0.0
DEBUG[1582553331.254765] searching channel with number 0
DEBUG[1582553331.254793] adding channel with number 0
DEBUG[1582553331.254802] adding channel with number 0
DEBUG[1582553331.254827] searching channel with number 0
DEBUG[1582553331.254834] c_number: 0
DEBUG[1582553331.254911] Protocol v12
DEBUG[1582553331.254943] Starting...
DEBUG[1582553331.255128] Device GUID: DBCD8AA0E51E8A513AB1E0AAD7BDC16D
Segmentation fault

log z kompilacji

Code: Select all

Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/cfg.d" -MT"src/supla-client-lib/cfg.o" -o "src/supla-client-lib/cfg.o" "../src/supla-client-lib/cfg.c"
../src/supla-client-lib/cfg.c: In function 'scfg_add_param':
../src/supla-client-lib/cfg.c:151:25: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  151 |     param->section_name = section_name;
      |                         ^
Finished building: ../src/supla-client-lib/cfg.c

Building file: ../src/supla-client-lib/devicechannel.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/devicechannel.d" -MT"src/supla-client-lib/devicechannel.o" -o "src/supla-client-lib/devicechannel.o" "../src/supla-client-lib/devicechannel.cpp"
Finished building: ../src/supla-client-lib/devicechannel.cpp

Building file: ../src/supla-client-lib/eh.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/eh.d" -MT"src/supla-client-lib/eh.o" -o "src/supla-client-lib/eh.o" "../src/supla-client-lib/eh.c"
Finished building: ../src/supla-client-lib/eh.c

Building file: ../src/supla-client-lib/ini.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/ini.d" -MT"src/supla-client-lib/ini.o" -o "src/supla-client-lib/ini.o" "../src/supla-client-lib/ini.c"
Finished building: ../src/supla-client-lib/ini.c

Building file: ../src/supla-client-lib/ipcsocket.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/ipcsocket.d" -MT"src/supla-client-lib/ipcsocket.o" -o "src/supla-client-lib/ipcsocket.o" "../src/supla-client-lib/ipcsocket.c"
../src/supla-client-lib/ipcsocket.c: In function 'ipcsocket_init':
../src/supla-client-lib/ipcsocket.c:45:23: warning: implicit declaration of function 'strnlen' [-Wimplicit-function-declaration]
   45 |   if (address == 0 || strnlen(address, 110) == 0) {
      |                       ^~~~~~~
../src/supla-client-lib/ipcsocket.c:45:23: warning: incompatible implicit declaration of built-in function 'strnlen'
../src/supla-client-lib/ipcsocket.c:50:7: warning: incompatible implicit declaration of built-in function 'strnlen'
   50 |   if (strnlen(address, 110) > 107) {
      |       ^~~~~~~
../src/supla-client-lib/ipcsocket.c:69:3: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   69 |   memset(ipc, 0, sizeof(TSuplaIPC_socket));
      |   ^~~~~~
../src/supla-client-lib/ipcsocket.c:69:3: warning: incompatible implicit declaration of built-in function 'memset'
../src/supla-client-lib/ipcsocket.c:35:1: note: include '<string.h>' or provide a declaration of 'memset'
   34 | #include "tools.h"
  +++ |+#include <string.h>
   35 |
Finished building: ../src/supla-client-lib/ipcsocket.c

Building file: ../src/supla-client-lib/lck.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/lck.d" -MT"src/supla-client-lib/lck.o" -o "src/supla-client-lib/lck.o" "../src/supla-client-lib/lck.c"
Finished building: ../src/supla-client-lib/lck.c

Building file: ../src/supla-client-lib/log.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/log.d" -MT"src/supla-client-lib/log.o" -o "src/supla-client-lib/log.o" "../src/supla-client-lib/log.c"
Finished building: ../src/supla-client-lib/log.c

Building file: ../src/supla-client-lib/proto.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/proto.d" -MT"src/supla-client-lib/proto.o" -o "src/supla-client-lib/proto.o" "../src/supla-client-lib/proto.c"
Finished building: ../src/supla-client-lib/proto.c

Building file: ../src/supla-client-lib/safearray.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/safearray.d" -MT"src/supla-client-lib/safearray.o" -o "src/supla-client-lib/safearray.o" "../src/supla-client-lib/safearray.c"
Finished building: ../src/supla-client-lib/safearray.c

Building file: ../src/supla-client-lib/srpc.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/srpc.d" -MT"src/supla-client-lib/srpc.o" -o "src/supla-client-lib/srpc.o" "../src/supla-client-lib/srpc.c"
Finished building: ../src/supla-client-lib/srpc.c

Building file: ../src/supla-client-lib/sthread.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/sthread.d" -MT"src/supla-client-lib/sthread.o" -o "src/supla-client-lib/sthread.o" "../src/supla-client-lib/sthread.c"
Finished building: ../src/supla-client-lib/sthread.c

Building file: ../src/supla-client-lib/supla-client.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/supla-client.d" -MT"src/supla-client-lib/supla-client.o" -o "src/supla-client-lib/supla-client.o" "../src/supla-client-lib/supla-client.c"
Finished building: ../src/supla-client-lib/supla-client.c

Building file: ../src/supla-client-lib/supla-socket.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/supla-socket.d" -MT"src/supla-client-lib/supla-socket.o" -o "src/supla-client-lib/supla-socket.o" "../src/supla-client-lib/supla-socket.c"
../src/supla-client-lib/supla-socket.c: In function 'ssocket_client_initctx':
../src/supla-client-lib/supla-socket.c:209:3: warning: 'TLSv1_2_client_method' is deprecated [-Wdeprecated-declarations]
  209 |   method = (SSL_METHOD *)TLSv1_2_client_method();
      |   ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from ../src/supla-client-lib/supla-socket.c:42:
/usr/include/openssl/ssl.h:1891:1: note: declared here
 1891 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_method(void))
      | ^~~~~~~~~~~~~~~~~~
../src/supla-client-lib/supla-socket.c: In function 'ssocket_free':
../src/supla-client-lib/supla-socket.c:306:5: warning: 'ERR_remove_thread_state' is deprecated [-Wdeprecated-declarations]
  306 |     ERR_remove_thread_state(NULL);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from ../src/supla-client-lib/supla-socket.c:42:
/usr/include/openssl/err.h:260:1: note: declared here
  260 | DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
      | ^~~~~~~~~~~~~~~~~~
../src/supla-client-lib/supla-socket.c: In function 'ssocket_supla_socket_close':
../src/supla-client-lib/supla-socket.c:446:5: warning: 'ERR_remove_thread_state' is deprecated [-Wdeprecated-declarations]
  446 |     ERR_remove_thread_state(NULL);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from ../src/supla-client-lib/supla-socket.c:42:
/usr/include/openssl/err.h:260:1: note: declared here
  260 | DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
      | ^~~~~~~~~~~~~~~~~~
Finished building: ../src/supla-client-lib/supla-socket.c

Building file: ../src/supla-client-lib/tools.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-client-lib/tools.d" -MT"src/supla-client-lib/tools.o" -o "src/supla-client-lib/tools.o" "../src/supla-client-lib/tools.c"
Finished building: ../src/supla-client-lib/tools.c

Building file: ../src/mqtt/mqtt.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/mqtt/mqtt.d" -MT"src/mqtt/mqtt.o" -o "src/mqtt/mqtt.o" "../src/mqtt/mqtt.cpp"
Finished building: ../src/mqtt/mqtt.cpp

Building file: ../src/mqtt/mqtt_client.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/mqtt/mqtt_client.d" -MT"src/mqtt/mqtt_client.o" -o "src/mqtt/mqtt_client.o" "../src/mqtt/mqtt_client.cpp"
Finished building: ../src/mqtt/mqtt_client.cpp

Building file: ../src/mqtt/mqtt_pal.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/mqtt/mqtt_pal.d" -MT"src/mqtt/mqtt_pal.o" -o "src/mqtt/mqtt_pal.o" "../src/mqtt/mqtt_pal.c"
Finished building: ../src/mqtt/mqtt_pal.c

Building file: ../src/accept_loop.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/accept_loop.d" -MT"src/accept_loop.o" -o "src/accept_loop.o" "../src/accept_loop.cpp"
Finished building: ../src/accept_loop.cpp

Building file: ../src/channel-io.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/channel-io.d" -MT"src/channel-io.o" -o "src/channel-io.o" "../src/channel-io.cpp"
Finished building: ../src/channel-io.cpp

Building file: ../src/client_device.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/client_device.d" -MT"src/client_device.o" -o "src/client_device.o" "../src/client_device.cpp"
Finished building: ../src/client_device.cpp

Building file: ../src/client_publisher.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/client_publisher.d" -MT"src/client_publisher.o" -o "src/client_publisher.o" "../src/client_publisher.cpp"
Finished building: ../src/client_publisher.cpp

Building file: ../src/client_subscriber.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/client_subscriber.d" -MT"src/client_subscriber.o" -o "src/client_subscriber.o" "../src/client_subscriber.cpp"
Finished building: ../src/client_subscriber.cpp

Building file: ../src/common.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/common.d" -MT"src/common.o" -o "src/common.o" "../src/common.cpp"
Finished building: ../src/common.cpp

Building file: ../src/common_dht_read.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/common_dht_read.d" -MT"src/common_dht_read.o" -o "src/common_dht_read.o" "../src/common_dht_read.c"
Finished building: ../src/common_dht_read.c

Building file: ../src/devcfg.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/devcfg.d" -MT"src/devcfg.o" -o "src/devcfg.o" "../src/devcfg.cpp"
../src/devcfg.cpp: In function 'unsigned char devcfg_init(int, char**)':
../src/devcfg.cpp:207:20: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  207 |   char *s_global = "GLOBAL";
      |                    ^~~~~~~~
../src/devcfg.cpp:208:52: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  208 |   scfg_add_str_param(s_global, "device_guid_file", "./var/dev_guid");
      |                                                    ^~~~~~~~~~~~~~~~
../src/devcfg.cpp:209:43: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  209 |   scfg_add_str_param(s_global, "alt_cfg", "");
      |                                           ^~
../src/devcfg.cpp:210:46: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  210 |   scfg_add_str_param(s_global, "state_file", "./var/last_state.txt");
      |                                              ^~~~~~~~~~~~~~~~~~~~~~
../src/devcfg.cpp:211:47: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  211 |   scfg_add_str_param(s_global, "device_name", "SUPLA VIRTUAL DEVICE");
      |                                               ^~~~~~~~~~~~~~~~~~~~~~
../src/devcfg.cpp:213:20: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  213 |   char *s_server = "SERVER";
      |                    ^~~~~~~~
../src/devcfg.cpp:214:40: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  214 |   scfg_add_str_param(s_server, "host", "");
      |                                        ^~
../src/devcfg.cpp:220:22: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  220 |   char *s_location = "LOCATION";
      |                      ^~~~~~~~~~
../src/devcfg.cpp:225:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  225 |   char *s_auth = "AUTH";
      |                  ^~~~~~
../src/devcfg.cpp:226:39: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  226 |   scfg_add_str_param(s_auth, "email", "");
      |                                       ^~
../src/devcfg.cpp:228:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  228 |   char *s_mqtt = "MQTT";
      |                  ^~~~~~
../src/devcfg.cpp:229:38: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  229 |   scfg_add_str_param(s_mqtt, "host", "");
      |                                      ^~
../src/devcfg.cpp:231:42: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  231 |   scfg_add_str_param(s_mqtt, "username", "");
      |                                          ^~
../src/devcfg.cpp:232:42: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  232 |   scfg_add_str_param(s_mqtt, "password", "");
      |                                          ^~
../src/devcfg.cpp:233:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  233 |   scfg_add_str_param(s_mqtt, "client_name", "supla-vd-client");
      |                                             ^~~~~~~~~~~~~~~~~
../src/devcfg.cpp:235:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  235 |   result = scfg_load(argc, argv, "./supla-virtual-device.cfg");
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finished building: ../src/devcfg.cpp

Building file: ../src/devconnection.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/devconnection.d" -MT"src/devconnection.o" -o "src/devconnection.o" "../src/devconnection.cpp"
Finished building: ../src/devconnection.cpp

Building file: ../src/gpio.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/gpio.d" -MT"src/gpio.o" -o "src/gpio.o" "../src/gpio.c"
Finished building: ../src/gpio.c

Building file: ../src/ipcctrl.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/ipcctrl.d" -MT"src/ipcctrl.o" -o "src/ipcctrl.o" "../src/ipcctrl.cpp"
../src/ipcctrl.cpp: In member function 'void svr_ipcctrl::execute(void*)':
../src/ipcctrl.cpp:86:16: warning: unused variable 'hi' [-Wunused-variable]
   86 |           char hi;
      |                ^~
Finished building: ../src/ipcctrl.cpp

Building file: ../src/mcp23008.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/mcp23008.d" -MT"src/mcp23008.o" -o "src/mcp23008.o" "../src/mcp23008.c"
Finished building: ../src/mcp23008.c

Building file: ../src/pi_2_dht_read.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/pi_2_dht_read.d" -MT"src/pi_2_dht_read.o" -o "src/pi_2_dht_read.o" "../src/pi_2_dht_read.c"
Finished building: ../src/pi_2_dht_read.c

Building file: ../src/pi_2_mmio.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/pi_2_mmio.d" -MT"src/pi_2_mmio.o" -o "src/pi_2_mmio.o" "../src/pi_2_mmio.c"
Finished building: ../src/pi_2_mmio.c

Building file: ../src/supla-dev.cpp
Invoking: Cross G++ Compiler
g++ -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -D__NO_DATABASE -D__NO_USER -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/supla-dev.d" -MT"src/supla-dev.o" -o "src/supla-dev.o" "../src/supla-dev.cpp"
Finished building: ../src/supla-dev.cpp

Building file: ../src/w1.c
Invoking: Cross GCC Compiler
gcc -D__DEBUG=1 -D__SSOCKET_WRITE_TO_FILE=0 -I/usr/src/openssl/include -I../src/json -O0 -g3 -Wall -fsigned-char -c -fmessage-length=0 -MMD -MP -MF"src/w1.d" -MT"src/w1.o" -o "src/w1.o" "../src/w1.c"
Finished building: ../src/w1.c

Building target: supla-virtual-device
Invoking: Cross G++ Linker
g++ -L/usr/src/openssl/lib -pthread -lrt -o "supla-virtual-device"  ./src/supla-client-lib/cfg.o ./src/supla-client-lib/devicechannel.o ./src/supla-client-lib/eh.o ./src/supla-client-lib/ini.o ./src/supla-client-lib/ipcsocket.o ./src/supla-client-lib/lck.o ./src/supla-client-lib/log.o ./src/supla-client-lib/proto.o ./src/supla-client-lib/safearray.o ./src/supla-client-lib/srpc.o ./src/supla-client-lib/sthread.o ./src/supla-client-lib/supla-client.o ./src/supla-client-lib/supla-socket.o ./src/supla-client-lib/tools.o  ./src/mqtt/mqtt.o ./src/mqtt/mqtt_client.o ./src/mqtt/mqtt_pal.o  ./src/accept_loop.o ./src/channel-io.o ./src/client_device.o ./src/client_publisher.o ./src/client_subscriber.o ./src/common.o ./src/common_dht_read.o ./src/devcfg.o ./src/devconnection.o ./src/gpio.o ./src/ipcctrl.o ./src/mcp23008.o ./src/pi_2_dht_read.o ./src/pi_2_mmio.o ./src/supla-dev.o ./src/w1.o   -lssl -lcrypto
Finished building target: supla-virtual-device
Beku
Posts: 453
Joined: Tue Nov 06, 2018 1:49 pm

Post

dodałem trochę dodatkowych logów.

Proszę wykonaj:

Code: Select all


cd src/supla-dev/Debug
git pull
make all

i uruchom ponownie program. Daj znać co masz w logach
andras
Posts: 636
Joined: Fri Dec 30, 2016 5:51 pm
Has thanked: 2 times
Been thanked: 4 times

Post

Beku wrote: Mon Feb 24, 2020 6:12 am Na którym kroku się zatrzymałeś ? Co zrobiłeś i co Ci nie działa ?
Postawiłem nowy system
Instalacja supla-virtual-device ok
Zainstalowałem supervisior poszło ok
ale
Set the following options in the [unix_http_server] section (replace pi with your username) and exit from the editor (Ctrl+X, Y, Enter):
w /etc/supervisor/supervisord.conf mam
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)

więc co mam zmienić ? nic nie zmieniam wychodzę
a później prubuję :
pi@raspberrypi:~ $ sudo service supervisor restart
pi@raspberrypi:~ $ supervisorctl start supla-virtual-device
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
Beku
Posts: 453
Joined: Tue Nov 06, 2018 1:49 pm

Post

dopisz pod
chmod=0770

To:

chown=root:pi
andras
Posts: 636
Joined: Fri Dec 30, 2016 5:51 pm
Has thanked: 2 times
Been thanked: 4 times

Post

Dopisałem i dalej :

supervisorctl start supla-virtual-device
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
Beku
Posts: 453
Joined: Tue Nov 06, 2018 1:49 pm

Post

A zrobiłeś sudo systemctl restart supervisor ?
andras
Posts: 636
Joined: Fri Dec 30, 2016 5:51 pm
Has thanked: 2 times
Been thanked: 4 times

Post

Tak zrobiłem

pi@raspberrypi:/ $ sudo systemctl restart supervisor
pi@raspberrypi:/ $ supervisorctl start supla-virtual-device
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
pi@raspberrypi:/ $
Beku
Posts: 453
Joined: Tue Nov 06, 2018 1:49 pm

Post

andras wrote: Mon Feb 24, 2020 8:22 pm Tak zrobiłem

pi@raspberrypi:/ $ sudo systemctl restart supervisor
pi@raspberrypi:/ $ supervisorctl start supla-virtual-device
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
pi@raspberrypi:/ $

Wklej tu zawartość tego pliku:

nano /etc/supervisor/supervisord.conf
andras
Posts: 636
Joined: Fri Dec 30, 2016 5:51 pm
Has thanked: 2 times
Been thanked: 4 times

Post

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
chown=root:pi

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket

; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

Return to “Projekty użytkowników”