manio / skymax-demo

https://skyboo.net/2017/03/monitoring-voltronic-power-axpert-mex-inverter-under-linux/
GNU General Public License v2.0
51 stars 29 forks source link

cmake error #8

Closed dansass closed 1 year ago

dansass commented 3 years ago

when i wnat to run cmake .. && make it says

CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt.

and i am in the skymax-demo directory

whats going on?

manio commented 3 years ago

You are not in skymax-demo directory :)

dansass commented 3 years ago

I think I am

Screenshot_20201005-072516_Mobile SSH

manio commented 3 years ago

you're right just type cmake (without ..) and see if it helps

dansass commented 3 years ago

Still no luck :( here are my commands that i ran

11

22

33

manio commented 3 years ago

what if you do:

clone [...]
cd skymax-demo
mkdir build
cd build
cmake ..
make
dansass commented 3 years ago

44

for kicks i tried;

55

Im wondering if i Maybe installed cmake wrong. It sure is acting weird

manio commented 3 years ago

Yeah, you probably have something wrong. Try to clone to some other dir then your home dir, like /tmp For me it is working no matter if i do "cmake . " in main dir, or "cmake .." in build subdir:

/tmp/skymax-demo/build/ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/skymax-demo/build
Edgepath commented 1 year ago

Hello,

thanks for the awesome software work :dancing_women:

please update build instructions: like this:

# -1) tested on 
hostnamectrl; # Debian GNU/Linux 11 (bullseye)

# 0) have cmake installed
apt update; apt install cmake;

# 0.1) version installed
cmake --version
cmake version 3.18.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).

# 1) use https instead of ssh
git clone https://github.com/manio/skymax-demo.git

# 2) go into newly created subdir
cd skymax-demo

# 3) prepare build
cmake .

# output ought to be:

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/path/where/src/is/skymax-demo

# 4) build
make

Scanning dependencies of target inverter_poller
[ 20%] Building CXX object CMakeFiles/inverter_poller.dir/inputparser.cpp.o
[ 40%] Building CXX object CMakeFiles/inverter_poller.dir/inverter.cpp.o
/home/user/path/where/src/is/skymax-demo/inverter.cpp: In member function ‘bool cInverter::query(const char*, int)’:
/home/user/path/where/src/is/skymax-demo/inverter.cpp:114:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
  114 |         n = read(fd, (void*)buf+i, replysize-i);
      |                      ~~~~~~~~~~^~
[ 60%] Building CXX object CMakeFiles/inverter_poller.dir/main.cpp.o
[ 80%] Building CXX object CMakeFiles/inverter_poller.dir/tools.cpp.o
[100%] Linking CXX executable inverter_poller
[100%] Built target inverter_poller

# 5) run the binary program
./inverter_poller -h

USAGE:  ./inverter_poller <args> [-r <command>], [-h | --help], [-1 | --run-once]

SUPPORTED ARGUMENTS:
          -r <raw-command>      TX 'raw' command to the inverter
          -h | --help           This Help Message
          -1 | --run-once       Runs one iteration on the inverter, and then exits
          -d                    Additional debugging

RAW COMMAND EXAMPLES (see protocol manual for complete list):
Set output source priority  POP00     (Utility first)
                            POP01     (Solar first)
                            POP02     (SBU)
Set charger priority        PCP00     (Utility first)
                            PCP01     (Solar first)
                            PCP02     (Solar and utility)
                            PCP03     (Solar only)
Set other commands          PEa / PDa (Enable/disable buzzer)
                            PEb / PDb (Enable/disable overload bypass)
                            PEj / PDj (Enable/disable power saving)
                            PEu / PDu (Enable/disable overload restart)
                            PEx / PDx (Enable/disable backlight)
manio commented 1 year ago

This is already covered in https://github.com/manio/skymax-demo/issues/17 Closing this three-years old issue.