Note | ||
---|---|---|
| ||
To make an order with us, send an email to: support@atomiton.com with the title “Requesting IoT Kit for TQL101”. In the email please specify: · Which TQL101 class you are in · Your name · Your email · Your shipping address · Your contact phone number Once we receive your request, we will send you a Paypal invoice for payment and ship the kit. We respond on a first come, first serve basis. Due to limited supply, this item is not for sale to the general market. Our first priority is to serve the TQL101 classes. If you are not in the class, please specify in your email the purpose of use. |
IOTKit Contents
List of things that are contained in the IOTKit
...
Name
...
Description
...
Raspberry Pi 3 Model 3
...
The Raspberry Pi 3 is the third generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016. Compared to the Raspberry Pi 2 it has:
- A 1.2GHz 64-bit quad-core ARMv8 CPU
- 802.11n Wireless LAN
- Bluetooth 4.1
- Bluetooth Low Energy (BLE)
Default login password for Raspberry pi are:
pi / raspberry
...
Arduino Uno and Arduino Sensor Shield
...
The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button.
...
Sensors
...
- Ambience Light Sensor
- Thermistor
- DHT11 sensor
...
USB camera
...
The USB camera is easy to use and it is interfaced to Pi.
...
Micro Servo motor
...
The micro servo motor can rotate at angle between 0 and 180 degrees and it is to be interfaces to the Arduino.
Add RaspberryPi to Local Network
The following steps will setup the wifi connection on raspberry pi. Before you can setup wifi connection on raspberry pi, you need to login to pi.
Login to Raspberry pi
You have two options to login to raspberry pi.
Using HDMI Monitor, Keyboard and Mouse
- Connect a HDMI Monitor, keyboard and mouse to the pi and power on the raspberry pi.
- Once it powers on and you can see Raspbian Operating System User Interface.
- Open a terminal window by clicking on the “Terminal” Icon on Taskbar.
Using Ethernet Cable
- Connect Ethernet cable from your personal router's ethernet port into Raspberry pi
- Go to your Router settings and identify the IP address of the pi.
Then ssh to the pi using command
Code Block language text title SSH to Raspberry Pi linenumbers true ssh pi@<IPAddressOfPIFromStep2>
Setting up Raspberry Pi Wifi
- If you have logged into pi using HDMI, open the terminal window and Open the file “/etc/wpa_supplicant/wpa_supplicant.conf” using your favorite editor.
You need to be root or use sudo to edit the file Add the following lines at the end of “wpa_supplicant.conf” file
Code Block language text title Wifi settings linenumbers true network={ ssid=“Your wifi Network” psk=“Your wifi Password” }
Save and exit the file and run the command
Code Block language text title Interface commands linenumbers true “sudo ifdown wlan0” “sudo ifup wlan0”
- Check ip address using ifconfig command
Working with Sensors & Actuators
In order to kick start working with sensors and actuators we have imported default model with project name (TQLRaspberryPi) and associated TQL Queries.
TQLEngine
TQLEngine is installed in folder: /home/pi/atomiton-release folder.
The engine will autostart once the pi is started.
TQLEngine User Interface
You can login to TQLEngine User Interface using following URL
http://<IPAddressOfPi>:8080/app/index.html
Login Details:
...
Default Project
TQLRaspberryPi is the default project that is imported and it has basic models and queries to test sensors & actuators.
ThingSpaces Runtime View
TQLQueries
Please make sure you run these queries in the same order as specified here.
InitMCUSensor
Code Block language xml title Initialize Sensors Connected to MCU linenumbers true <Query> <DeleteAll format="version,current"> <MCUSensorModel> <sensorId ne=""/> </MCUSensorModel> </DeleteAll> <Save format="version,current"> <MCUSensorModel> <PerifParams> <Peripheral>serial</Peripheral> <Baudrate>9600</Baudrate> <InterfacePort>/dev/ttyUSB0</InterfacePort> <Interface>serial</Interface> <Format>ascii</Format> <Operation>receive</Operation> <UniqueId>76522</UniqueId> <Payload>$Null()</Payload> </PerifParams> <SensorData>$Null()</SensorData> <InitSubscribers>false</InitSubscribers> </MCUSensorModel> </Save> </Query>
InitOtherSensors - This Query initializes Non-MCU sensor models.
Code Block language xml title Initialize Sensor Models linenumbers true <Query> <DeleteAll format="version,current"> <TempSensorModel> <TempSensorId ne=""/> </TempSensorModel> </DeleteAll> <DeleteAll format="version,current"> <HumiditySensorModel> <HumSensorId ne=""/> </HumiditySensorModel> </DeleteAll> <DeleteAll format="version,current"> <AmbianceSensorModel> <AmbSensorId ne=""/> </AmbianceSensorModel> </DeleteAll> <Create> <TempSensorModel> <TempValueInC>0</TempValueInC> <TempValueInF>0</TempValueInF> </TempSensorModel> </Create> <Create> <HumiditySensorModel> <HumidityValue>0</HumidityValue> </HumiditySensorModel> </Create> <Create> <AmbianceSensorModel> <AmbianceValue>0</AmbianceValue> </AmbianceSensorModel> </Create> </Query>
InitSubscribers - This query starts the subscription of main MCU Sensor Model and update the values into rest of the sensor models.
Code Block language xml title Initialize Subscriber to MCU Sensor Model linenumbers true <Query> <Find format="version"> <MCUSensorModel> <SensorId ne=""/> </MCUSensorModel> </Find> <SetResponseData> <key>Message.Value.Find.Result.MCUSensorModel.InitSubscribers.Value</key> <value>true</value> </SetResponseData> <Update> <from>Result</from> <Include>$Response.Message.Value.Find</Include> </Update> </Query>
FindSensors - This query finds the Sensor Values
Code Block language xml title Find Sensor Values linenumbers true <Query> <Find format="version,known"> <MCUSensorModel> <sensorId ne=""/> </MCUSensorModel> </Find> <Find format="version,known"> <TempSensorModel> <TempSensorId ne=""/> </TempSensorModel> </Find> <Find format="version,known"> <HumiditySensorModel> <HumSensorId ne=""/> </HumiditySensorModel> </Find> <Find format="version,known"> <AmbianceSensorModel> <AmbSensorId ne=""/> </AmbianceSensorModel> </Find> </Query>
ServoActivate - This Query activates the Servo Motor
Code Block language xml title Activate Servo Motor linenumbers true <Query> <DeleteAll format="version,current"> <ServoModel> <servoId neq="" /> </ServoModel> </DeleteAll> <Save format="version,current"> <ServoModel> <Peripheral>serial</Peripheral> <Baudrate>9600</Baudrate> <InterfacePort>/dev/ttyUSB0</InterfacePort> <Interface>serial</Interface> <format>ascii</format> <Operation>transmit</Operation> <UniqueId>123467</UniqueId> <Angle>40</Angle> <received>$Null()</received> </ServoModel> </Save> </Query>
ServoUpdate - This Query updates the angle of the servo motor
Code Block language xml title Update Angle of Servo linenumbers true <<Query> <Find format="version,known"> <ServoModel> <InterfacePort>/dev/ttyUSB0</InterfacePort> </ServoModel> </Find> <SetResponseData> <key>Message.Value.Find.Result.ServoModel.Angle.Value</key> <value>120</value> </SetResponseData> <Update> <from>Result</from> <Include>$Response.Message.Value.Find</Include> </Update> </Query>
TakeFirstPicture - This query creates a USBCameraModel and takes the first picture. The image will be stored in ucam_testpic.jpeg file. You can view the image using: http://<IPAddressOFPi>:8080/fid-mypics/ucam_testpic.jpeg
Code Block language xml title Take First Picture linenumbers true <Query> <DeleteAll> <USBCameraModel> <camId ne=""/> </USBCameraModel> </DeleteAll> <Save> <USBCameraModel> <Image>$Null()</Image> <USBCameraParameters> <Size> <Height>0</Height> <Width>0</Width> </Size> <Configuration> <Channel>0</Channel> <Standard>0</Standard> <Brightness>0</Brightness> <Contrast>0</Contrast> <Gamma>286</Gamma> <Saturation>65</Saturation> <Sharpness>6</Sharpness> <Hue>0</Hue> <Gain>0</Gain> <Quality></Quality> </Configuration> <SaveToDisk>true</SaveToDisk> <ImageFormat>jpeg</ImageFormat> <ImageName>ucam_testpic.jpeg</ImageName> </USBCameraParameters> </USBCameraModel> </Save> </Query>
TakePicture - This query takes a picture and saves the image to file ucam_baseer.jpeg
You can view the image using: http://<IPAddressOFPi>:8080/fid-mypics/ucam_baseer.jpeg
Code Block language xml title Take a new picture linenumbers true <<Query> <Find format="version"> <USBCameraModel> <CamId ne=""/> </USBCameraModel> </Find> <SetResponseData> <key>Message.Value.Find.Result.USBCameraModel.Image.Value</key> <value>$Null()</value> </SetResponseData> <SetResponseData> <key>Message.Value.Find.Result.USBCameraModel.USBCameraParameters.ImageName.Value </key> <value>ucam_baseer.jpeg</value> </SetResponseData> <Update> <from>Result</from> <Include>$Response.Message.Value.Find</Include> </Update> </Query>
The TQL IoT Kit Setup has been updated with the new IoTKit Quick Installation Guide. Please access the set up info there.