TIme to continue tutorial from here
Modify firmware of the board,
First download MPLAB x IDE and XC8 compiler and install it.
download the pre programmed by factory for AVR-IoT AWS
https://github.com/microchip-pic-avr-solutions/avr-iot-aws-sensor-node-mplab
Open MPLAB X IDE and open project that already download from the link above.
on the navigation window , click AVRIoT -> SourceFiles -> MCC_Generated_Files ->Application_manager.h
edit pre-programmed sendtocloud function
Connect board into PC and reprogram the board with edited file by clicking the make & program device button(red border)
after firmware of the AVR IoT board is updated..
Check AWS IoT core server to make sure whether is it work or not.
as you can see it works, when swtich button is pressed board will send 0 to the AWS Iot Core server and 1 if switch button is not pressed.
Our board is ready..
Let's continue build smartphone application
The concept here is , when board is pressed by blind people, it will send "0" data to AWS IoT Core server
This data will be subscribed by smartphone application that will be made.
So there are 2 smartphone application we will build.
First as gps sensor (Function is to replace broken gps sensor that i bought)
and second smartphone application for tracking the positiion..
Like I told you on the first thread of this tutorial
the concept is
Blind people bring Embedded device (switch button + microcontroller Wrapped by box) and also smartphone as WIFI Teathering connection.
We will use this smartphone also as our gps sensor. so when switch button is pressed, it will request to smartphone for sending gps location to the cloud.
the gps location will be accessed by other smartphone application. and we can track the location.
Without further ado lets start make 1st application
SMARTPHONE APPLICATION AS GPS SENSOR
open app inventor 2 by click this link
http://ai2.appinventor.mit.edu/
start new project and follow component that I used.
There are
program the application with this block
Now Build the application and download it by scan the Generated QR Code
Now let's run the application on our smartphone and check the AWS IoT Core server
is it correctly set up or not.
Open AWS IoT Core and click test and subscribe for {id}/sensors & {id}/location
You can see at {id}/sensor, when I pressed the button it will send "0" data.
and the smartphone application will response the "0" data by sending gps coordinate (Latitude & Longitude ) :
-6.34766,107.11111
To make sure this coordinate is accurate, I will check it on google maps website
Yeayy..... the coordinate is accurate, when I make this app I am exactly on the red pin map.
I think we are done....
eitss... but wait we will make another app for tracker application
SMARTPHONE APLICATION TRACKET
Same with previous step,
go to app inventor 2 and start new project and follow component that I used.
after make the view like the picture i'ts time to program it with block
follow my blocks
Build the software application and download it.
and we are done..
Please watch the video for the demo
Modify firmware of the board,
First download MPLAB x IDE and XC8 compiler and install it.
download the pre programmed by factory for AVR-IoT AWS
https://github.com/microchip-pic-avr-solutions/avr-iot-aws-sensor-node-mplab
Open MPLAB X IDE and open project that already download from the link above.
on the navigation window , click AVRIoT -> SourceFiles -> MCC_Generated_Files ->Application_manager.h
edit pre-programmed sendtocloud function
C:
static void sendToCloud(void)
{
static char json[PAYLOAD_SIZE];
static char publishMqttTopic[PUBLISH_TOPIC_SIZE];
int len = 0;
uint8_t sw0 = SW0_GetValue() != 0;
memset((void*)publishMqttTopic, 0, sizeof(publishMqttTopic));
sprintf(publishMqttTopic, "%s/sensors", cid);
// This part runs every CFG_SEND_INTERVAL seconds
if (shared_networking_params.haveAPConnection)
{
len = sprintf(json,"%u",sw0);
}
if (len >0)
{
CLOUD_publishData((uint8_t*)publishMqttTopic ,(uint8_t*)json, len);
if (holdCount)
{
holdCount--;
}
else
{
ledParameterYellow.onTime = LED_BLIP;
ledParameterYellow.offTime = LED_BLIP;
LED_control(&ledParameterYellow);
}
}
}
after firmware of the AVR IoT board is updated..
Check AWS IoT core server to make sure whether is it work or not.
as you can see it works, when swtich button is pressed board will send 0 to the AWS Iot Core server and 1 if switch button is not pressed.
Our board is ready..
Let's continue build smartphone application
The concept here is , when board is pressed by blind people, it will send "0" data to AWS IoT Core server
This data will be subscribed by smartphone application that will be made.
So there are 2 smartphone application we will build.
First as gps sensor (Function is to replace broken gps sensor that i bought)
and second smartphone application for tracking the positiion..
Like I told you on the first thread of this tutorial
the concept is
Blind people bring Embedded device (switch button + microcontroller Wrapped by box) and also smartphone as WIFI Teathering connection.
We will use this smartphone also as our gps sensor. so when switch button is pressed, it will request to smartphone for sending gps location to the cloud.
the gps location will be accessed by other smartphone application. and we can track the location.
Without further ado lets start make 1st application
SMARTPHONE APPLICATION AS GPS SENSOR
open app inventor 2 by click this link
http://ai2.appinventor.mit.edu/
start new project and follow component that I used.
There are
- Label1
- Label2
- UsrPahoMqttClient1
- LocationSensor1
- Clock1 - 3
- text to speech
program the application with this block
Now Build the application and download it by scan the Generated QR Code
Now let's run the application on our smartphone and check the AWS IoT Core server
is it correctly set up or not.
Open AWS IoT Core and click test and subscribe for {id}/sensors & {id}/location
You can see at {id}/sensor, when I pressed the button it will send "0" data.
and the smartphone application will response the "0" data by sending gps coordinate (Latitude & Longitude ) :
-6.34766,107.11111
To make sure this coordinate is accurate, I will check it on google maps website
Yeayy..... the coordinate is accurate, when I make this app I am exactly on the red pin map.
I think we are done....
eitss... but wait we will make another app for tracker application
SMARTPHONE APLICATION TRACKET
Same with previous step,
go to app inventor 2 and start new project and follow component that I used.
- Lable1
- Map1
- Marker1
- Button1
- Locationsensor1
- UrsPahoMqttClient1
- ActivityStarter1
- Clock1
after make the view like the picture i'ts time to program it with block
follow my blocks
Build the software application and download it.
and we are done..
Please watch the video for the demo