MySphere Posts

I’m working on projects that involve many technologies and frameworks.

Particularly in one of our projects the IceGuard many things have been used such as Flutter for mobile application, Node-Red for  integrations,  IBM Cloud and IBM Watson IoT services.

We have reached a point where an asset management application such as sensors and gateways is required.

The application has the requirements:

1 – Run OffLine and Web

2 – Data replication

3 – Authentication and  Data security

4 – Integration with other applications.

5 – Implement a simple flow of approval.

Another detail is that we needed it to be developed rapidly.

Much is said that the Lotus IBM HCL Notes & Domino is dead.

Not for my case. If I were to use another product (s)/technologies I would spend two working days at least to architect the entire application, choose the Framworks to do the job, not to mention  database modeling,  authentication service, etc., etc.

With the HCL Notes & Domino i create the application in just one day!

It is a simple application, but that solved a real problem of my project.

Notes & Domino do the job.

Domino

These are my steps to create a MySQL Docker container, i am using Docker for Mac.

1 – Create a folder to save the database. If you do not create a Docker volume you will loose your data when you restart your container.  My folder is /Users/keniocarvalho/VolumesDocker/mysqdata

2- Execute the command bellow:

docker run –name mysqldb -p 3306:3306 -v /Users/keniocarvalho/VolumesDocker/mysqdata/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql/mysql-server:latest

3 – Enter on the mysql container using the command :  docker exec -it mysqldb bash

4 – Inside the container type : mysql -uroot -p. The system will ask for the password. Here the password is password.

5 – To access the database from outside the container run this commands on the mysql console:

CREATE USER ‘root’@’%’ IDENTIFIED BY ‘root’;

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ WITH GRANT OPTION;

FLUSH PRIVILEGES;

Verify the permission:

mysql> SELECT host, user FROM mysql.user;
+———–+——————+
| host | user |
+———–+——————+
| % | root |
| localhost | healthchecker |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+———–+——————+

Now you can access the mysql from outside of the container using port 3306  from any host.

Obs: This is not a setup for Production use only in your development workstation.

 

Uncategorized

Last week i got back my Macbook Pro 15 2016, after 10 days.  The laptop go to service on an Apple Technical Assistance here in my city.

My first Macbook Pro (Mid 2012) works for 5 years without issues.

The first problem was the speakers. Sound was horrible.  The problem is the same described on this link.

The second problem was the battery. With only 86 cycles a message about to service the battery appears.

The third problem was #staingate. 

Apple replace all parts of my Macbook. The service is ok until now.

Lots of problems with this expensive machine. The quality is not the same anymore.

Uncategorized

 

Cloud service end of marketing and end of service: Connections Cloud

Effective July 16, 2019, HCL® will withdraw from marketing all part numbers related to Connections Cloud (5725-F82), inclusive of but not limited to Verse, SmartCloud Notes, Connections S1, Connections S2, Connections Social Cloud, Connections Engagement Center, Connections Chat, Connections Meetings, Dual Entitlement,  and Domino Applications on Cloud (5900-A1K) as subscribed to under the applicable agreements.  Existing Connections Cloud customers will be able to purchase additional entitlements through the end of service date.

Effective, July 16, 2020, HCL will end service for all part numbers related to Connections Cloud.

More information here

Cloud

Rules are key elements for an IoT solution. Using rules you can trigger an action or send an alert any kind of notification.
IBM update his platform and now you can create rules using a graphical interface.

The key part of a rule is the expression that will be evaluate to true or false.  The expression language are built using JSONata.
JSONata is a lightweight query and transformation language for JSON data.

The point is that IBM are using JSONata v1.4x. and the current version of JSONata is v1.6.5. The versions have lots of difference.
Yesterday i was writing a rule to get the hour for an event. If you are using v1.6.5 you can use the function $fromMilllis with picture.
$fromMillis(1510067557121, ‘[H01]’, ‘-0500’) => “10”
But Watson IoT are using v1.4x  and $fromMillis doesn’t have the picture implemented. The only way i found is to manipulate strings and i got the following expression:

$number($substring($fromMillis($state.datahora),11,1)) < 1 and $number($substring($fromMillis($state.datahora),12,1)) < 3 ? $number($substring($fromMillis($state.datahora),12,1))+24-3 : $number($substring($fromMillis($state.datahora),11,1))*10+ $number($substring($fromMillis($state.datahora),12,1))-3
$state.datahora returns an epoch timestamp.
This expression returns the hour on my timezone (-3). If anyone have a more elegant solution post on comments. I know my solution can’t be the better one, but it works.

IoT

This month i am creating a Course about AI & IoT   (AI & IoT Fundamentals).

The course are about AI and IoT in general but i will use IBM Watson APIs, IBM Watson IoT and off course Node-Red and Raspberry Pi to make the excersices.

The course is 15 hours long (lots off video) plus the exercises.

Using the Keynote to generate de videos is fine but when i export the video the only option is M4V type.  To convert the videos i am usin FFmpeg.

1 – Install FFmpeg brew install ffmpeg

2 – Convert to mp4 using ffmpeg -i input.m4v out.mp4

3 – Convert to webm ffmpeg -i input.m4v output.webm

 

AI IoT MAC

This is the first public beta release of Node-RED 1.0.

The changes in this release are mostly focused on the editor – and there are some significant changes in there.

More info here

Installing the beta

If you want to try out the beta, you will need specify node-red@next when you use npm to update. Without the @next you’ll still get 0.20.x.

So on a Pi you’d do:

sudo npm install -g --unsafe-perm node-red@next

IoT

As of April 10, 2018, Google has deprecated Google Cloud Messaging (GCM). The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. IBM Traveler uses GCM for push notifications with IBM Verse for Android clients. Firebase Cloud Messaging (FCM) is the new supported notification infrastructure. This flash details what actions should be taken for IBM Traveler and the IBM Verse for Android clients to support the FCM notification infrastructure.

More information on this link

Domino verse

 

Node-RED 0.20 brings lots of new enhancements to the editor, some new subflow features and a complete restructure of its internal packaging.  https://nodered.org

Uncategorized

Setup a Node.js development environment is easy but when you need to work in a team, the best option is document all installation steps for everyone.

Every developer must use the same setup or things can be wrong. Bellow are small steps to setup a simple Node.js development environment

1 – Setup Node.js:  https://nodejs.org/en/
2 – Setup VS Code: https://code.visualstudio.com/docs/setup/setup-overview
3 – Open VS Code create a folder and in this folder save an file as app.js
4 – Setup nodemon:
Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.
To install nodemom open a terminal window and go to the folder you created on step 3 and  type npm install nodemon –save-dev  on the terminal window . This will install nodemon  as development dependency
5 – change package.json to start the application using nodemon
"name": "Node Development",
"version": "1.0.0",
"description": "Just another app",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon app.js"
},
"author": "Kenio Carvalho",
"license": "ISC",
"devDependencies": {
"nodemon": "^1.18.10"
}
}
5 – Run npm init on the folder and install Express (npm install express –save) //Production dependency

6 Add the code below to app.js and sav, just to test the environment:

const express = require ('express');
const app = express();
app.use('/',(req,res,next)=>{
 
res.send('<h1>Hello from Expres</h1>')
});
app.listen(3000)

7 run npm start on the terminal

open the url localhost:3000 and you will se the page.

Uncategorized