Raspberry Pi

How to connect to a Cisco Device using USB Console

This article was written using instructions for Ubuntu, but was actually tested on a Raspberry Pi. Cool, eh?
https://www.youtube.com/watch?v=PRwHNd-u_cA

Install minicom

$ sudo apt-get install minicom

Find the device

$ dmesg | grep ttyUSB
[    5.494345] usb 1-1.2: Moschip 2 port adapter converter now attached to ttyUSB0

Note the device: In this case it is ttyUSB0

Configure Minicom

Run minicom in setup mode

$ sudo minicom -s
+-----[configuration]------+
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

Configure the Serial Device

Select ‘Serial port setup’ and press [ Enter ]

+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/tty8                                 |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

At the ‘Change which setting?’ prompt, press [A]

There is no need to press [ Enter ], your cursor will be moved to the end of the Serial Device Path

Change the setting to match the setting found from the dmesg command.

In this example, we’ll change /dev/tty8 to /dev/ttyUSB0.

After the setting has been changed, press [ Enter ] to return to the ‘Change which setting’ prompt.
+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0                              |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

Press [E] to edit the Bps/Par/Bits setting

+---------[Comm Parameters]----------+
|                                    |
|     Current: 115200 8N1            |
| Speed            Parity      Data  |
| A: <next>        L: None     S: 5  |
| B: <prev>        M: Even     T: 6  |
| C:   9600        N: Odd      U: 7  |
| D:  38400        O: Mark     V: 8  |
| E: 115200        P: Space          |
|                                    |
| Stopbits                           |
| W: 1             Q: 8-N-1          |
| X: 2             R: 7-E-1          |
|                                    |
|                                    |
| Choice, or <Enter> to exit?        |
+------------------------------------+

Press [C], then [Q]

The ‘Current: ‘ setting at the top of the menu will change to ‘9600 8N1’

+---------[Comm Parameters]----------+
|                                    |
|     Current: 9600 8N1              |
| Speed            Parity      Data  |
...

Press [ Enter ] to return to the Serial port settings menu.

You will see the new setting on the ‘Bps/Par/Bits’ section.

...
| E -    Bps/Par/Bits       : 115200 8N1                                |
...

Press [ Enter ] to return to the ‘configuration’ menu.

+-----[configuration]------+
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

Select ‘Save setup as..’ then press [ Enter ]

...
| Save setup as..          |
...

At the ‘Give name to this configuration?’ prompt, enter a short name for these settings then press [ Enter ].

For this example, I’m using ‘cisco’

+-----------------------------------------+
|Give name to save this configuration?    |
|> cisco                                  |
+-----------------------------------------+
After pressing [ Enter ] you'll see a brief pop-up letting you know the configuration was saved.

Select ‘Exit from Minicom’ and press [ Enter ]

 

Run Minicom

 

Back at the Linux command prompt, run minicom with the name of the configuration you saved.

 

$ sudo minicom cisco
Welcome to minicom 2.7.1

OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyUSB0, 11:06:34

Press CTRL-A Z for help on special keys

Press [ Enter ] to see the prompt for the device you are now consoled into.

Router>
By admin on August 1, 2019 | Cisco, Linux, Linux, Raspberry Pi

How to burn an image to an SD card for Raspberry Pi

Short and sweet.  This takes quite a while but gets the job done.  If you’re using a new SD card, you can skip the zeroing step.

You can use these instructions to burn Raspian or any other operatying system in order to boot your Raspberry Pi.

How to write Raspberry Pi image to SD card

By admin on November 22, 2017 | Raspberry Pi

Alexa – Raspberry Pi Project

Yep, I broke down and bought my wife an Amazon Fire tablet for her birthday with a built in hands free Alexa app, and I have to admit, I kind of like it myself. In fact, as I continue to study it, I now want one for myself. Not the tablet so much, but the app. So much so that I’ve decided to build my own from one of my Raspberry Pis I have in my home office.

To create my hands-free Alexa, I’m using the instructions I found here:
https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry-Pi

I haven’t quite finished yet, since I’m currently using the Pi to spy on my cats to see which one has been using the corner of my bedroom as litter box and I need a monitor to continue. (currently running it headless via ssh).

To make sure I don’t lose my place, I’m at this stage of the game:

Step 7: Run your web service, sample app and wake word engine

By admin on | Alexa, Raspberry Pi

How to configure a Raspberry Pi with a Static IP

sudo nano /etc/dhcpcd.conf

Scroll to the bottom of the file and add the following lines:

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

#Remove these and reboot to return to dynamic IP
interface eth0
static ip_address=192.168.11.101/24
static routers=192.168.11.1
static domain_name_servers=192.168.1.1

Save the file: Ctrl+O, then Enter
Exit the nano editor: Ctrl+X
Reboot the computer

sudo reboot

Notes:
The subnet mask is written in CIDR notation at the end of the static IP address.
‘static routers=’ is the default gateway
‘static domain_name_servers=’ can be followed by multiple IP addresses, with each address separated from the previous by a single space ‘ ‘.

By admin on January 19, 2017 | Raspberry Pi | A comment?

Raspberry Pi dropping WiFi when ethernet plugged in

I do love my Raspberry Pi! That’s Pi, as in very small computer, not pie as in desert. (I’m diabetic, so please don’t tempt me.) I use these little devices for all kinds of projects.

I’ve recently started using them to test an internal network with a series of routers, with each Pi on a different network. (192.168.11.0/24, 192.168.22.0/24… you get the picture.) To test these, I set static IP addressed on the ethernet connections and then access them with ssh via their dynamic WiFi IPs.

To configure the devices, I would first log in using ssh to the wlan0 interface, configure /etc/network/interfaces with the desired static IP, then plug in the ethernet cable. The problem with this was that as soon as I plugged in the cable, my WiFi connection would drop, causing me to lose all contact with the Pi.

#sudo ifplugd eth0 --kill
By admin on January 13, 2017 | Raspberry Pi | A comment?