Cayenne IoT Platform – complete steps to Connect the Raspberry Pi with Cayenne IoT Platform

Cayenne cloud and Raspberry Pi Connectivity establishment link attached with this post. Check out the below mentioned link and follow the steps to Launch your first IoT Project within a minutes

http://www.instructables.com/id/Cayenne-Raspberry-Pi-IoT-Simple/

Below link will talk about the cayenne IoT platform rules and triggers

https://pimylifeup.com/raspberry-pi-cayenne/

A quick start – Cayenne IoT Platform

Advertisements

change the baudrate of HC-05 Bluetooth module in an easy way within a short time – complete procedure

If you want to change some of the settings of your HC-05 Bluetooth module, like baud rate, password or the name of the Bluetooth module, you can do it easy and fast with your Arduino.

There are different HC-05 modules on the market, but it should work with all of them. On the picture below you can see a bare HC-05 module, 5V tolerant HC-05 module and 6V tolerant HC-05 module with a button. I prefer the last one, as the button makes the changing of the settings even easier.

IMG_9290

To change any settings of the module, it should be in the so called “AT Mode”. How to put the Bluetooth module in AT Mode: The “Key Pin” of the module should be set to “High”. This means we should apply voltage to this pin at the same time we power the module. On the last module, the button does this job. It should be pressed when powering the module with 5V. On the module without button, we need to supply 3.3V to the “Key Pin” when powering on.

Here is an example how to connect the module to the Arduino Nano v3. Note that there should be an jumper on GND and RST pin. By doing this, the Arduino will only act as a simple FTDI adapter.

IMG_9291

First connect the Arduino to the PC over USB. Then connect the cables in the following way:

  • TX Bluetooth –> TX Arduino
  • RX Bluetooth –> RX Arduino
  • GND Bluetooth –> GND Arduino

… and at last the 5V Bluetooth to 5V Arduino by keeping the button of the Bluetooth pressed. Or on the module without button, connect the Key Pin Bluetooth to 3.3V on Arduino.

If the HC-05 is in AT Mode, the red LED will blink at every 2 seconds.

Then start the PuTTY program configure the right COM Port (Check it in the Device Manger) and set the Baud Rate to 38400. This is the baud rate for AT Mode. Then click “Open”.

HC-05.over.PuTTY

In the newly opened black window type “AT”, press Enter and you should get “OK” as a result. Note that you want see what you type in the windows… Here some of the commands to change the settings you wish:

Change baud rate to 57600, 1 stop bit, 0 parity AT+UART=57600,1,0
Change module name AT+NAME=YOURNAME
Change pairing code AT+PSWD=0000

Note: You can use other similar terminal applications such as teraterm, Hyperterminal, Docklight these all were supported by windows. For ubuntu users you can use gtkterm terminal.

Read and Write From Serial Port With Raspberry Pi

n this tutorial we will see how to use the serial port on Raspberry Pi. We will use the serial port available on Raspberry with a RS232/TTL 3-5,5V adapter and a USB-serial adapter. By default the Raspberry Pi’s serial port is configured to be used for console input/output. This can help to fix problems during boot, or to log in to the Pi if the video and network are not available.

To be able to use the serial port to connect and talk to other devices (e.g. a modem a printer.. ), the serial port console login needs to be disabled.

Here we use Raspberry Pi 2, and we connect a RS232/TTL 3-5,5V adapter to pins 4 (5V), 6 (GND) ,8 (TX),10 (RX) of Raspberry, obviously connect tx with rx and vice versa.

Emmeshop tutorial Raspberry serial connection

To search for available serial ports we use the command

dmesg | grep tty

The output is something like this

pi@raspberrypi ~ $ dmesg | grep tty
  [    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial=0x93f9c7f9 smsc95xx.macaddr=B8:27:EB:F9:C7:F9 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
  [    0.001774] console [tty1] enabled
  [    0.749509] dev:f1: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev3
  [    1.268971] console [ttyAMA0] enabled
  pi@raspberrypi ~ $

Last line indicates that the console is enabled on the serial port ttyAMA0, so we disable it

Run the configuration command and follow the instructions below

sudo raspi-config

Emmeshop tutorial Raspberry serial

Emmeshop tutorial Raspberry serial

Emmeshop tutorial Raspberry serial

Emmeshop tutorial Raspberry serial

Emmeshop tutorial Raspberry serial

Reboot and try with

dmesg | grep tty

output now is

pi@raspberrypi ~ $ dmesg | grep tty
  [    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial=0x93f9c7f9 smsc95xx.macaddr=B8:27:EB:F9:C7:F9 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
  [    0.001769] console [tty1] enabled
  [    0.749438] dev:f1: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev3
  pi@raspberrypi ~ $

Now we can use the serial ttyAMA0. We connect an adapter usb / serial, then we will try to establish a communication between the two serial ports; obviously in a practical application to every serial we could connect a device, for example a modem, a printer a RFID reader etc.

Emmeshop tutorial Raspberry two serial port communication

After connecting the second serial port we launch the command to find the name that Raspberry gives him

dmesg | grep tty

The output is something like this

pi@raspberrypi ~ $ dmesg | grep tty
  [    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial=0x93f9c7f9 smsc95xx.macaddr=B8:27:EB:F9:C7:F9 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
  [    0.001769] console [tty1] enabled
  [    0.749438] dev:f1: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev3
  [  971.919417] usb 1-1.2: pl2303 converter now attached to ttyUSB0
  pi@raspberrypi ~ $

Ok, now we create two files, one who writes something on the ttyAMA0 port and the other that reads on the ttyUSB0 port.

serial_write.py

    #!/usr/bin/env python
          
      
           import time
           import serial
          
      
           ser = serial.Serial(
              
               port='/dev/ttyAMA0',
               baudrate = 9600,
               parity=serial.PARITY_NONE,
               stopbits=serial.STOPBITS_ONE,
               bytesize=serial.EIGHTBITS,
               timeout=1
           )
           counter=0
          
      
           while 1:
               ser.write('Write counter: %d \n'%(counter))
               time.sleep(1)
               counter += 1

serial_read.py

    #!/usr/bin/env python
          
      
           import time
           import serial
          
      
           ser = serial.Serial(
              
               port='/dev/ttyUSB0',
               baudrate = 9600,
               parity=serial.PARITY_NONE,
               stopbits=serial.STOPBITS_ONE,
               bytesize=serial.EIGHTBITS,
               timeout=1
           )
           counter=0
          
      
           while 1:
               x=ser.readline()
               print x

If we run both files, serial_read.py will read what serial_write.py writes

Emmeshop tutorial Raspberry serial write and read

This is just a small example but it can serve as a starting point to send a print to an old printer or read data from a router or a gps.

AWS Cannot download a root CA for IoT

Reader Query: 

When I’m trying to create a new certificate – I can see the page with 4 downloading links (keys and certificates).
Unfortunately, I can download all, except for root CA, because when I’m pushing the last – it throws me to AWS Documentation.

Solution:

The AWS documentation that the link is redirecting you to contains the Root CA certificates. The Root CA certificates are available under the “Server Authentication” section:
https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication

Based on the signing key, the following certificates are available from the documentation page:

-> RSA 2048 bit key: VeriSign Class 3 Public Primary G5 root CA certificate (https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem)
-> RSA 2048 bit key: Amazon Root CA 1 (https://www.amazontrust.com/repository/AmazonRootCA1.pem)
-> RSA 4096 bit key: Amazon Root CA 2 (https://www.amazontrust.com/repository/AmazonRootCA2.pem)
-> ECC 256 bit key: Amazon Root CA 3 (https://www.amazontrust.com/repository/AmazonRootCA3.pem)
-> ECC 384 bit key: Amazon Root CA 4 (https://www.amazontrust.com/repository/AmazonRootCA4.pem)

If you are creating a new thing using the web console and downloading the credentials (device certificate, device public and private key, etc) then “Amazon Root CA 1” can be used as the root CA certificate.
While creating a new thing from the console,  please do not forget to click on the “Activate” button prior to proceeding to the “Attach a Policy” section.

Difference between GPIO.setmode(BCM) and GPIO.setmode(BOARD)

It tells the library which pin nunbering system you are going to use. BOARD signifies using the physical pin numbers on the RPi P1 connector. BCM signifies the Broadcom SOC channel designation. One word of warning – the BCM channels moved around a little between revision 1 and revision 2 of the Raspberry Pi board. The BOARD numbering system stays working between board revisions.

What is Metadata with easy examples

Metadata is simply data about data. It means it is a description and context of the data. It helps to organize, find and understand data. Here are a few real world examples of metadata:

Typical metadata

Those are some typical metadata elements:

  1. Title and description,
  2. Tags and categories,
  3. Who created and when,
  4. Who last modified and when,
  5. Who can access or update.

A photo

Every time you take a photo with today’s cameras a bunch of metadata is gathered and saved with it:

  • date and time,
  • filename,
  • camera settings,
  • geolocation.

A book

Each book has a number of standard metadata on the covers and inside. This includes:

  • a title,
  • author name,
  • publisher and copyright details,
  • description on a back,
  • table of contents,
  • index,
  • page numbers.

A blog post

Every blog post has standard metadata fields that are usually at before first paragraph. This includes:

  • title,
  • author,
  • published time,
  • category,
  • tags.

Email

Every email you send or receive has a number of metadata fields, many of which are hidden in the message header and not visible to you in your mail client. This metadata includes:

  • subject,
  • from,
  • to,
  • date and time sent,
  • sending and receiving server names and IPs,
  • format (plain text of HTLM),
  • anti-spam software details.

Word document

Every word processing software collects some standard metadata and enables you to add your own fields for each document. Typical fields are:

  • title,
  • subject,
  • author,
  • company,
  • status,
  • creation date and time,
  • last modification date and time,
  • number of pages.

A spreadsheet

Spreadsheets contain a few metadata fields:

  • tab names,
  • table names,
  • column names,
  • user comments.

Relational database

Relational databases (most common type of database) store and provide access not only data but also metadata in a structure called data dictionary or system catalog. It holds information about:

  • tables,
  • columns,
  • data types,
  • constraints
  • table relationships,
  • and many more

Document and share database metadata

Extract metadata from databases, document schema and share across your orgranization in convenient HTML with Dataedo.

Computer files

All the fields you see by each file in file explorer is actually metadata. The actual data is inside those files. Metadata includes:

  • file name,
  • type,
  • size,
  • creation date and time,
  • last modification date and time.

Web page

Every web page has a number of metadata fields:

  • page title,
  • page description,
  • icon.

Paper files

Paper document files have often administrative metadata that help manage documents. This might include:

  • letter for files organized alphabetically,
  • access control information (“classified” for instance),
  • logos.

Raspberry Pi Vs Intel Edison Features Comparison

HR-OS1 means?

The HR-OS1 is powered by an onboard Linux computer giving you all the processing power you need to run your robot. The HR-OS1 is a hackable, modular, humanoid robot development platform designed from the ground up with customization and modification in mind.

Raspberry Pi Vs Intel Edison

Your HR-OS1 kit shipped with 2 choices for the Main CPU – the Intel Edison and the Raspberry Pi. Both platforms will run the same HR-OS1 framework to control your robot. Each platform has its strong points, as outlined below.

#Intel Edison Pros

  • Power Consumption The Intel Edison consumes far less power than the Raspberry Pi.
  • Size Even with the breakout board, the Intel Edison is much smaller then the Raspberry Pi.
  • Built in Wifi/Bluetooth The Intel Edison does not need extra dongles to add bluetooth / wifi functionality.
  • Built in FTDI USB-Serial Converter You can connect the Intel Edison Mini Breakout directly to you computer to open a serial terminal to control the Edison.
  • More Mature Development/Testing We have been working with the Intel Edison for much longer than the Raspberry Pi, so the framework is better tested with the Intel Edison.

#Raspberry Pi Pros

  • USB Ports The Raspberry Pi has 4 available USB ports to attach devices to.
  • SD Card Slot The Raspberry Pi’s SD based storage makes it possible to upgrade your disk size. Each HR-OS1 kit ships with an 8GB SD card, compared to the Edison’s built in 4gb eMMC storage.
  • Easy access GPIO pins The Raspberry Pi has 3.3v I/O pins that are easily accessible through the male pin headers. The Intel Edison has 1.8v pins.
  • Standard Ports HDMI, ethernet, composite video, and audio ports
  • **Special Ports ** Camera and display interface ports
  • 3d Graphics core
  • Superior processor

 

Establishing an FTP Connection from the Command Prompt

THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • Windows (All Versions)

HOW TO ESTABLISH AN FTP SESSION FROM THE COMMAND PROMPT

Sometimes when troubleshooting a connection problem, it may be helpful to attempt an FTP connection from the Windows command prompt (or in Windows Explorer).

To initiate an FTP session from the Windows command prompt, follow these steps:

  1. Establish an Internet connection as you normally do.
  2. Click Start, and then click Run.
    • In Windows 7, Vista, NT, 2000, or XP, type cmd and then click OK.
    • In Windows 95, 98 or ME, type command and then click OK.
  3. A command prompt will appear in a new window.
  4. Type ftp <insert your FTP host address here>
    • Example: C:\ftp ftp.globalscape.com
  5. Press Enter.
  6. If the initial connection is successful, you should be prompted for a username. Type it in and press Enter again. (If connecting anonymously, type anonymous)
  7. You should now be prompted for a password. Type it in and press Enter once more. NOTE: For security reasons, you will not be able to see your password as you type it. (If connecting anonymously, use your email address as the password)
  8. If all is well, then you should now be connected to the remote FTP site.
  9. Type dir and then press Enter to see a list of files and folders.
  10. To end your FTP session, type quit and press Enter.

If you cannot connect this way, then depending on the results, you may be using incorrect login details (host address, username or password), or you may need to configure your firewall.

The following screenshot illustrates a successful connection to ftp.globalscape.com via the command prompt.

SRAM (Static Random Access memory) and Cache (L1, L2, L3)

SRAM (static RAM) is random access memory (RAM) that retains data bits in its memory as long as power is being supplied. Unlike dynamic RAM (DRAM), which stores bits in cells consisting of a capacitor and a transistor, SRAM does not have to be periodically refreshed. Static RAM provides faster access to data and is more expensive than DRAM. SRAM is used for a computer’s cache memory and as part of the random access memory digital-to-analog converter on a video card

CPU Cache

A CPU cache is a hardware cache used by the central processing unit (CPU) of a computer to reduce the average cost (time or energy) to access data from the main memory. A cache is a smaller, faster memory, closer to a processor core, which stores copies of the data from frequently used main memory locations.

CPU cache is a smaller faster memory used by the central processing unit (CPU) of a computer to reduce the average time to access memory.
L1 (Level 1), L2, L3 cache are some specialized memory which work hand in hand to improve computer performance.

When a request is made to the system, CPU has some set of instructions to execute, which it fetches from the RAM. Thus to cut down delay, CPU maintains a cache with some data which it anticipates it will be needed.

(L1) Level 1 Cache(2KB – 64KB) – Instructions are first searched in this cache. L1 cache very small in comparison to others, thus making it faster than the rest.

(L2) Level 2 Cache(256KB – 512KB) – If the instructions are not present in the L1 cache then it looks in the L2 cache, which is a slightly larger pool of cache, thus accompanied by some latency.

(L3) Level 3 Cache (1MB -8MB) – With each cache miss, it proceeds to the next level cache. This is the largest among the all the cache, even though it is slower, its still faster than the RAM.

Now you know what cache is and what different level of cache are.
And that 6MB value of the L3 Cache in your Intel 4700MQ microprocessor is actually the memory size of that Cache.
Thus Cache improves the overall performance of the CPU but these numbers shouldn’t be considered while purchasing any system. Look at the benchmarks of the CPU as a whole. A CPU with similar architecture but with more cache wouldn’t make any noticeable difference. The technology these days have advanced to such a point that the specs of a CPU are just meaningless.