Friday, February 9, 2018

Compile ZeroMQ as static library

On some environment can be useful to have ZeroMq as static library rather than a dynamic one.
In order to create a static ZeroMQ library, follow these steps.

To do so, under ubuntu :
  1. sudo apt-get install build-essential
  2. sudo apt-get install libtool
  3. sudo apt-get install automake
  4. sudo apt-get install autoconf
  5. sudo apt-get install uuid-dev
  6. Download the tarball for the libsodium from the Libsodium website
  7. Extract the tarball in a directory
  8. go in the directory
  9. ./configure --enable-static --disable-shared
  10. make
  11. sudo make install
  12. Download the tarball from the ZeroMQ website
  13. extract the tarball in a directory
  14. go in the directory
  15. ./configure --enable-static --disable-shared
  16. make
  17. sudo make install
At this point is better to close all the terminals and re-open them.

On some systems is better to run :
sudo ldconfig to update the system library cache, otherwise it is requested a reboot of the machine.

Install Czmq

In order to bind the library with the C language is necessary to compile the library Czmq

  1.  git clone
  2.  cd czmq
  3.  ./
  4.  ./configure --enable-static --disable-shared
  5.  make
  6.  sudo make install
  7.  sudo ldconfig

5V Solar Power Supply - testing results

As described in the 5V Solar Power Supply - testing system article, here some results after running tests for a while.

First of all, I did connected the data logger to the battery terminal and let it run for few days, with the load connected, drawing around 350mA.
Here a graph, starting with the battery charged.
Once the battery was depleted, with the load connected there is no way to have it recharged enough.
The weather was good at least for the last two days, so plenty of sun, but even with the 3W solar panel the battery was unable to be charged enough.

This indicates anyway the need to disconnect the DC/DC converter in order to have the battery charged.

Developer tips - CentOS 7 notes

Just a post with some notes to remember what to do when encountering some recurring problems after installing CentOS on a vm for tests.

The scenario : installation CentOS 7 64 bit on VirtualBox (on a Mac)
  1. yum update
    After installation yum update is not working
    Yum returns an error like : "Cannot find a valid baseurl for repo".

    Could be a connection problem and a configuration problem.
    Let try to issue the command : sudo dhclient

    If it solve the problem (i.e. if Yum works as expected) edit the file /etc/sysconfig/network-scripts/ifcfg-enp0s3.
    Change the line ONBOOT=No in ONBOOT=Yes.

    Is possible sudo command will not work (see sudoers below)
  2. Gnome GUI
    Installation of the iso (tested on DVD.iso) does not have a GUI.
    To install Gnome :
    1. yum update
    2. yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
    3. ln -sf /lib/systemd/system/ /etc/systemd/system/
    4. reboot
  3. Sudoers
    Add the user in the sudoers list.
    Assuming to be logged as user, go in the root account using for example ssh.
    1. ssh root@localhost
    2. If the first time type Yes to the request to add the localhost key.
      Then enter the root password
    3. Use the command visudo to edit the sudoers list.
      Locate the root and add below the user with the same levels of access
    4. save