Packet Tracer 7.x - Internet of Things tutorials
Things and Components available in Packet Tracer 8.2
In addition to classical network devices such as routers and switches available in the previous versions, Packet Tracer 8.2 Components Box now contains a wide variety of Smart Things and components :
- Smart Things are physical objects that can connect to the Registration Server or Home Gateway through a network interface. They are separated into 4 subcategories : Home, Smart City, Industrial, and Power Grid.
- Components are physical objects that connect to microcontroller (MCU-PT) or single boarded computers (SBC-PT). They typically does not have a network interface and rely on the MCU-PT or SBC-PT for network access. These are simple devices that only communicate through their analog or digital slots.
There are three subcategories for Components :
- Boards: microcontrollers (MCU-PT), single boarded computers (SBC-PT), and a special device called Thing which are used to create self-contained physical objects like coffee makers or smoke alarms.
- Actuators: these components manipulate the Environment, themselves, or the area around them.
- Sensors: these components sense the Environment (photo detectors, temperature sensor), the area around them (RFID, metal sensor), or interactions (potentiometer, push button).
MQTT protocol and applications have been added in Packet Tracer since version 7.1 to improve communications between IoT devices
What is Arduino ?
Arduino is a hardware and software company building microcontroller-based kits for building digital devices and interactive objects that can sense and control physical devices.
The project is based on microcontroller board designs, produced by several vendors, using several microcontrollers. Arduino boards provide digital and analog input/output (I/O) pins that can interface to different expansion boards and other circuits. The boards feature serial and USB communication interfaces for loading programs from computers to the boards.
Programming the microcontrollers is done through the Arduino integrated development environment (IDE) based on a programming language named Processing, which also supports the languages C and C++.
Arduino at Cisco Live 2016
Arduino organised a technical challenge at Cisco Live 2016. The idea was that people at the Cisco event could discover and play with some fun Arduino projects like a RFID lock, a colour sensing and display thing, and a light sensitive theremin. Have a look on the video ;-)
Arduino language implemented in Packet Tracer 8.2
Packet Tracer 7.0 was the first Cisco Packet Tracer release including IoT features. This version includes IoT components and microcontroller (MCU-PT) or single boarded computers (SBC-PT) to connect them to the network. The microcontroller board emulate Arduino hardware and can be programmed using the same Processing language.
Function | Packet Tracer 8 reference | Arduino reference |
Structure | ||
setup() | If defined, this function is called once when the program starts. function setup() { | The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board. void setup() { Serial.begin(9600); pinMode(buttonPin, INPUT); } |
loop() | If defined, this function is called continuously when the program is running. The frequency of the calls depends on the complexity of this function, the number of other devices running programs and their complexity, and the machine's processing power. function loop() { Serial.println(digitalRead(0)); } | After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board. void loop() { if (digitalRead(buttonPin) == HIGH) Serial.write('H'); else Serial.write('L'); delay(1000); } |
Digital I/O | ||
pinMode(slot, mode) | Set a digital slot to INPUT or OUTPUT. pinMode(1, OUTPUT); pinMode(2, INPUT); | Configures the specified pin to behave either as an input or an output. void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second } |
digitalRead(slot) | | Reads the value from a specified digital pin, either HIGH or LOW |
digitalWrite(slot, value) | Writes to a digital slot with HIGH or LOW. | Write a HIGH or a LOW value to a digital pin. |
Tutorial description
This tutorial will provide guidelines to simulate a fully automated IoT environment using the capabilities of the new Cisco Packet Tracer 8.2 devices.
A MCU board connected to smoke and temperature sensors will act as a remote Fire Detection Unit. The board will be securely wifi connected to a 829 ISR router.
A SBC bord connected to a visual alarm will act as a Fire Alarm System.
Both IoT board will register to a central IoE server which will provide automation capabilities to raise the Fire Alarm if a fire is detected by the Remote Fire Sensor.
What is IoX ?
Cisco IoX hosts applications in a virtual machines running on an hypervisor hosted on an IoX capable hardware called fog node. Cisco IoX is delivered with a pre-packaged Yocto Linux distribution but developpers are free to use any operating system. Yocto has been selected by Cisco because of it's various CPU architectures support, it's comprehensive SDK, and it's slim design to work on resource constraint platforms like routers.
What's blocky ?
Blockly is a visual programmation editor which uses uses graphical blocks to represent code concepts like variables, logical expressions, loops, and more. It helps students to better understand and apply programming principles without having to worry about the specific syntax of a specific programming language.
Code can then be exported to popular programming languages such as python, javascript, ...