Blog.PUIUP.NET

It's just my notes, or not?

MQTT is NOT "Message Queuing Telemetry Transport" anymore.

While the "MQ" originally came from IBM's MQ Series (Message Queue), MQTT itself does not inherently use message queues in the traditional sense. It operates on a publish-subscribe model. Over time, and especially since its standardization by OASIS, "MQTT" is now primarily used as the name of the protocol itself rather than an abbreviation to be spelled out.

It's more accurate and less confusing to refer to it simply as MQTT or, if you were to refer to its historical roots, as "MQ Telemetry Transport." While using "Message Queuing Telemetry Transport" isn't a grave error, it doesn't fully capture the essence of the protocol and isn't the officially preferred name today. The trend is to treat MQTT as a standalone name.

When writing an academic paper, clarity, precision, and adherence to established conventions are paramount. On the first use, where you should define the term. The most accurate and widely accepted approach is to state: "MQTT (MQ Telemetry Transport)". Or, acknowledging its historical naming but current status: "MQTT (formerly an acronym for MQ Telemetry Transport, now used as the protocol name itself)". After the initial definition, simply use "MQTT."

Ref: https://aws.amazon.com/what-is/mqtt

[Solved] Issued certificate has expired. (client certificate problem)

Problem: $ wget https://www.openssl.org
...
ERROR: cannot verify www.openssl.org's certificate, issued by '/C=US/O=Let\'s Encrypt/CN=R3':
  Issued certificate has expired.
$ curl https://www.openssl.org
curl: (60) SSL certificate problem: certificate has expired

Fix:

1. Run
 $ sudo dpkg-reconfigure ca-certificates
2. Select 'ask'

3. Uncheck items below (use Space key to remove the *)
 - AddTrust_External_Root
 - DST_Root_CA_X3

4. Tab and OK

[Solved] npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'

Problem: when install an npm package in global.
you@computer:~/path $ npm install -g (package)
npm WARN checkPermissions Missing write access to /usr/local/lib
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
...

Solution: configure npm to use a different directory for global installation.

1.Create a directory for global installation: $ mkdir ~/.npm-global 2.Configure npm to use the new directory path: npm config set prefix '~/.npm-global' 3.Add the directory to $PATH in the ~/.profile: echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.profile 4.Update your system variables: source ~/.profile Test: Download a package globally without using sudo. npm install -g (something) If it still shows permission error (mac os), run: sudo chown -R $USER ~/.npm-global

[Solved] Docker - failed to start daemon: error initializing graphdriver

Somehow after updating packages, docker won't start anymore.
Trying to start the daemon, it fails.
pi@raspberrypi:~ $ sudo systemctl start docker.service
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Trying to run it manually, it terminates and shows an error:
pi@raspberrypi:~ $ sudo dockerd
INFO[...] Starting up
...
...
failed to start daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, devicemapper; Please cleanup or explicitly choose storage driver (-s )
We found the problem. It looks like it could not decide it's own storage driver. There are 'overlay2' and 'devicemapper' to choose from.
From Docker's official website [link], the 'overlay2' is recommended.

Let's try to force it to use this one by adding this parameter to the command: "-s overlay2"
pi@raspberrypi:~ $ sudo dockerd -s overlay2
OR use a more readable version: "--storage-driver=overlay2".
pi@raspberrypi:~ $ sudo dockerd --storage-driver=overlay2
INFO[...] Starting up
...
...
INFO[...] Daemon has completed initialization
INFO[...] API listen on /var/run/docker.sock
Now it works.
Press [Ctrl-c] to exit.

We know how to fix it.

TL;DR: We just need to add the parameter to the service script
pi@raspberrypi:~ $ sudo vi /lib/systemd/system/docker.service
Look for a line with "ExecStart" append "--storage-driver=overlay2" to the line, so it looks like this:
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --storage-driver=overlay2

Then reload the configuration and start the service
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo systemctl start docker.service

UDOO NEO - Device Tree Editor - Headless start

No VNC needed

1. ssh to udoo and run 'sudo /opt/dtweb/dtweb-headless.sh'

2. open browser to udoo with port 7533

3. reboot udoo after finish

NS-3 simulation time

  • To get current simulation time:
    ns3::Time mytime = Simulation::Now();

  • To get Time from human time unit
    ns3::Time mytime = Seconds(1.0)

    OR
    ns3::Time mytime = MilliSeconds(1000)

    OR
    ns3::Time mytime = MicroSeconds(1000000)

    OR
    ns3::Time mytime = NanoSeconds(1000000000)

  • To convert the Time to human time unit:
    double seconds = mytime.GetSeconds();

    OR
    int64_t ms = mytime.GetMilliSeconds();

    OR
    int64_t us = mytime.GetMicroSeconds();

    OR
    int64_t ns = mytime.GetNanoSeconds();

Twisted Pairs Ethernet Cables: Categories and Shielding

TP: Twisted Pairs. The wires inside the cable are twisted together.
Cat: Stands for "category".

Twisted Pairs Cables

Type Description Pros. Cons.
UTP Unshielded Twisted Pairs.
No foil or braided shielding.
  • Cheap
  • Flexible
  • Lower signal quality
  • Vulnerability for crosstalk
STP Shielded Twisted Pairs.
Has braided shielding to reduce noise and improve connection quality.
  • Versatile
  • Strong
  • Flexible
  • Bulky
  • More expensive
  • 70-90% of shielding coverage depends on the braid formation.
FTP Foiled Twisted Pairs.
Has foil shielding to reduce noise and improve connection quality.
  • 100% of shielding coverage
  • Lighter than braid
  • Cheaper than braid
  • Less durable than braid
  • Less flex than braid

Cable Category Standard

Category Shielding Max Transmission Speed
(at 100 meters)
Max Bandwidth Note
Cat 5 UTP 100 Mbps 100 MHz Obsolete.
Cat 5e UTP, F/UTP, U/FTP 1 Gbps 100 MHz Common cheap cable.
e = enhanced.
Cat 6 UTP, F/UTP, U/FTP 1 Gbps 250 MHz 10 Gbps up to 55 meters.
Cat 6a UTP, F/UTP, U/FTP, S/FTP 10 Gbps 500 MHz a = augmented.
Cat 7 S/FTP, F/FTP 10 Gbps 600 MHz Not TIA/EIA standard.
GG45 connector
Cat 7a S/FTP, F/FTP 10 Gbps 1,000Mhz Not TIA/EIA standard.
100 Gbps up to 15 meters.
40 Gbps up to 50 meters.
Cat 8/8.1 F/UTP, U/FTP 10 Gbps 2,000Mhz For data center.
Short cable, less than 30-36m.
40 Gbps up to 30m.
RJ45 connector.
Cat 8.2 S/FTP, F/FTP 10 Gbps 2,000Mhz Same as 8.1.
GG45 connector.