Script to generate DB

Post Reply
DieterP
Posts: 2
Joined: Tue Feb 09, 2016 10:51 am

Hello

Is there an SQL script available to generate the MySQL DB?
User avatar
pzygmunt
Posts: 18279
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Hello,

Script is available at https://www.supla.org/download/supla_database.zip

You can also download Virtual Machine with preinstalled supla server.
https://www.supla.org/download/SUPLA-SERVER-VM.ova
DieterP
Posts: 2
Joined: Tue Feb 09, 2016 10:51 am

Thanks for the script, worked like a charm.
I'm trying to setup a local supla cloud on Windows with Xampp.
The database (mysql), php and apache are live.
The register and login page are working fine and are reachable within my local network.
However, when logged in, the server doesn't see the I/O devices (raspberry pi).

When checking the connection status on my raspberry pi with "/usr/sbin/supla-dev -D", it says "host not found".
Nevertheless pinging the IP works..
I guess i'm missing a service (supla-server) for the client to connect to?
As a small note, my firewall on my local computer was deactivated, so no ports should be blocked.
User avatar
pzygmunt
Posts: 18279
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

You need to run supla-server daemon but it can work only in linux/unix environment at this moment. May be in future we will port supla-server to windows platform.

At this moment you can run VirtualBox and import Virtual Machine with preconfigured
SUPLA SERVER. To do this:

1. Install VirtualBox https://www.virtualbox.org/wiki/Downloads
2. Download SUPLA-SERVER-VM https://www.supla.org/download/SUPLA-SERVER-VM.ova
3. Import Virtual machine (https://www.maketecheasier.com/import-e ... irtualbox/)
4. Run VM

More details you can find here: viewtopic.php?f=7&t=15
Bremans
Posts: 4
Joined: Thu Feb 04, 2016 8:18 am

Hi,

Trying to compile supla-server/Release, on Raspbian, but get the following error:

Code: Select all

Building file: ../src/accept_loop.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/accept_loop.d" -MT"src/accept_loop.d" -o "src/accept_loop.o" "../src/accept_loop.cpp"
Finished building: ../src/accept_loop.cpp

Building file: ../src/cdcommon.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/cdcommon.d" -MT"src/cdcommon.d" -o "src/cdcommon.o" "../src/cdcommon.cpp"
Finished building: ../src/cdcommon.cpp

Building file: ../src/cfg.c
Invoking: Cross GCC Compiler
gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/cfg.d" -MT"src/cfg.d" -o "src/cfg.o" "../src/cfg.c"
Finished building: ../src/cfg.c

Building file: ../src/client.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/client.d" -MT"src/client.d" -o "src/client.o" "../src/client.cpp"
Finished building: ../src/client.cpp

Building file: ../src/clientchannel.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/clientchannel.d" -MT"src/clientchannel.d" -o "src/clientchannel.o" "../src/clientchannel.cpp"
Finished building: ../src/clientchannel.cpp

Building file: ../src/clientlocation.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/clientlocation.d" -MT"src/clientlocation.d" -o "src/clientlocation.o" "../src/clientlocation.cpp"
Finished building: ../src/clientlocation.cpp

Building file: ../src/datalogger.cpp
Invoking: Cross G++ Compiler
g++ -D__OPEN_SSL=1 -I/usr/include/mysql -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/datalogger.d" -MT"src/datalogger.d" -o "src/datalogger.o" "../src/datalogger.cpp"
../src/datalogger.cpp: In member function ‘void supla_datalogger::log_temperature()’:
../src/datalogger.cpp:31:16: error: ‘get_user’ is not a member of ‘supla_user’
  while((user = supla_user::get_user(n)) != NULL) {
                ^
../src/datalogger.cpp:33:9: error: ‘class supla_user’ has no member named ‘get_temperatures’
   user->get_temperatures(tarr);
         ^
../src/datalogger.cpp:38:3: error: ‘supla_channel_temp’ was not declared in this scope
   supla_channel_temp *sct = (supla_channel_temp *)safe_array_get(tarr, a);
   ^
../src/datalogger.cpp:38:23: error: ‘sct’ was not declared in this scope
   supla_channel_temp *sct = (supla_channel_temp *)safe_array_get(tarr, a);
                       ^
../src/datalogger.cpp:38:50: error: expected primary-expression before ‘)’ token
   supla_channel_temp *sct = (supla_channel_temp *)safe_array_get(tarr, a);
                                                  ^
../src/datalogger.cpp:39:7: error: ‘class database’ has no member named ‘add_temperature’
   db->add_temperature(sct->getChannelId(), sct->getTemperature());
       ^
../src/datalogger.cpp:42:2: error: ‘supla_channel_temp’ has not been declared
  supla_channel_temp::free(tarr);
  ^
src/subdir.mk:97: recipe for target 'src/datalogger.o' failed
make: *** [src/datalogger.o] Error 1
Am I missing a step?

Kind regards,

Bart

ps: I know there is a VM but I'd love to get this running out of source.
User avatar
pzygmunt
Posts: 18279
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Please use latest sources. Then:

cd
git clone https://www.github.com/SUPLA/supla-core
cd supla-core/supla-server/Release
make clean && make

Additional requirements:
sudo apt-get install libmysql++-dev
sudo apt-get install libssl-dev
Bremans
Posts: 4
Joined: Thu Feb 04, 2016 8:18 am

Hi,

So far so good!

It's requesting the ssl-certificate, how can i generate this one?

Kind regards,

Bart
User avatar
pzygmunt
Posts: 18279
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

openssl req -x509 -newkey rsa:2048 -keyout private.key -out cert.crt -nodes -days 365
Post Reply

Return to “Help”