Following the AWS Guide: https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/ and I got to the step that has me install mosquitto.
//Update the list of repositories with one containing Mosquitto
sudo wget http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/home:oojah:mqtt.repo -O /etc/yum.repos.d/mqtt.repo
//Install Mosquitto broker and Mosquitto command line tools
sudo yum install mosquitto mosquitto-clients
However, the guide is so outdated that it does not mention anything about the missing libwebsockets library. I've spent roughly 4-5 hours on searching for an answer on how to manually install/link/setup the library but I have not been able to make anything work.
(1) Tried this
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=/usr/bin/gcc
make
sudo make install
But yea that didn't work because CMAKE throws all kinds of errors like
CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:99 (message): Could not find toolchain file: /tmp/mytoolchainfile
Call Stack (most recent call first):
CMakeLists.txt:131 (project)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file: /tmp/libwebsockets/build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake
-- Configuring incomplete, errors occurred!
So I tried to set the CMAKE_C_COMPILER path to /usr/bin/gcc, which is where the compiler is installed and that didn't do anything either. In all honesty, I'm not super familiar with Linux, I'm just trying to make do the best I can. I could really use some guidance on how best to get library installed and linked into Linux. I do believe AWS runs a red-hat version of linux.
Thanks for your time!
I had this working using aws linux 2
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -P /tmp
sudo yum install -y /tmp/epel-release-latest-7.noarch.rpm
sudo yum install libwebsockets
sudo yum install mosquitto mosquitto-clients
Related
I'm trying to install PyCaffe for Python 3.5.3 on AWS EC2 with Ubuntu 14.04 without Anaconda, following the installation instructions.
I successfully compiled it on the same machine for Python 2.7 but when compiling for version 3.5 I get the following error:
ubuntu#ip-172-31-3-227:~/caffe$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
#include <Python.h> // NOLINT(build/include_alpha)
I saw this post and performed:
sudo apt-get install python3-dev
I found this, so I performed the equivalent command for Python 3.5:
for req in $(cat requirements.txt); do sudo pip3.5 install $req; done
All installations worked but it didn't fix the problem.
I many other posts on similar problems but not this exact problem (so if you find something please check that it's really the same situation before rushing to say I didn't look well enough).
P.S.
I also saw this post but I don't understand which directories to add to the path.
When you do a pip install package,when pip finds new version,it uninstall the current one(dateutil in your case) when the package was installed using certain permission,pip needs the same permission to uninstall/upgrade it.
A quick fix would be to change this
`for req in $(cat requirements.txt); do pip3.5 install $req; done` to
for req in $(cat requirements.txt); do sudo pip3.5 install $req; done
It seems you dont have permission to access /usr/local/lib/python3.5/ folder as user,the packages that goes in /usr/local are required by the system but only available to you and only you on the system, i assume since only only they are restricted to you and pip want to access assuming that no restriction is there,then it get permission denied ,so you might consider doing
for req in $(cat requirements.txt); do pip3.5 --user yourusername install $req; done
the alternative is to remove any restriction to execute and write on that folder
by doing chmod -R 777 /usr/local/lib/python3.5/ which is usually not recommended but the problem you need pip to be able to read,write,execute anything in that folder.
I am attempting to link my Raspberry Pi to my Azure IoT suite using this tutorial.
I get these errors when entering the following code into my terminal:
cd ~/azure-iot-sdks/
sudo ~/azure-iot-sdks/c/build_all/linux/setup.sh
chmod +x ~/azure-iot-sdks/c/build_all/linux/build.sh
~/azure-iot-sdks/c/build_all/linux/build.sh
Any help is appreciated, as I cannot wait to connect my Pi to Azure!
I've verified the tutorial works on various environments,
Host: Ubuntu 14.04, gcc version 4.8.4, cmake version 2.8.12.2, build succesfully.
Host: Ubuntu 14.04, gcc version 4.9.3, cmake version 2.8.12.2, build succesfully.
Host: Ubuntu 14.04, gcc version 4.9.3, cmake version 3.3.2, build succesfully.
Host: Bash On Ubuntu On Windows, gcc version 4.8.4, cmake version 2.8.12.2, build succesfully.
Interesting thing is although gcc(>=4.9) and cmake(>=3.0) is recommended per this page, I found gcc 4.8 and cmake 2.8 also works find with this tutorial.
Anyway, you need to make sure you follow the steps thoroughly,
Clone iot-hub-c-raspberrypi-getstartedkit and WiringPi repositories, with the --recursive parameter.
Go to WiringPi and do ./build. This step is not mentioned in the tutorial but I found it necessary.
Make sure you have all the tools installed,
sudo apt-get install curl libcurl4-openssl-dev uuid-dev uuid g++ make cmake git unzip openjdk-7-jre libssl-dev libncurses-dev subversion gawk
Build the source code,
cd ~/iot-hub-c-raspberrypi-getstartedkit/
sudo ~/iot-hub-c-raspberrypi-getstartedkit/azure-iot- sdks/c/build_all/linux/setup.sh
chmod +x ~/iot-hub-c-raspberrypi-getstartedkit/sample/build.sh
~/iot-hub-c-raspberrypi-getstartedkit/sample/build.sh
I've verified following the steps above, it builds successfully on various environments.
While trying to use a Ubuntu 14.04 system to cross compile Node.js v0.10.30 for ARM (Raspberry Pi B), I'm experiencing an error message:
Node.js configure error: No acceptable C compiler found!
Please make sure you have a C compiler installed on your system and/or
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.
How should I fix this problem and compile node.js successfully?
Commands used on a fresh Ubuntu 14.04 x64 installation:
sudo apt-get install gcc g++ git
git clone git://github.com/joyent/node.git
cd node
git checkout v0.10.30-release
export AR=arm-unknown-linux-gnueabi-ar
export CC=arm-unknown-linux-gnueabi-gcc
export CXX=arm-unknown-linux-gnueabi-g++
export LINK=arm-unknown-linux-gnueabi-g++
./configure --without-snapshot --dest-cpu=arm --dest-os=linux
I ran into this error as well after trying to run ./configure in my node directory. Here are the commands I ran to get node working for me on an ubuntu server:
cd .. (back to directory where node directory was created)
sudo apt-get install build-essential
cd node/
./configure
make (For relative newbies, like me, this step took awhile to complete, so don't freak out too much if that happens for you)
sudo make install
Then try running your node file from it's directory. As a small aside, I also got the following error when doing that:
Error: ENOENT, stat '/home/ubuntu/local'
at Error (native)
To fix that, I just ran: sudo npm install -g npm
I was required to use: sudo apt-get install npm -g -y in my WSL, VSCode Windows terminal.
I have R 3.4.1.1 on my computer (Linux).
I want to install R version 2.14.1 since the package Rmosek does not work in newer version.
I have downloaded the R-2.14.2.tar.gz from Cran.
My problem is that I do not understand the INSTALL instructions,
It says to unpack the R sources and go to the top directory and issue the following commands:
./configure
make
I wrote the following in a terminal:
tar -zxvf R-2.14.2.tar.gz
cd Downloads
cd R-2.14.2
./configure
It is run but finally gives the error:
configure: error: --with-x=yes (default) and X11 headers/libs are not available
make
and it gives the error:
make: *** No targets specified and no makefile found. Stop.
The file explains that If my make is not called `make', set the environment variable MAKE to
its name, and use that name throughout these instructions. I really do not know how I should do it since I am new in Linux.
Is there any other instruction with more explanation? I would be very thankful in advance for your help or guidances.
Regards,
Shima.
This is answered in detail in the R installation and administration guide,
http://cran.r-project.org/doc/manuals/R-admin.html#Essential-programs-and-libraries
Unless you do not want to view graphs on-screen (or use a Mac) you
need ‘X11’ installed, including its headers and client libraries. For
recent Fedora distributions it means (at least) RPMs ‘libX11’,
‘libX11-devel’, ‘libXt’ and ‘libXt-devel’. On Debian we recommend the
meta-package ‘xorg-dev’. If you really do not want these you will need
to explicitly configure R without X11, using --with-x=no.
More specifically, for Ubuntu, this means:
sudo apt-get install xorg-dev
and then proceed with compiling and installing R.
If you have to compile R in your system and install you should have libx11-dev package installed in Ubunut.Can you check whether this package is installed or not.
Otherwise you can configure the source with this option as a work around solution only in the case if you are not going to use any GUI functionality in R.
./configure --with-x=no
You need to install these libraries:
sudo apt-get install -y libx11-dev \
xorg-dev \
libcurl4-openssl-dev
Then run:
./configure
make
And then it should work.
Good luck!
I'm trying to configure powertop-2.5 but when I run ./configure I get a "configure: error: libnl and libnl-genl are required but were not found" error
I've run
sudo apt-get install libtool autoconf libnl-dev ncurses-dev pciutils-dev build-essential -y
as was recommended by these guys but I get the same error.
I ran
sudo apt-get install libnl-genl-3-dev
Which replaced the previous libnl file but I still get the config error.
According to this, powertop has (or had) problems with detecting libnl but I can't figure out how to fix it.
I'm currently running Linux username 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux
I see you tried libnl-dev, maybe try libnl-3-dev instead:
sudo apt-get install libnl-3-dev libnl-genl-3-dev
Probably the problem is the lack of the pkg-config application in your system (which is used to find the proper dependencies with the configure script). I just have the same problem in a fresh installed Ubuntu 14.04 system, and after installing the pkg-config package the configure script finalized successfully its work. Then I could compile and install the last version (2.6.1) of powertop.
I "solved" my problem by installing powertop-2.0 instead.
The use of pkg-config made the trick. I was able to install Powertop 2.7.