Install Redmine On Ubuntu With Solved Gem BuildError

This post describes in detail on howto install Redmine latest version on Ubuntu 18.04 -x86_64 GNU/Linux system. Redmine is one of the most widely used open source software tool and platform for project management, issue tracking and project execution. With lot of freely available plugins one can also use Redmine as CMS, Invoicing, finance, HR and most of the activities that are involved in small scale software company. If you are startup company and looking for all in one tool Redmine is answer.

This guide is little bit lengthy as there are few workaround during installation, so grab your coffee before you start.

If your system does not have apache server installed then follow step 1, else skip to step 2.

To ensure apache server is installed and running open any webbrowser like mozilla, chrome and type ‘localhost’ if you see “can’t establish a connection to the server at localhost” then you need to install apache else you will see “Apache2 Ubuntu Default Page”

Step 1: Install Apache2 Server on Ubuntu

$sudo apt install apache2 libapache2-mod-passenger

Now that Apache2 is installed, to test whether the web server is working, open your browser and type http://localhost

you will see “Apache2 Ubuntu Default Page”

Step 2 – Get Redmine application

Get the Redmine source code by either downloading a packaged release from download page.

Copy this file to /usr/share

$sudo cp redmine-4.0.3.tar.gz /usr/share/

Then to unpack a tar.gz file, use the tar command from the shell

$sudo tar -xvzf redmine-4.0.3.tar.gz

And remove redmine-4.0.3.tar.gz file from /usr/share. You can now see following folder structure

Redmine 4.0.3 folder structure

you can also check out stable redmine version from svn , by running below command,

$svn co https://svn.redmine.org/redmine/branches/4.0-stable redmine-4.0

Step 3 – Install MySQL and Create an empty Redmine database

Create MySQL database with user name as ‘redmine’

Assuming this is fresh Ubuntu 18.04.2 LTS and MySQL is not installed, execute following command to install MySQL

/usr/share/redmine-4.0.3$ sudo apt-get install mysql-server mysql-client

Once installed check out MySQL version

/usr/share/redmine-4.0.3 $ mysql –version

mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper, Redmine 4.0 does not support for MySQL < 5.5

Note-

Then create empty database – To do this change to sudo user and execute mysql commands as listed out below.

$sudo -i
$mysql 
mysql> CREATE DATABASE redmine CHARACTER SET utf8mb4;
Query OK, 1 row affected (0.01 sec)
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my password';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
Query OK, 0 rows affected (0.02 sec)

Step 4 – Database Configuration

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for “production” environment.

production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "my_password" 

Step 5 – Dependencies installation

This is step you will need coffee 🙂 make sure you have refilled your cup. install Bundler

/usr/share/redmine-4.0.3 $sudo gem install bundler

Then install required Redmine gems, there are 59 gems required at this step

/usr/share/redmine-4.0.3 $sudo bundle install --without development test

/usr/share/redmine-4.0.3$ sudo bundle install --without development test 
Don&apos;t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`. Fetching gem metadata from https://rubygems.org/................ Fetching gem metadata from https://rubygems.org/.. Resolving dependencies...
Fetching rake 12.3.2
Installing rake 12.3.2
Fetching concurrent-ruby 1.1.5
Installing concurrent-ruby 1.1.5
Fetching i18n 0.7.0
Installing i18n 0.7.0
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 5.2.2.1
Installing activesupport 5.2.2.1
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubi 1.8.0
Installing erubi 1.8.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.3
Installing nokogiri 1.10.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri /usr/bin/ruby2.5 -r ./siteconf20190424-9657-1w4lnbg.rb extconf.rb mkmf.rb can&apos;t find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1

Well this is first encounter ‘nokogiri’ has failed To solve this error mannually install ‘nokogiri’ after installing following dependencies

/usr/share/redmine-4.0.3 $sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
/usr/share/redmine-4.0.3$ sudo gem install nokogiri -v 1.10.3 
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.3
Parsing documentation for nokogiri-1.10.3
Installing ri documentation for nokogiri-1.10.3
Done installing documentation for nokogiri after 2 seconds
1 gem installed

Now continue with installing dependencies, Check out our services and offerings at RedmineLab.com

/usr/share/redmine-4.0.3$ sudo bundle install --without development test
Don&apos;t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 0.7.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2.1
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.3
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching loofah 2.2.3
Installing loofah 2.2.3
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching actionview 5.2.2.1
Installing actionview 5.2.2.1
Fetching rack 2.0.7
Installing rack 2.0.7
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 5.2.2.1
Installing actionpack 5.2.2.1
Fetching nio4r 2.3.1
Installing nio4r 2.3.1 with native extensions
Fetching websocket-extensions 0.1.3
Installing websocket-extensions 0.1.3
Fetching websocket-driver 0.7.0
Installing websocket-driver 0.7.0 with native extensions
Fetching actioncable 5.2.2.1
Installing actioncable 5.2.2.1
Fetching globalid 0.4.2
Installing globalid 0.4.2
Fetching activejob 5.2.2.1
Installing activejob 5.2.2.1
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching actionmailer 5.2.2.1
Installing actionmailer 5.2.2.1
Fetching method_source 0.9.2
Installing method_source 0.9.2
Using thor 0.20.3
Fetching railties 5.2.2.1
Installing railties 5.2.2.1
Fetching actionpack-xml_parser 2.0.1
Installing actionpack-xml_parser 2.0.1
Fetching activemodel 5.2.2.1
Installing activemodel 5.2.2.1
Fetching arel 9.0.0
Installing arel 9.0.0
Fetching activerecord 5.2.2.1
Installing activerecord 5.2.2.1
Fetching mimemagic 0.3.3
Installing mimemagic 0.3.3
Fetching marcel 0.3.3
Installing marcel 0.3.3
Fetching activestorage 5.2.2.1
Installing activestorage 5.2.2.1
Fetching public_suffix 3.0.3
Installing public_suffix 3.0.3
Fetching addressable 2.6.0
Installing addressable 2.6.0
Using bundler 2.0.1
Fetching css_parser 1.7.0
Installing css_parser 1.7.0
Fetching csv 3.0.9
Installing csv 3.0.9
Fetching htmlentities 4.3.4
Installing htmlentities 4.3.4
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/mysql2-0.5.2/ext/mysql2
/usr/bin/ruby2.5 -I /usr/local/lib/site_ruby/2.5.0 -r ./siteconf20190424-20515-dxgpwf.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
checking for -lmysqlclient... no

This is second encounter of builderror, here mysql client is missing. You need to install mysql client by running following command

/usr/share/redmine-4.0.3
$apt-get install libmysqlclient-dev
/usr/share/redmine-4.0.3$ sudo bundle install --without development test
Don&apos;t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 0.7.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2.1
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.3
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2.1
Using rack 2.0.7
Using rack-test 1.1.0
Using actionpack 5.2.2.1
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2.1
Using globalid 0.4.2
Using activejob 5.2.2.1
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2.1
Using actionpack-xml_parser 2.0.1
Using activemodel 5.2.2.1
Using arel 9.0.0
Using activerecord 5.2.2.1
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.2.1
Using public_suffix 3.0.3
Using addressable 2.6.0
Using bundler 2.0.1
Using css_parser 1.7.0
Using csv 3.0.9
Using htmlentities 4.3.4
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Fetching net-ldap 0.16.1
Installing net-ldap 0.16.1
Fetching ruby-openid 2.3.0
Installing ruby-openid 2.3.0
Fetching rack-openid 1.4.2
Installing rack-openid 1.4.2
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Fetching rails 5.2.2.1
Installing rails 5.2.2.1
Fetching rbpdf-font 1.19.1
Installing rbpdf-font 1.19.1
Fetching rbpdf 1.19.8
Installing rbpdf 1.19.8
Fetching redcarpet 3.4.0
Installing redcarpet 3.4.0 with native extensions
Fetching request_store 1.0.5
Installing request_store 1.0.5
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
ERROR:  Error installing rmagick:
current directory: /var/lib/gems/2.5.0/gems/rmagick-2.16.0/ext/RMagick
/usr/bin/ruby2.5 -I /usr/local/lib/site_ruby/2.5.0 -r ./siteconf20190424-21434-cp20lm.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc&apos;
to the PKG_CONFIG_PATH environment variable
No package &apos;MagickCore&apos; found
checking for outdated ImageMagick version (<= 6.4.9)... *** extconf.rb failed ***

This is third and last encounter of BuildError and it is for RMagick, one can continue without RMagic by running following command.

RMagick (allows the use of ImageMagick to manipulate images for PDF and PNG export)

If you want to skip the installation of the rmagick gem, then execute below command:

/usr/share/redmine-4.0.3 $sudo bundle install --without development test rmagick

Else you can install ImageMagick after installing its dependency as follows

/usr/share/redmine-4.0.3 $sudo apt-get install libmagickwand-dev
/usr/share/redmine-4.0.3$ sudo gem install rmagick 
Fetching rmagick-3.1.0.gem Building native extensions.
This could take a while...
Successfully installed rmagick-3.1.0
Parsing documentation for rmagick-3.1.0 Installing ri documentation for rmagick-3.1.0
Done installing documentation for rmagick after 1 seconds
1 gem installed
/usr/share/redmine-4.0.3$ sudo bundle install --without development test 
Don&apos;t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/............. Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 0.7.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2.1
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.3
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2.1
Using rack 2.0.7
Using rack-test 1.1.0
Using actionpack 5.2.2.1
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2.1
Using globalid 0.4.2
Using activejob 5.2.2.1
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2.1
Using actionpack-xml_parser 2.0.1
Using activemodel 5.2.2.1
Using arel 9.0.0
Using activerecord 5.2.2.1
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.2.1
Using public_suffix 3.0.3
Using addressable 2.6.0
Using bundler 2.0.1
Using css_parser 1.7.0
Using csv 3.0.9
Using htmlentities 4.3.4
Using mysql2 0.5.2
Using net-ldap 0.16.1
Using ruby-openid 2.3.0
Using rack-openid 1.4.2
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2.1
Using rbpdf-font 1.19.1
Using rbpdf 1.19.8
Using redcarpet 3.4.0
Using request_store 1.0.5
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Fetching roadie 3.4.0
Installing roadie 3.4.0
Fetching roadie-rails 1.3.0
Installing roadie-rails 1.3.0
Fetching rouge 3.3.0
Installing rouge 3.3.0
Bundle complete! 27 Gemfile dependencies, 59 gems now installed. Gems in the groups development and test were not installed. Use `bundle info [gemname]` to see where a bundled gem is installed.

Step 6 - Database schema objects creation

Generate a random key used by Rails to encode cookies storing session data thus preventing their tampering.
$bundle exec rake generate_secret_token

Create the database structure, by running the following command under the application root directory (in my case its -/usr/share/redmine-4.0.3 $):

/usr/share/redmine-4.0.3 $RAILS_ENV=production bundle exec rake db:migrate

This step wil take some time as it creates database schema and strucutre, make sure that username and password is correct in ‘config/database.yml’ file.

/usr/share/redmine-4.0.3# RAILS_ENV=production bundle exec rake db:migrate
== 1 Setup: migrating =========================================================
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- create_table("attachments", {:options=>"ENGINE=InnoDB", :force=>true, :id=>:integer})
-> 0.3043s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- create_table("auth_sources", {:options=>"ENGINE=InnoDB", :force=>true, :id=>:integer})
-> 0.2463s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- create_table("custom_fields", {:options=>"ENGINE=InnoDB", :force=>true, :id=>:integer})
-> 0.3116s
== 20170419144536 AddViewMessagesToAllExistingRoles: migrating ================
== 20170419144536 AddViewMessagesToAllExistingRoles: migrated (0.1432s) =======
== 20170723112801 RenameCommentsToContent: migrating ==========================
-- rename_column(:comments, :comments, :content)
-> 0.1457s
== 20170723112801 RenameCommentsToContent: migrated (0.1458s) =================
== 20180913072918 AddVerifyPeerToAuthSources: migrating =======================
-- change_table(:auth_sources)
-> 0.8880s
== 20180913072918 AddVerifyPeerToAuthSources: migrated (0.8882s) ==============
== 20180923082945 ChangeSqliteBooleansTo0And1: migrating ======================
== 20180923082945 ChangeSqliteBooleansTo0And1: migrated (0.0000s) =============
== 20180923091603 ChangeSqliteBooleansDefault: migrating ======================
== 20180923091603 ChangeSqliteBooleansDefault: migrated (0.0000s) =============

Then insert default configuration data in database, by running the following command: This step will ask to select language. In my case I have selected 'en' for English.

/usr/share/redmine-4.0.3$ RAILS_ENV=production bundle exec rake redmine:load_default_data 

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] en ==================================== Default configuration data loaded.

Step 7 – Test The Installation

Test the installation by running WEBrick web server:

/usr/share/redmine-4.0.3
$bundle exec rails server webrick -e production

http://localhost:3000/

Use default administrator account to log in:

  • login: admin
  • password: admin
Redmine 4.0.3

Above steps explains about how to install latest Redmine on Ubuntu, there is alternative to this mannual installation.

Alternative to manual installation

There is alternative to above steps, if you do not want to go for above lengthy steps one can follow Easy redmine installation stpes on Ubuntu, But keep in mind, this alternative installation step will install –Redmine 3.4.4. And most of the free plugins simply do not work on this redmine version.

Redmine 3.4.4 version

That’s it!

You have successfully installed Redmine on Ubuntu 18.04 and 18.10….

Happy bugging.

Feel free to drop a comment or email @ info@blog.neudeep.com, if you get stuck somewhere, we will try to help you as much as possible. Check out our services and offerings at RedmineLab.com

Install Plugin

Following steps explain about how to install new plugin in to make full use of Redmine. Redmine is powerfull tool but with diffrent plugins its very easy to untilize Redmine’s full power.

Navigate to ‘plugins’ directory of redmine

/usr/share/redmine-4.0.3/plugins $git clone git://github.com/deecay/redmine_pivot_table

/usr/share/redmine-4.0.3 $sudo RAILS_ENV=production rake redmine:plugins:migrate

Test it using webrick server

/usr/share/redmine-4.0.3 $bundle exec rails server webrick -e production

Update Beaglebone Green To Latest Image

It is time to upgrade default image on BBGW – BeagleBone Green Wireless board. This guide details out steps on Update Beaglebone Green To Latest Image. My default image on BBGW is “BeagleBoard.org Debian Image 2016-06-14”. The command dog cat will tell you what image you are at in BBGW. $cat /etc/dogtag
The default Wi-Fi access point password for latest flasher images is “BeagleBone-A490”. This image comes as default when you buy BBGW in India. Few of the reason to upgrade to new image is, Difficulty in connecting to internet with old image. New uEnv.txt format will not work on this image, and you will have difficulty while communicating with UART, I2C and other peripherals. There are quite guides on Writing a new Image to the Beaglebone black but very few about beaglebone green wireless.

If you are looking for answers to the question like, How do I update my BeagleBone? or How do you flash a BeagleBone green? Upgrade to latest image is very simple.

BBGW Preparation For Upgrade

Make a backup of your custom stuff. If you are working on BBGW for some time, then your custom stuff will in home folder. It’s good to have a backup. Once you re-flash you can install the packages you need and put custom stuff. I suggest to create shell script for the packages you install.

Steps – Update Beaglebone Green To Latest Image

Beagle bone green wireless board upgrade to latest flasher image is simple three step process.

Step 1 –

Easiest way to re-flash to the latest system is by downloading the latest firmware flasher image. The latest flasher image “AM3358 Debian 10.3 2020-04-06 4GB eMMC IoT Flasher” from the “Flasher Debian images” section.

Step 2-

Write this image to sd card using Etcher (etcher.io)

BBGW upgrade to latest flasher image

Step 3 –

Now insert this SD card and boot BBGW from this new image. If you boot the beaglebone from SD card, it will automatically proceed to erase and reflash the eMMC.
But wait, since the current system is very old, to get it to boot from the sd card it is required to power on with the S2 button held down (the one closest to the sd card) during power-on, you can let go of the button once any LED’s turn on. Once booting process starts, user LED’s will start blinking to create sequence.
After 20-25 minutes LED’s will stop blinking. Once upgrade is completed, all the LED’s on the BBGW including power LED will be off.

Troubleshooting BBGW Connection –

Unplug BBGW power, take out SD card and plug in power to BBGW. Once BBGW powers up login to BBGW using following command.

$ ssh debian@beaglebone
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for beaglebone has changed,
and the key for the corresponding IP address fe80::e615:f6ff:fefd:a492%59
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:TregYNPVgnma80ovgoaiICs0rjjpHm4FwYt+90chs/Y.
Please contact your system administrator.
Add correct host key in /c/Users/Admin/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/Admin/.ssh/known_hosts:10
ECDSA host key for beaglebone has changed and you have requested strict checking.
Host key verification failed.

This was working with old image, since this is new image, login to begalebone using “beaglebone.local”

ssh debian@beaglebone.local

Once you are in check out dogtag and you should see the latest buster IoT image

debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Buster IoT Image 2020-04-06

Now that you are connected to BBGW, lets try to update using – apt-get update.

debian@beaglebone:~$ ping google.com
ping: google.com: Temporary failure in name resolution
debian@beaglebone:~$ cat /etc/resolv.conf
Generated by Connection Manager

This implies that, BBGW is not connected to internet.

Setup WiFi on BBGW

We will be setting up WiFi using “connmanctl”, there are other ways, but since BBGW provides this utility lets use it.

debian@beaglebone:~$ connmanctl state
State = idle
OfflineMode = False
SessionMode = False

Above command output confirms that BBGW is not connected to internet.

BBGW connmanctl
debian@beaglebone:~$ connmanctl
Error getting VPN connections: The name net.connman.vpn was not provided by any .connmanctl> enable wifi
Error wifi: Already enabled
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
SARVESH wifi_64694e0e8e55_53415256455348_managed_psk
Gowda wifi_64694e0e8e55_476f776461_managed_psk
wifi_64694e0e8e55_hidden_managed_psk
connmanctl> agent on
Agent registered
connmanctl> connect wifi_64694e0e8e55_53415256455348_managed_psk
Agent RequestInput wifi_64694e0e8e55_53415256455348_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
WPS = [ Type=wpspin, Requirement=alternate ]
Passphrase? <your wifi password>
Connected wifi_64694e0e8e55_53415256455348_managed_psk
connmanctl> quit

Hope you have enjoyed reading on how to update Beaglebone Green To Latest Image.

BBGW And MQTT Broker Using Desktop

In the previous post we have seen different ways to connect BBGW – BeagleBone Green Wireless board with Wi-Fi and unboxing BBGW for the fist time. This post is about how to test BBGW and MQTT Broker using desktop or laptop.

When building IoT applications it is good practice to send test data using your desktop or laptop. This makes sure that your IoT application built using either flutter or android works fine. This will also help to reduce the waiting time for actual firmware and hardware getting ready. The mobile application developer can test and run his application without actual hardware. This technique can save you a lot of time and energy for the rest of your project development.

MQTT Setup On Desktop

To perform this test driven development of your IoT product using MQTT we need some MQTT broker. I have installed MQTTLense a chrome extension for testing MQTT applications.

MQTTLense is Google Chrome application, which connects to a MQTT broker and is able to subscribe and publish to MQTT topics. This will help for using the MQTT Monitor to view messages to the MQTT broker.

MQTTLense Installed

On your BBGW board install mosquitto service and confirm if its running. I assume you have already installed mosquitto broker on your BBGW.

t@beaglebone:~# sudo service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto)
Active: active (running) since Sat 2021-07-03 02:20:34 UTC; 12h ago
CGroup: /system.slice/mosquitto.service
└─340 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Jul 03 02:20:33 beaglebone mosquitto[318]: Starting network daemon:: mosquitto.

After installing and launching the application, click on the “+” button to add a new connection. Fill in the connection name as BBGW. This name can be anything of your choice. Fill in the IP address of beaglebone green wireless board. Rest other details are not required to update, click on the “CREATE CONNECTION” button.

MQTT Lense Create connection for BBGW

This will create new connection with BBGW and if it is success MQTT Lense will show it as Connection established to 192.168.0.106. Here 192.168.0.106 is my BBGW IP address.

MQTT Lense Connection established to BBGW

Send And Receive Message

Now connection is successfully established to MQTT broker running on BBGW, I can send (publish) data to BBGW device. On BBGW side I have subscribed to “test” topic. From MQTT Lense send message on this topic. This will receive message to BBGW device side.

@beaglebone:~# mosquitto_sub -h localhost -t "test" -v
mosquitto received message on BBGW

To send data from BeagleBone Green Wireless device to MQTTLense, First MQTTLense should subscribe to topic from BBGW board. Here I have created new topic as “test_bbgw” on MQTTLense and click on subscribe. On BBGW side publish message on this topic.

beaglebone:~# mosquitto_pub -h localhost -t "test_bbgw" -m "testing from BBGW"
From BBGW to MqttLense

The message payload and topic can be complex, in this example I have used simple topic name and message payload. Now you are sure that your application modules setup works fine over mqtt. This method helps you to debug MQTT programs and test it. Hope you have enjoyed this post on BBGW And MQTT Broker Using Desktop.

How To Connect BBGW To Internet

This post covers getting started with Beaglebone Green Wireless and connecting to internet using BBGW Wi-Fi. Received BBGW (BeagleBone Green Wireless) a customized BeagleBone from SeeedStudio. If you have used BBB (BeagleBone Black) then you might notice few difference like there is no 5V DC Jack socket in BBGW. I had trouble connecting to internet from BBGW. Lets get started with How To Connect BBGW To Internet.

If you have LCD cape and USB keyboard, you can setup Wi-Fi easily on BBGW. Lets get started with setting up without LCD cape and using command line.

First Power Up BBGW

There are lot of guide on setting up BBGW via USB. It is pretty straightforward, connect the USB to your computer/laptop, It will boot Linux from onboard eMMC. Wait for some time to see Wi-Fi access point on Wi-Fi, it will appear as “BeagleBoneXXXXXX”. Connect to this Wi-Fi and you will get default page asking for SSID of your Wi-Fi and enter the password.

BeagleBone Green Wireless Setup

This will setup your BBGW. Note down the IP address from this page as you will require to ssh. The detailed steps are available at seedstudio wiki. So far it is good and all steps works as mentioned. Once you press “done” it will redirect to “support” page. On this page you can connect to your BBGW board and run LED blink program from the browser itself. Its pretty cool to use BoneScript provided by BBGW to try and test your LED blink program.

Connect To BBGW

Here will check different ways to connect to BBGW. I had connected using default steps. I had verified if BBGW is connected or not. It will show display at the top of the BeagleBoard page like this:

Connect using Cloud9 IDE – You can connect to BBGW using Cloud9 IDE as well, just type http://192.168.8.1:3000 and you are connected to BBGW.

Cloud9 connected to BBGW

Connect using SSH – From the previous section you can easily ssh to BBGW.

$ ssh root@192.168.0.106

Just hit enter, as there is no default password for root. If you are doing ssh using default. The default username:password is [debian:temppwd].

BeagleBone Green Wireless Connect To Internet

So far, everything went rather smoothly, but setting up networking was more of a challenge. Before we get into details, I have tried to upgrade flasher image to latest image.

My default image on BBGW is “BeagleBoard.org Debian Image 2016-06-14”. The command dog cat will tell you what image you are at in BBGW, “cat /etc/dogtag”. The default Wi-Fi access point password for latest flasher images is “BeagleBone”.

When I tried to run apt-get update

@beaglebone:~# sudo apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign https://deb.nodesource.com jessie InRelease
Ign http://repos.rcn-ee.com jessie InRelease
Ign http://httpredir.debian.org jessie InRelease
Ign http://httpredir.debian.org jessie-updates InRelease
Err http://security.debian.org jessie/updates Release.gpg
Unable to connect to security.debian.org:http:

It is saying “unable to connect to repos.rcn-ee.com. The next thing I tried is to ping “googl.com” but with no response.

@beaglebone:~# ping google.com
PING google.com (172.1.8.1) 56(84) bytes of data.
From 192.168.0.105 icmp_seq=1 Destination Host Unreachable
From 192.168.0.105 icmp_seq=2 Destination Host Unreachable
From 192.168.0.105 icmp_seq=3 Destination Host Unreachable

This start to google and verify network settings for BBGW. I had two options: change the routing table or route the traffic through my laptop. Wi-Fi settings can be verified using “connmanctl”.

connmanctl> enable wifi
Error wifi: Already enabled
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
*AO SARVESH              wifi_2cf7f106b7a1_53415256455348_managed_psk
Gowda                wifi_2cf7f106b7a1_476f776461_managed_psk
connmanctl> agent on
Agent registered
connmanctl> connect wifi_2cf7f106b7a1_53415256455348_managed_psk
Error /net/connman/service/wifi_2cf7f106b7a1_53415256455348_managed_psk: Already connected
connmanctl> quit

In order to route BBGW traffic via my laptop, I have updated Wi-Fi properties on my laptop to allow other network users to connect through my computer’s internet connection.

 cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 0.0.0.0
nameserver 192.168.0.1
nameserver 8.8.8.8

This did not work well.

@beaglebone:~# ping google.com
PING google.com (172.1.8.1) 56(84) bytes of data.
From 192.168.0.105: icmp_seq=36 Redirect Network(New nexthop: 192.168.0.1)
From 192.168.0.105: icmp_seq=39 Redirect Network(New nexthop: 192.168.0.1)

Then next option is to change the routing table and add details in /etc/network/interfaces. I had edited interfaces file using vi.

auto wlan0
iface wlan0 inet static
address 192.168.0.222
netmask 255.255.255.0
gateway 192.168.0.1
wpa-ssid {ssid}
wpa-psk {password}

Here I had specified static IP to the BBGW so that, I can easily SSH to BBGW. With this change most of the things broken and now I am not able to ping to BBGW also. It is not showing IP address on the start page now.

It just says, board is ready and can’t display my Wi-Fi access point. This point I can’t ping to previous board IP. But there is workaround for this and you can do SSH using SoftAp0 IP. SSH to the BBGW using SoftAp0 and revert back the changes in /etc/network/interfaces file.

$ ssh root@192.168.8.1

Now both the methods have failed so we had contacted IRC channel (#beagle). The problem seems to be with nameserver.

root@beaglebone:~# connmanctl state
State = online
OfflineMode = False
SessionMode = False
root@beaglebone:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether e4:15:f6:fd:a4:91 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.2/24 brd 192.168.7.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::e615:f6ff:fefd:a491/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 2c:f7:f1:06:b7:a1 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.106/24 brd 192.168.0.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::2ef7:f1ff:fe06:b7a1/64 scope link
valid_lft forever preferred_lft forever
4: SoftAp0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e4:15:f6:fd:a4:90 brd ff:ff:ff:ff:ff:ff
inet 192.168.8.1/24 brd 192.168.8.255 scope global SoftAp0
valid_lft forever preferred_lft forever
inet6 fe80::e615:f6ff:fefd:a490/64 scope link
valid_lft forever preferred_lft forever
root@beaglebone:~# ip route
0.0.0.0 via 192.168.0.1 dev wlan0
default via 192.168.0.1 dev wlan0
192.168.0.0/24 dev wlan0  proto kernel  scope link  src 192.168.0.106
192.168.0.1 dev wlan0  scope link
192.168.7.0/24 dev usb0  proto kernel  scope link  src 192.168.7.2
192.168.8.0/24 dev SoftAp0  proto kernel  scope link  src 192.168.8.1
root@beaglebone:~# cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 0.0.0.0
nameserver 192.168.0.1

The router (TP-Link) is telling the BeagleBone that the nameservers are “0.0.0.0” and “192.168.0.1”. The other devices in network connects to next nameserver when “0.0.0.0” is not reachable. This is not working in case of BBGW as somehow “0.0.0.0” isn’t reachable and BBGW is not trying to the next dns server.

The solution is to set the nameserver for BBGW. This will be done using “connmanctl config SERVICE nameservers 192.168.0.1. Here SERVICE is the name of your Wi-Fi connection, shown by “connmanctl services” (in the right column)

connmanctl> services
*AO SARVESH              wifi_2cf7f106b7a1_53415256455348_managed_psk
connmanctl> config wifi_2cf7f106b7a1_53415256455348_managed_psk nameservers 192.168.0.1
connmanctl> exit
root@beaglebone:~# ping google.com
PING google.com (142.250.67.238) 56(84) bytes of data.
64 bytes from bom07s24-in-f14.1e100.net (142.250.67.238): icmp_seq=1 ttl=116 tim

This shows updated nameserver entries in “/etc/resolv.conf” file.

@beaglebone:~#  cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 192.168.0.1

With this I am able to finally run apt-get update on my BeagleBone Green Wireless board. Hope you have enjoyed this How To Connect BBGW To Internet short guide.

You can connect your BBGW using “ssh debian@beaglebone” and/or “ssh debian@beaglebone.local”, Enter password as “debian:temppwd”. if you use multiple beaglebones, be sure to give them individual hostnames with “ sudo hostnamectl set-hostname HOSTNAME ” (replace HOSTNAME by the desired name for the beaglebone).

systemctl status $(pidof gpsd)

WordPress Error Establishing Database Connection

There are lot of good articles on web with generic solutions to the problem of WordPress Error Establishing Database Connection, this post discuss about issue occurred during site migration to latest webhosting server.

WordPress Webserver Environment

This issue is related to wordpress site migration to new cloud hosting server. The old webhosting server has following configuration

The PHP version associated with wordpress site as PHP 5.3, WordPress version is 5.1.8 and MySQL version 5.1 which is also deprecated. The current website is running good from past few years, but with recent development it was required to upgrade. Since few plugins were not supported on PHP 5.3 and so we have decided to migrate the wordpress website to new cloud hosting server with PHP 7 and MySQL version 5.6.

Solution Approach

We have migrated to new webhosting server with old PHP 5.3 and MySQL 5.1 version. This is to test and verify the website works well on new environment.

Once this is tested, we have switched to new PHP version ie from PHP 5.3 to PHP 7.2.34. Please note before you do this change, don’t forget to take backup of your website either by using some good plugins like ‘updraftplus‘ or ‘export’ option form tools. Also take backup of your databse using phpMyAdmin tool provided by your webhosting company or take databse backup from command line.

Error Location

While most of the online sources will point you to wp-config.php file for verifying DB credentials. In our case DB details were correct since we were able to access DB using phpMyAdmin. Still we were getting following error message

mysqli_real_connect(): (HY000/2002): Permission denied in /home/yoursite-com/public_html/wp-includes/wp-db.php on line 1612

To view this error you need to add following lines in ‘wp-config.php’ file

/*define( 'WP_DEBUG', false );*/ 
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

This will enable logging and you can view the log file as ‘debug.log’ in ‘wp-content’ folder.

Simple Solution

While all the database details were correct and still it was giving database error. So in wp-config.php, Use the IP address of your local server instead of localhost . That means set 127.0.0.1 at DB_HOST in wp-config.php . So the solution will be like-

/** MySQL hostname */
define('DB_HOST', '127.0.0.1');

After this change reload your webpage, and you can login to admin page. First thing you should do here is upgrade wordpress to latest version. Please note wordpress shows latest PHP version now. For first time upgrade it will show error for databse needs upgrade. Click on upgrade and refresh the page. For some time your site will be in recovery mode. But it will load up once upgrade is complete. The site still needs MySQL latest version and don’t forget to disable debug mode from wp-config.php. I am sure there are various solution that works out for you on this WordPress Error Establishing Database Connection, for example entering correct databse details, deleting DB user and creating new DB user, changing database host from localhost to exact host provided by webhosting provider etc, so let us know which solution worked for you while connecting to database using wordpress wp-config file.

Touch Less Elevator New Norms of Life

We at Neudeep Technologies Pvt. Ltd. continue to innovate and as part of our innovations we are happy to announce launch of touchless elevator for your needs. This is part of one of our product series  #IEC1000 (Intelligent Elevator Controller). We are proud to say “made in India” by startup company in Pune, India.

As we continue to navigate with new norms of life during these pandemic times, the vertical transport industry has continued to innovate new products and features. One of such feature is, touch less technology. Touch less technology is especially attractive options in this current pandemic environment. An example of touch less technology is our own product ie touch less elevator. This enables passengers to use their cell phone as their personal elevator call button. This is also sometimes called eCall. This eCall helps minimize use of public access to elevator buttons.

This QR code based touch less elevator/lift can act as destination dispatching system, which can help minimize the number of stops per trip, reduce car crowding and decrease travel times and saves energy.

This QR code based system is ready to integrate with security and community management app for gated premises like MyGate, ApnaComplex and NoBrokerHOOD. Neudeep’s IEC1000 touchless elevator software with mobile app integrated with MyGate, ApnaComplx or NoBrokerHOOD will help residents as well as the management committee in handling gate security for visitors. When integrated with these apps Neudeep’s touchless elevator system will act as access system, where visitors movement will be restricted to their destination floor only.

Below is short video of our invention.

Thank you for watching. If you are looking for such solution to be implemented at your place email your details at info@blog.neudeep.com

Ubuntu To Debian Upgrade Issues

If you have received following message from dreamhost on VPS upgrade and your Ruby apps are broken then here are few tips that might save your day. “We will be upgrading your Virtual Private Server from version 14.04 (also known as trusty) to Debian 9.12 (aka Stretch!) “. Yes as they mentioned in their email that there are some environment changes that effect your system if you are using Ruby, Python, PHP, or run a site that relies heavily on specific server packages. Lets start with Ubuntu To Debian Upgrade Issues on VPS of Dreamhost.

This post will help you only if you have already installed redmine on dreamhost VPS and your server is now upgraded to Debain Stretch.

SVN Write Issue on Debian Stretch

First error you will see is, related to SVN. If you have SVN on VPS then your will see that you do not have write permission anymore. To solve this you can go to more -> subversion, select the SVN repo, click on edit and then click on update my repo now. Check your write permissions after 5-10 minutes.

If this trick did not help you, then please write to dreamhost support team and they will change the settings from backend.

Django MySQL Issue

If you are running application with Django and MySQL as database then with this upgrade it will not work.

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory.
Did you install mysqlclient or MySQL-python?

As per suggested solution by deleting pip .cache directory, it will still shows error. For this issue we did not found solution yet, but as workaround we have created backup databse in sqlite and started using Django with sqlite. Please note with Ubuntu 14.04, Sqlite was not working so we have no choice other than to use MySQL, but with this new server upgrade Sqlite is working.

Ruby Apps Issue On Debain VPS

First issue you will encounter is openssl issue on Debian server. This is because openssl library is changed on the Debian Stretch server. You will need to reinstall the version of ruby that you had with rvm which was installed on Ubuntu. Once this is done you need to install ruby gems again to allow your rails site to work.

$gem list
Error loading RubyGems plugin "/home/ilmp_app/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/rubygems_plugin.rb": libssl.so.1.0.0: cannot open shared object file: No such file or directory - /home/ilmp_app/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/x86_64-linux/openssl.so (LoadError)
Error loading RubyGems plugin "/home/ilmp_app/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/gem-wrappers-1.4.0/lib/rubygems_plugin.rb": libssl.so.1.0.0: cannot open shared object file: No such file or directory - /home/ilmp_app/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/x86_64-linux/openssl.so (LoadError)

To solve this error, you need to uninstall rvm and re-install.

$ rvm uninstall 2.6.0
$ rvm install 2.6.0

Now reinstall bundler and then reinstall your old gems else you could see following errors

find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/ilmp_app/ilmp.neudeep.com/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run bundle update –bundler . To install the missing version, run gem install bundler:2.1.4`

$ gem install bundler
$ bundle update

Now you are all set to run the ruby application. Bundle update will take care of mysql2 issue as well.

 when i start my application it is giving me error for libmysqlclient.so 
/home/spsm01/.rvm/gems/ruby-2.6.0/gems/mysql2-0.5.2/lib/mysql2.rb:33:in `require': libmysqlclient.so.18: cannot open shared object file: No such file or directory - /home/spsm01/.rvm/gems/ruby-2.6.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.so (LoadError)

Once you re-install as per above instructions your Django and Ruby application on the newly upgraded server should work as normal. Thats all Ubuntu To Debian Upgrade Issues we have faced, let us know if you have faced any new issues apart from above mentioned one.

Reference links:

Flutter Dart:

Flutter 3D Buttons:

https://medium.com/flutterpub/anatomy-of-material-buttons-in-flutter-first-part-40eb790979a6

Flutter Latest news:

https://medium.com/flutter/two-months-of-fluttergoodnewswednesday-a12e60bab782

Build flutter app:

https://www.youtube.com/watch?v=x0uinJvhNxIhttps://flutter.dev/docs/get-started/codelab

Flutter toggle color after click:

https://stackoverflow.com/questions/50863681/flutter-how-do-i-toggle-the-color-of-a-raisedbutton-upon-click

Flutter on codePen:

https://codepen.io/flutter

Flutter gridlist examples:

https://flutter.dev/docs/cookbook/lists/grid-lists

Fetch data from server in flutter:

https://flutter.dev/docs/cookbook/networking/background-parsing

https://medium.com/flutterdevs/parsing-complex-json-in-flutter-b7f991611d3e

UX Design in flutter:

https://uxdesign.cc/flutter-design-challenge-onboarding-concept-1f5774d55646

Get the data from API:

https://medium.com/flutter-community/parsing-complex-json-in-flutter-747c46655f51

Flutter time series:

https://stackoverflow.com/questions/51739064/flutter-json-and-time-series-charts

Flutter dart packages:

https://www.w3adda.com/dart-tutorial/dart-packages

Flutter dart introduction:

https://www.w3adda.com/dart-tutorial/dart-introduction

https://openlibrary.org/works/OL17556930W/Android_Fully_Loaded

https://archive.org/details/unlockingandroid0000able/page/n5?q=Build+android+os

Create mock server using postman:

https://learning.postman.com/docs/postman/mock-servers/setting-up-mock/

Web Socket examples:

https://www.websocket.org/echo.html

Energy consumption calculator:

https://www.rapidtables.com/calc/electric/energy-consumption-calculator.html

Git hub basic course:

https://www.udemy.com/course/git-and-github-crash-course-creating-a-repository-from-scratch/

Install svn on ubuntu:

https://linuxtechlab.com/simple-guide-to-install-svn-on-ubuntu

Flutter line chart,bar & pie chart:

https://pub.dev/packages/fl_chart

https://google.github.io/charts/flutter/example/bar_charts/simple.html

https://www.digitalocean.com/community/tutorials/flutter-bar-charts

https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/pie_chart.md#sample-1-source-code

Flutter list & grid view link:

https://medium.com/@vignesh_prakash/flutter-listview-and-gridview-with-tabbar-221516518c75

Flutter Page color link:

https://medium.com/flutter-community/a-deep-dive-into-pageview-in-flutter-with-custom-transitions-581d9ea6dded

Flutter page control link:

https://api.flutter.dev/flutter/widgets/PageController-class.html

STM32 ABSTRACT

STM 32 MCU and MPU Roadmap contains:

1. MPU (STM32MP1):

– MPU with Arm Cortex-A7 650 MHz, Arm Cortex-M4 real-time coprocessor, TFT display, – Secure boot and Cryptography.

– Combination of audio and real time processing with cortex A and M architecture.

-STM32Cube AI tool running on cortex M4.

– Camera and audio interfaces to simplify input device integration.

Application: Used for real time and low power application and also graphic and communication high performance processing. Provide cloud based , making Smart home gateway with advance HMI and HD video.

2. High Performance MCUs(STM32F2, STM32F4, STM32FH7, STM32F7):

These MCUs are available in single core as well as dual core. A7 type having large of flash and Ram is provided.

STM32H7 having 280 Mhz embedding 2 MB flash ,1.4 MB RAM

Application: graphics applications, could connectivity, lot of security features.

Industry – Inverters, Communication gateway, Human Machine Interface

Health and Wellness- Individual assistance(hearing, Respiratory) , Measurements and Data logger.

Consumer – IOT gateway (Large Memory and rich communication peripherals), Access Control (Chrome-ART accelerator and display interfaces for TFT and MIPI-DSI), Drones(High Processing architecture with dual core option, advance timers and analog peripherals, small packages).

3. Mainstream MCUs(STM32F0,STM32G0,STM32F1,STM32F3,STM32G4):

– These are used for general purpose application having main feature as low power consumption which can take <100uA current.

– Main features is:

Efficient: Compact Cost,Best RAM/Flash Ratio, Smallest posiible package down to 8 pin,low power consumption, Accurate internal high speed clock best optimization

Robust: Low electromagnetic susceptibility, clock monitoring and 2 Watchdog, Error correct on flash, IOT ready with embedded security, Safe firmware upgrade/Install

Simple: Easy to configure with STM32CubeMx, Graphics, Easy to develop based on hardware abstraction library(HAL) or low layer library (LL).

Application:(STM32G0)

Lighting: High temperature, Advance timers, fast comparators ADC, DAC, AES and Security

Consumer Objects(Smart phones, IoT devices, Rechargeable connected devices,Drones,toys):

Low consumption in run and low power,USB type C power delivery, 64 Mhz CPU with DMA.

Smart Home(Home Appliances, Alarm and safety, Advance User Interfaces): High temp, safety monitoring feature, more RAM for flash , low consumption.

Industrial devices Motor control, Advance control(Air conditioning, E-bikes, Industrial Equipment): High temp, CANFD support, SPI,USART,I2C,Advance timers, RTC with backup register, AES and upgrade security

STM32G4: Having Se-curable memory area with configurable size, can be secured once exiting(no more access nor debug possible), Good fit to store critical data (critical routines, keys)

4. Ultra low power MCUs(STM32L0,STM32L1,STM32L5,STM32L4,STM32L4+):

STM32L0 (Cost Smart ULP champion):8/16 bit application,wide range of pin counts, 3 Product lines, Cost-effective, small packages, USB, LCD,Analog 8 to 192 kbytes of Flash, upto 20 kbytes of SRAM .

STM32L1(Broad Range Foundation): wide choice of memory sizes, 3 product lines, USB, LCD, AES rich analog EEPROM , Dual bank flash memory , 32-512 kbytes of flash up to 60 kbytes of SRAM.

STM32L4(ULP with performance) : High performance advance analog circuit, 5 product lines, 5 MSPS ADC, compare,DAC, Op-Amp,USB, OTG,LCD, AES, 64 kbytes to 1 mbyte up to 320 kbytes of SRAM.STM32L4+(ULP with More performance): Wide choice of memory size,3 product lines, 5 MSPS ADC, compare, DAC, Op-Amp,USB, OTG,LCD, AES, 1 to 2 mbyte of flash upto 640 kbytes of SRAM.

STM32L5(Advance Security): Wide choice of memory size,1 product lines, 5 MSPS ADC, compare, DAC, Op-Amp,USB type C, AES, 256 to 512 kbyte of flash upto 2560 kbytes of SRAM.

Type of Security:

Logical attack:

-malicious code injection

-Malware replacing the genuine program

-Man-in-the-middle attack

Board level attack:

-Cloning attack

-Fault injection

-Side channel attack

For such type of attack STM32L5 provided Hardware isolation, Secure key storage, Encryption, Authentication, IP protection, read out protection, active tempering, certified crypto library.

Application:

Smart peripherals ( fitnes tracker-wristband): ADC, OPAmp, DAC, SAI, SPI/UART, I2C, Display.

Smart peripherals (industrial sensors): High temp, SPI,UART, SPI/UART, I2C, TRNG and AES, FSMC, I/Os, CAN, Motor control, Display.

5. Wireless MCUs(STM32WL,STM32WB):

-Fully certified Bluetooth 5.0 radio

-2x faster speed with 2 mbps capable mode

-Extend network coverage with BLE mesh

-open Thread, zigbee 3.0

STM32WB:

Provides open 2.4 Ghz radio multi protocol, Dual core/ full cobtrol ultra power , IoT protection ready, Massive integration, cost saving, Advance RF tool, Energy control with C code generation.

Flash/RAM memory: 1 M/128 k

Application(LPWAN technology selection): Agriculture, Low value object tracking, lighting smart meter, utility maintenance, smart parking, smart building, smart grid, smart watch, High value object tracking, Connected Cars

STM32GO Architecture:

Why STM32G0 ?

1)Thinner technology,more integration & enhanced technologies.
2)Bigger flash in small packages.
3)1% internal clock.
4)1 power supply: Less external capacitors.
5)IO Maximization: smallest package eligible.

STM32G0 Subsystems::

Following are the features of STM32G0 :

1)Maximum speed upto 64Mbps
2)Flash memory interface of 1kb
3)32 timers each of 16 bit.
4)USB Power delivery.
5)Error code correction for 8 bits long for a 64-bit word.
6)12 bit ADC.
7)2 KBYTE of page granularity
8)Pre-fetch & instruction cache.(To improve performance)

Boot Pin configuration::

Boot configuration is selected as per areas given below:
1)Main flash memory
2)System memory
3)Embedded SRAM
4)Main Flash memory
5)System memory
6)Embedded SRAM.
7)Main Flash memory forced.

Note:It is possible to force booting from flash memory.

Reset Sources:

No external components are needed due to internal filter and power monitoring.System Reset sources can reset external components.

System Reset:

Resets all registers except certain RCC Registers and the RTC domain.
The reset Source flag is in the RCC_CSR register.

DMA Configuration :

1)DMA support for timers, ADC, and communication peripherals.
2)Offloads CPU from data transfer management.
3)Simple Integration.

ADC Overview :

1)12 bit ADC with 19 input channels.
2)Over-sampler.
3)2.5 Msample/sec max (12 bit resolution)
4)Interrupt generation.

Application benefits:
1)Ultra-low power consumption: 118uA @ 1 Msample/s.
2)Flexible trigger,data management to offload CPU.

System Clock :

1)Selected between HSI16,HSE,PLL,LSI and LSE.
2)System clock AHB nad APB maximum frequency:64 MHZ

RNG(Random Number Generator) overview:
1)Used when producing an unpredictable result is desirable.
2)32-bit Random number generator based on a noise source.

Application benefits:
1)Increase the randomness of numbers.
2)Strongly decrease the possibility of guessing values.

Application examples are :
Cryptography and games.

AES overview:

Transforms original text called plaintext to unreadable text called ciphertext using a secure encryption key.Supports many standard operation modes and two key sizes(128 or 256 bits).

Application benefits:
1)Protects confidentiality and /or authenticity of data.
2)Reduces cpu processing time.

Securable memory area:
The main purpose of securable memory area is to protect some part of the flash memory against undesired access.

USART

Can be configured as:
i)UART
ii)SPI master/slave
iii) Smartcard
iv)IrDA SIR
v)LIN
vi)Modbus

Application benefits:
1)Multipurpose communication peripheral.
2)Simple hardware,Only a few pins needed.
3)Wakes from low power mode.
4)Transmit and Receive FIFOs, with capability to transmit and receive in stop modes.

LPUART
Low Power Universal Asynchronous Receiver/Transmitter.Full UART communication at 9600 baud with wake up from stop modes capability when using the low speed 32.768kHz external oscillator. Higher baud rates are available with other clock sources.

Application benefits:
Inexpensive communication link between devices.
Simple hardware,only a few pins needed.
Wakes from low power STOP modes.
Transmit and receive FIFO’s ,with capability to transmit and receive in stop modes.

ART Accelerator:

Pefetch queue and branch cache principle:
Stores the first instruction and constant of branches and interrupts events.
Push them in the prefetch queue in the next time those events occur,with no execution penalty.

Chrome ART:

Provides hardware acceleration for graphical operations.

Application benefits:
Offloads CPU for graphical operations.
One pixel per cycle calculation.
Integrated pixel format converter and blender
Simple integration through graphical stack.

Batch Acquisition mode:
Only the needed communication peripheral + 1DMA +1 SRAM are configured with clock enables in sleep mode.
Flash memory is put in power down mode and flash clock is gated off during sleep mode.
Enter either sleep or Low-power sleep mode.

STM32 Cube IDE:

(Integrated Development Platform for STM32 Embedded Solutions)

STMicroelectronics is a semiconductor provider

• STM32 is μC & μP general purpose brand

• Arm© 32b CPU(s) based

• Part of worldwide top 3 μC vendors

• More than x32 μC unit sold per second

• STM32 devices are augmenting our daily life

• Kitchen appliances, power plugs, audio headsets,white appliances, car facilities, energy smart grid, E-city facilities, E-toys, E-cigarettes, E-bicycles, E-watches, …

Advanced-cache.php Already Exists Warning

Everything was broken when we tried to install yet another WP cache plugin. All the tabs and pages from admin panel are showing advanced-cache.php already exists warning.

Warning!
The file ../../wp-content/advanced-cache.php already exists. Please manually delete it before using this plugin.

Origin

Most of the wordpress installation done from dreamhost will have wp super cache plugin installed. This plugin will speed up wordpress blog, and so is recommended. If you do not have cache plugin installed then your wordpress blog will eat up lot of RAM(memory). There are multiple cache plugins available. We were trying out different plugins other than wp super cache. We tried to install hyper cache. Other than hyper cache there are tons of cache plugins, like, wp rocket, w3 total cache, WP fastest cache, Hummingbird page cache, & PageSpeed Ninja and so on.

Well, If you try to install another cache plugin without fist disabling current plugin then you will start to see this warning.

Solution for advanced-cache.php already exists warning

There are multiple solutions available for this warning. Like do FTP or ssh login to your server and remove folder from ‘plugins’ directory. or manually copy the file from the plugin folder ‘wp-content/plugins/wp-super-cache/advanced-cache.php’ to ‘wp-content folder’. And last one suggested to define ‘WP_CACHE’ constant to ‘false’ in ‘wp-config.php’. But none of the solution worked out in our case.

So, we have to do it hard way by editing database table. Login to dreamhost panel, navigate to ‘more’->’MySQL Database’ Click on phpMyadmin link in front of your database. Please note your database username and password will be different from your wordpress credentials. Login to your database and select ‘wp_3cajzx_options’ table. Search for ‘active_plugins’ in option_name as shown in below image.

Under ‘option_value’ you can see that, WP Super cache and Hyper Cache entries are there. First delete ‘hyper cache’ entry and re-order the indexing for ‘i’.

i:5;s:20:"wp-super-cache/plugin.php";i:6;s:22:"hyper-cache/plugin.php";i:7;s:19:"jetpack/jetpack.php";

Corrected entry after removing hyper cache will look like as below.

i:5;s:20:"wp-super-cache/plugin.php";i:6;s:19:"jetpack/jetpack.php";

After doing this change click on ‘go’ with ‘save’ option for this table. This will save the plugins table with removed entry for hyper cache plugin.

With this trick our admin panel is working, and we could see that all the plugins are available, only change was all the plugins were deactivated so we have to activate them. Hope this trick will solve your problem with this warning.

JSON libraries

 JSON libraries
1.frozen 
Output JSON objects in C as JSON formatted strings and parse 
JSON formatted strings back into the C presentation of 
the JSON objects.
FEATUES:
• C and C++ complaint portable.
• Several extra format specifiers supported.
JSON token:
This stucture contains-
Pointer pointing to beginning of the value.
Value length 
Type of the token
Token types are string,number,true,false,null,
object start, object end,array start and array end.
API’s:
• json_scanf
Scans json string directly into c/c++ variables.
• json_printf
Print c/c++ variables directly into output stream.
• json_setf
Modifies existing json_string.
• json_fread
Reads json from a file.
• json_fprintf
Writes json to a file.
• json_scanf_array_elem
Scan array element with given path and index
• json_printf_array
prints contiguous C arrays.
References:https://github.com/cesanta/frozen
SIZE of object file is 42 kBytes.
2.JSMN
Minimalistic JSON parser in C.
FEATURES:
Compatible with C89
Single head library
easily integrated into resource limited or
emb projects
API contains only 2 functions.
JSON token:
This structure contains-
type
start position in JSON data string
end position in JSON data string
size
Token types are-object,array,string,
primitive(number/boolean/true-false/null)
API’s:
•  jsmn_init
Create JSON parser over array of tokens.
•  jsmn_parse
Parses JSON data string into array of tokens,
each describing JSON object.
References:https://github.com/zserge/jsmn
SIZE of object file is upto 26 kBytes.
3.JSON-C
JSON-C implements referrence counting object that 
allows you to easily construct JSON objects in c,
output them as JSON formatted strings and parse 
JSON formatted strings back into c 
representation of JSON objects.
FEATURES:
JSON token:
Token types are boolean,double,int,object,array,string.
API’s:
• json_object_to_json_string
Stringify object to JSON format grabbing the 
shared ownership of object.
• json_object_get
Increament reference count of json_object.
• json_object_put
Decrement reference count of json_object,and free 
it if reaches to zero.
• json_object_userdata_to_json_string
Copy the userdata string to over the 
destination buffer.
• json_object_new_array
Create a new empty json_object of type 
json_type_array.
• json_object_get_array
Get the arraylist of json_object of type 
json_type_array.
• json_object_array_add
Add an element to the end of json_object 
of type json_type_array.
• json_obect_array_put_idx
Insert or replace an element at a specified 
index of the array.
• json_object_array_get_idx
Get the element at specifies index of the 
array.
All these functions for array are also defined for 
following json_types- 
boolean,double,int,int64,object .
References:https://github.com/json-c/json-c
SIZE of object file is upto 300 kBytes.