|
|
Line 1: |
Line 1: |
| === Run as root === | | === Run as root === |
|
| |
| Running as root seems to work well:
| |
| m@viper:~/development/causam/git/np/nop-bigress-client-c$ sudo cmake-release/nop-client -d7
| |
|
| |
| Better, we should be able to allow the binary access to lower ports with setcap:
| |
| sudo setcap CAP_NET_BIND_SERVICE=+eip /home/m/development/causam/git/np/nop-bigress-client-c/cmake-debug/nop-client
| |
| # that will stick - except you have to rerun that every time after building it
| |
| # turn it off with
| |
| sudo setcap CAP_NET_BIND_SERVICE=-p /home/m/development/causam/git/np/nop-bigress-client-c/cmake-debug/nop-client
| |
|
| |
|
| === Debug === | | === Debug === |
| Qt Creator seems pretty good.
| |
|
| |
| Install DEBUG versions of all libraries into /usr/local - see build_lws_debug for an example of that library.
| |
|
| |
| Make sure you rebuild everything from command line, it took a couple times before Qt seemed to pick it up and debug into libs. You should NOT have to add any paths directly.
| |
|
| |
|
| === Resources === | | === Resources === |
| Watch bigress kafka spf topic for NOP C messages
| |
| m@viper:~$ ssh bigress-1.testv4 ./mdm_tailTopic.sh simplepointframe|grep "NOP C CLIENT"
| |
| m@viper:~$ ssh bigress-2.testv4 ./mdm_tailTopic.sh simplepointframe|grep "NOP C CLIENT"
| |
| Watch haproxy
| |
| m@viper:~$ ssh bigress-lb-1.testv4 tail -f /var/log/haproxy.log
| |
| m@viper:~$ ssh bigress-lb-2.testv4 tail -f /var/log/haproxy.log
| |
| haproxy is at .io, it forwards traffic to bigress; bigress is at .link, NOTE DOES NOT SUPPORT SSL at all
| |
|
| |
| See bigress kafka topics
| |
| # connect vpn
| |
| ssh bigress-1.testv4 # .energynet.link
| |
| ~/mdm_listTopics.sh
| |
| ~/mdm_tailTopic.sh
| |
| watch local 443 traffic
| |
| m@viper:~$ sudo tcpdump -X 'tcp port 443 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
| |
| test curl REST msg to bigress
| |
| cd /etc/nop-client/ssl/causam-testv4.energynet.io
| |
| PEM_FILE=d292c3a4-097d-6c44-cec8-e8bb4ffe946e.pem
| |
| curl -vvv -k -X PUT -d "{payload: \"`hostname`\"}" --cert $PEM_FILE --cookie @cookie.jar --cookie-jar cookie.jar "https://bigress-1.testv4.energynet.io:443/rest/v1/random1"
| |
| (NOTE: does not verify certs)
| |
| nop c publish to bigress
| |
| use causam-testv4.energynet.io provisioning
| |
|
| |
|
| === Message flow === | | === Message flow === |
|
| |
| EDGE CLIENT
| |
|
| |
| initial certificate provisioning
| |
|
| |
| olympicmachines < hello
| |
| simplepointframe < heartbeat keepalives (as needed)
| |
| EDGE becomes device-aware
| |
| build config
| |
| send to machine olympicmachines > polling config
| |
| olympicmachines < polling config ACK
| |
|
| |
| start polling simplepointframe < data
| |
|
| |
| (dead) < (buffer until server becomes responsive)
| |
|
| |
|
| === Functionality === | | === Functionality === |