EKO-KONNECT RESEARCH AND EDUCATION INITIATIVE
Internet of Things (IoT) with Python and Virtual Lab
[Pycon Nigeria Conference 2019 Workshop Session]
Building a Low Power Weather Station in real-time
using ESP8266 with MicroPython and Thingspeak IoT Platform
HARDWARE
Esp8266 (Wemos)
Temperature and Humidity sensors (SHT 30)
HARDWARE
Breadboard
USB
ESP8266 Digital Input/Output
Software
Programming Language
IMPLEMENTATION
USB SERIAL PORT
Linux
Windows
MAC
FLASH MICROPYHON FIRMWARE
“/dev/ttyUSB0”/com port- your serial port
REPL (Read Evaluate Print Loop) Interface
Access the raw REPL (Read evaluate print loop) microPython prompt with the command
Error Note: Unplug the esp8266 USB cable from the port and replug if the error is Fatal: can't open /dev/ttyUSB0
CTRL-B to exit
THONNY
Linux Commands
Download
https://bitbucket.org/plas/thonny/downloads/
Connecting Esp8266 T0 WIFI
import network
WiFi_SSID = "YOUR SSID"
WiFi_PASS = "YOUR PASSWORD"
def do_connect():
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect(WiFi_SSID, WiFi_SSID)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
do_connect() #The network module is used to connect the board to wifi and it’s default in MicroPython
CLONE SHT30 DRIVER
Python script to measure Temperature and Humidity
sensor = SHT30()
temperature, humidity = sensor.measure()
print('Temperature:', temperature, 'ºC’, ‘Humidity:', humidity, '%')
ThingSpeak
Simple MQTT Protocol
ESP8266 MicroPython
Importing Libraries
import time # import time module
from umqttsimple import MQTTClient # umqttsimple library
from driver import SHT30 #STH30 sensor driver
import network #import network library
Connect to Wifi
#connect esp8266 board to wifi
WiFi_SSID = "YOUR SSID"
WiFi_PASS = "YOUR PASSWORD"
def do_connect():
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect(WiFi_SSID, WiFi_SSID)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
do_connect()
Connect to ThingSpeak
#create Thingspeak MQTT client
SERVER = "mqtt.thingspeak.com"
client = MQTTClient("umqtt_client", SERVER)
#Thingspeak credentials
CHANNEL_ID = "846133"
WRITE_API_KEY = "2JGLP14KN2HW3R5D"
# Create MQTT topic
topic = "channels/" + CHANNEL_ID + "/publish/" + WRITE_API_KEY
Run SHT30
#Get our temperature and humidity data in real time every 2 minutes sent to Thingspeak IoT service
while True:
sensor = SHT30()
temperature, humidity = sensor.measure()
#create MQTT payload
payload= "field1="+str(temperature)+"&field2="+str(humidity)
#continuously log temperature and humidity data to thingspeak channel
client.connect()
client.publish(topic, payload)
client.disconnect()
time.sleep(120)
REFERENCE
https://docs.micropython.org/en/latest/esp8266/tutorial/repl.html
https://jakemakes.eu/installing-micropython-to-esp8266/
https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html
https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/
https://micropython-docs-esp32.readthedocs.io/en/esp32_doc/esp8266/quickref.html
GitHub
https://github.com/kaffy90/Weather-station.git
Home Automation with Echo Dot
HARDWARE
Echo Dot
Raspberry Pi
HARDWARE
LED
Resistors
SOFTWARE
LEDs on breadboard
Connecting LEDs on a breadboard
FAUXMOS
Credit: kanesurendra
Other remote access
Amazon Alexa Alexa Skills Kit
THANK YOU
Using Python with robots and the Raspberry Pi
Objective
To demonstrate the use of Python in physical computing.
Devices description...
Raspberry Pi 3 model
GPIO PINS
...Devices description
Pi-camera
PIR Sensor
Finch robot
physical computing with python - Light Emitting diode
Physical computing with PYTHON - SURveillance SYstem
Other possible use cases
Using A Virtual Assistant - Google Home, Echo Dot
Reference
https://gitlab.wacren.net/kaffy9017/Surveillance_System
Thank you
Kafayat Adeoye
Email address: kafayat@eko-konnect.org.ng
Website: www.eko-konnect.org.ng
Twitter: https://twitter.com/kaffy_adunola
USING CSIRT AND NREN FOR DATA PROTECTION AND PRIVACY
Presented by Kafayat Adeoye
DIRISA NATIONAL DATA WORKSHOP 2019
Authors: Pius Effiom and Kafayat Adeoye
OUTLINES
NREN CSIRT Model
CSIRT Team Structure
NREN CSIRT Establishment Processes
DEFINITIONS
CSIRT
A CSIRT meaning Computer Security Incident Response Team is an organization or team that provides services and support to a defined constituency for preventing, handling, and responding to computer security incidents.
NREN
National Research and Education Network (NREN) comprises of network infrastructure and communities of users dedicated to supporting the needs of the research and education within a country.
NREN-CSIRT
The CSIRT created in institutions aggregate to form the NREN CSIRT and it is managed by an NREN Operator who is responsible for handling security and data privacy related issues nationally.
WHY CSIRT?
Operational Infrastructure
Research Data
Personal Data
Vulnerabilities
UNIVERSITIES (NIGERIA)
IMPLEMENTATION
NREN CSIRT MODEL
INSTITUTION B
INSTITUTION D
NREN CSIRT
INSTITUTION E
INSTITUTION C
INSTITUTION A CSIRT
INSTITUTION F
CSIRT TEAM STRUCTURE
CSIRT Manager
Researcher
System/Network Administrator
Communication Officer
Legal Officer
Finance Officer
NREN CSIRT ESTABLISHMENT PROCESSES
Obtain Management Support and Buy-in
Strategic Plan
Announce the Operational CSIRT
Design vision and Implementation Process
Funding for Operation
OBTAIN MANAGEMENT SUPPORT AND BUY-IN
A CSIRT has to be acknowledged by the institution management before implementation this may involve management of the institution signing the following documents;
STRATEGIC PLAN
Where will the group members come from ?
Communication model with management
What administrative issues must be dealt with ?
What specific time frames to be met ?
Are all stakeholders represented ?
What project issues must be addressed?
DESIGN THE NREN CSIRT VISION AND IMPLEMENTATION PROCESS
Gather relevant information
NREN CSIRT OPERATIONS
Incident handling
Incident postmortems
Communication
Tools
Policy Framework
SECURE FUNDING FOR THE CSIRT OPERATIONS
BEGIN IMPLEMENTATION
• Training initial CSIRT staff.�• Acquire necessary tools and build network infrastructure to support the team.�• Develop the initial set of CSIRT policies and procedures to support your services.�• Define the specifications for your incident-tracking system.�• Develop incident-reporting guidelines. These guidelines define how the institution interacts with the CSIRT.
ANNOUNCE THE OPERATIONAL CSIRT
Publicity
Awareness training
Communication process
Announce the operational CSIRT
NREN CSIRT