How to use Crow on Raspberry Pi - c++

I'm trying to start a webserver using a Raspberry Pi for listening to POST requests from IFTTT. I'm programming in C++. I first tried Crow, which wouldn't work at all, giving the error "Handler function cannot have void return type...". I saw that others had also had issues with it, so I looked for a new solution. I found RestINIO, which looks great, but I can't figure out how to install it on my Raspberry PI. I looked at the docs, but couldn't figure out how to get it to install.
I know this probably isn't the right place for this, but any help would be much appreciated!

Here's what I had to do (simple fix):
In Geany:
Go to Build > Set Build Commands
Under both "compile" and "build", add the following text to the end of the string: -lboost_system
Compilation is successful!

Related

Python Asterisk AGI imported script won't run?

I recently started a project where I've ro use asterisk and AGI. So I started to learn how AGI works in python by using an example found on the internet. But when I paste the example and try to run the module in Python, shell gives me in red font "ARGS: ['usr/bla bla]" ( You can see the clear output in attached image). I don't know why this happens and program won't stop running (When I try to close the shell, it says program still runs).
Note: I'm using Python in my Raspberry Pi. Pyst package has been installed there.
In above image, left side is the script that I tried to run. Or I can say the example I got from the internet. Rightside it shows the shell. You can see the program still runs.
Please help me. How can I run this properly?
Sure it not give any output.
It wait for INPUT.
Please re-read documentation about AGI, give script needed info to STDIN if for some weird reason you run it not from asterisk.

Where is "nvinfer.h" from tensorrt located?

I have been trying to compile a basic tensorRT project on a desktop host -for now the source is literally just the following:
#include <nvinfer.h>
class Logger : nvinfer1::public ILogger
{
} glogger;
Upon running make, though, I receive the following message:
fatal error: nvinfer.h: No such file or directory #include <nvinfer.h>
The error is correct, too - I used locate to try to find it, but there's nothing on my machine that matches. I followed the install instructions for desktop installation of TensorRT 2.1 as described here: https://developer.nvidia.com/nvidia-tensorrt-download
So my question is, does anyone know where nvinfer.h is supposed to be? In other words, am I missing a needed package that contains it, or did I miss something else that's essential?
Small addendum: one thing I noticed is that libgie1 is not installed, and it was not included as a debian with the provided TensorRT download like the other packages such as gie-dev were.
Before using locate, if you recently added new files is a good practice to run sudo updatedb, if the file is on the pc you should see it after.
Anyway googling a bit it looks like the header your looking for is NvInfer.h, caps matters.

Simulation terminated with exit code: 132

I am Mac OS 10.11 (El Capitan) user. I used 4.6 and when I tried to build some simulation I always get "Simulation terminated with exit code: 139" and couldn’t do nothing at all with that. I thought that when I install 5.0 then everything will be fine, but now I get something like that:
Simulation terminated with exit code: 132
Working directory: /Users/JL_Data/omnetpp-5.0/samples/tictoc
Command line: tictoc -r 0 --debug-on-errors=false omnetpp.ini
Environment variables:
PATH=/Users/JL_Data/omnetpp-5.0/bin::/usr/bin:/bin:/usr/sbin:/sbin
DYLD_LIBRARY_PATH=/Users/JL_Data/omnetpp-5.0/lib::
OMNETPP_IMAGE_PATH=/Users/JL_Data/omnetpp-5.0/images
And when I tried open some simulation in terminal I get:
Illegal instruction: 4
Do you have some idea what can I do with that problem? I tried to find something on the internet, but after one day I do not get any idea.
If you need some more information, please let me know.
As it is right now, your question is not completely clear, since it requires one to be familiar with omnet++ and probably some experience installing and setting it up. However, let me make a couple guesses.
First, Illegal instruction. This usually occurs when the binary was built for an architecture different than the one it's being run on; e.g. when then SSE2 or AVX instructions are present in the binary code, but are missing on the CPU.
See, for example, this SO question:
Find which assembly instruction caused an Illegal Instruction error without debugging
There is also a question that discusses exactly your problem, namely, "Illegal instruction: 4" on OS X:
What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?
Now, since omnet++ appears to be an open source project, I expect it to have a mailing list and / or an IRC channel. Indeed, here is the communications page on the official website that links to a Google Groups-based mailing list:
https://omnetpp.org/get-involved
https://groups.google.com/forum/#!forum/omnetpp
I advise you to get in touch with the developers with a thorough description of your problem, since the chances of them knowing the solution are significantly higher compared to the chances of there being a user on SO who has faced similar problems when installing an identical version of omnet++ on an identical version of Mac OS X.

how to get started with PCM?

I wanted to work on Intel PCM. I follwed the below link:
https://software.intel.com/en-us/articles/intel-performance-counter-monitor
I downloaded the code, i started to study example pcm.cpp. But Im not getting any proper understanding. Documentation is not that much clear.
http://intel-pcm-api-documentation.github.io/classPCM.html
I tried to run , pcm.x ,it gave basic information then showed some error like:
"Trying to use Linux perf events...
Linux Perf: Error on programming generic event #0 error: Invalid argument
Access to Intel(r) Performance Counter Monitor has denied (Unknown error)."
Unknown error! I cant figure out why its not accessible. I used with sudo also(root privileges).
Any suggestions how I can start working with it? Where to start?
Found a workaround here by Roman Dementiev that worked for me:
As a workaround you can disable perf usage in the PCM Makefile by removing "-DPCM_USE_PERF".

Basic ping pong style C++ program, can't seem to get it to compile and run

To start off I must say I am an absolute n00b. I just started with C++ and I am trying to figure it out. To issue I am having is I found this source code on google for Ping Pong and I've saved it as "pong.cpp" from sublime text edit to my Desktop. I am under the impression that all C++ programs have to be run through the terminal? but I am not sure, again beginner problems. So in terminal I direct it to my desktop in from there I type in g++ pong.cpp. Then it says this:
pong.cpp:2:10: fatal error: 'allegro.h' file not found
#include <allegro.h>
1 error generated.
I am thinking this is because I found it on google and that I need a file to back up the processing on the program which is unavailable.
Does anyone know where I could get a proper Ping Pong C++ code that would suite what I need here? I just want to be able to run a basic pingpong style game through my terminal to get more familiarized with C++
You have to tell gcc where allegro.h is installed. Run this command in terminal and post the output.
find / -name 'allegro.h' 2>/dev/null