learningphase
learningphase
Learning Phase
11 posts
Don't wanna be here? Send us removal request.
learningphase · 9 years ago
Text
Arduino, Phase 8 : Still ESP8266
Hello! Meet me and ESP8266 again for many times. Sooo, I’m going to tell you what is the problem now.
First, we’re having trouble updating ESP8266. It turns out that our ESP8266 still can’t connect. We’re panic, so we’re trying to borrow from other group. But when my partner try to update it again, it finally works. He said, it’s probably because the ESP8266 didn’t set to “update” state.
After a long way to go, when updating ESP8266, we’re facing the next problem.
We still can’t send data automate. From the log here, we get that
Tumblr media
Now, this is the comparasion
Tumblr media
Actually, we sent the same data. But if it’s automatic, it can be updated to database. Because the respon was 200 OK. For the manual, we get 400 BAD REQUEST. Maybe because of the syntax? But the log said that. :((
After that, we asked our friends that already know how to send data automatically. He said, he was using another ESP8266 and it worked. Probably, ESP8266 we use already had junk in the hardware and can’t send it properly.
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 7 : Never Ending ESP8266
HI fellas! This is our story with ESP866. Again. And again. So, our team met again this Thursday and tried to make ESP8266 working well. As we used before, we need
Arduino uno
ESP8266
Cable
3 resistor 220k ohm
As we said before, we connect our Arduino to ESP8266. What we did in this section, we tried to check our PHP code with browser. And it works
Nah, our main problem now is, we still can’t send our data well. We have two reason here. First, we can send manually with AT Command, but can’t do it automatically. Second, we have problem with pin.
Okay, so let’s start with our journey with AT Command. We test our ESP8266 with blank code and upload it to Arduino. And then, we input it manually using serial monitor like this.
AT+CWJAP=”Connectify-huntul”,”huntulkece”
AT+CIPSTART=”TCP”,”192.168.28.1″,80
AT+CIPSEND=<data length>
On the first step, we tried to connect ESP8266 to Luthfi’s laptop as an acess point. On the second stp, we tried TCP connection with server. On the third step, we tried to send the data. But when we tried last step, we got respond like this.
400 (Bad Request)
408 (Request Time Out)
We tried to solve the first problem, for 400 error. We think that we wrote the wrong code. So, we tried to look into some server log for some request samples. We tried to fix our code and we got some syntax here.
GET /attendance.php?id=”somevalueshere” HTTP/1.0/
Then, we look for 408 error. We Googled it and we found this article
http://electronics.stackexchange.com/questions/177031/esp8266-wont-send-or-receive-returns-busy-s
It is said that the data length was not set properly. If it is not big enough, we can’t send data to server. At first, we think counting the character itself is enough. We forgot that “enter” in serial monitor would be include in it. So we give extra space for that enter. That article said, we should give 4 extra bytes (2 for hit the first enter, confirm data sent and 2 for hit the socnd enter, confirm data to the server). If we want to send 44 bytes, we should make it 48 bytes.
After we got some properly change, we tried to send data like this.
Tumblr media
It is said 200 OK. Our request sucessfully received by the server and its process the request and give the proper response. Because of we connect it to the database, we got two response.
When the value sent match with the one on database, then the response “record updated sucessfully”
When the value sent don;t match with the one on database, then the response “no value matched”.
Because we got second response before, we tried the same value now. Hope we got the first response after this
Tumblr media
And we got the first! It means finally the value matched with the one in the database.
But, we only got this far. We still can’t do it with automated code, only via serial monitor. So, we search for some reference and got this
http://www.instructables.com/id/Arduino-Esp8266-Post-Data-to-Website/
After necessary changes, this is our code
#include “SoftwareSerial.h”
String ssid =”Connectify-huntul”;
String password=”huntulkece”;
SoftwareSerial esp(6, 7);// RX, TX
String data;
String server = “192.168.28.1”; // http://www.example.com
String uri = “/attendance.php”;// our example is /esppost.php
int DHpin = 8;//sensor pin
byte dat [5];
String temp ,hum;
void setup() {
//pinMode (DHpin, OUTPUT);
esp.begin(115200);
Serial.begin(115200);
reset();
connectWifi();
}
//reset the esp8266 module
void reset() {
esp.println(“AT+RST”); delay(100); if(esp.find(“OK”) ) Serial.println(“Module Reset”); }
//connect to your wifi network
void connectWifi() {
String cmd = “AT+CWJAP=\”” +ssid+”\”,\”” + password + “\””;
esp.println(cmd);
delay(4000);
if(esp.find(“OK”)) {
Serial.println(“Connected!”); }
else {
Serial.println(“Cannot connect to wifi”); }
}
byte read_data () {
byte data;
for (int i = 0; i < 8; i ++) {
if (digitalRead (DHpin) == LOW) {
while (digitalRead (DHpin) == LOW); // wait for 50us
delayMicroseconds (30); // determine the duration of the high level to determine the data is ‘0 ‘or ‘1’
if (digitalRead (DHpin) == HIGH)
data |= (1 << (7-i)); // high front and low in the post
while (digitalRead (DHpin) == HIGH);
// data ‘1 ‘, wait for the next one receiver
}
} return data; }
void start_test () {
digitalWrite (DHpin, LOW); // bus down, send start signal
delay (30); // delay greater than 18ms, so DHT11 start signal can be detected
digitalWrite (DHpin, HIGH);
delayMicroseconds (40); // Wait for DHT11 response
pinMode (DHpin, INPUT);
while (digitalRead (DHpin) == HIGH);
delayMicroseconds (80);
// DHT11 response, pulled the bus 80us
if (digitalRead (DHpin) == LOW);
delayMicroseconds (80);
// DHT11 80us after the bus pulled to start sending data
for (int i = 0; i < 4; i ++)
// receive temperature and humidity data, the parity bit is not considered
dat[i] = read_data ();
pinMode (DHpin, OUTPUT);
digitalWrite (DHpin, HIGH);
// send data once after releasing the bus, wait for the host to open the next Start signal
}
void loop () {
//start_test ();
// convert the bit data to string form
//hum = String(dat[0]); hum = “DATA_DATA-AN”; //temp= String(dat[2]); temp = “syalala”;
data = “?id=” + temp; httppost();
delay(1000);
}
void httppost () {
esp.println(“AT+CIPSTART=\”TCP\”,\”” + server + “\”,80″);//start a TCP connection.
if( esp.find(“OK”)) {
Serial.println(“TCP connection ready”);
} delay(1000);
String postRequest =
“GET ” + uri + data + ” HTTP/1.0/\r\n”;
String sendCmd = “AT+CIPSEND=”;//determine the number of caracters to be sent.
esp.print(sendCmd);
esp.println(postRequest.length() );
delay(500);
if(esp.find(“>”)) { Serial.println(“Sending..”); esp.print(postRequest);
if( esp.find(“SEND OK”)) { Serial.println(“Packet sent”);
while (esp.available()) {
String tmpResp = esp.readString();
Serial.println(tmpResp);
}
// close the connection
esp.println(“AT+CIPCLOSE”);
}
}}
Buuut, I didn’t know somehow if we send it with serial software, we can’t make it automated. This is the result from serial monitor
Tumblr media
Actually, we can connect it to ESP8266. But it looks like the data keep sent by itself, but we got no response. Let’s take a look on the server log.
Tumblr media
It looks like ESP8266 spam our server. I guess that is for now.
0 notes
learningphase · 9 years ago
Text
Arduino, Final Project : Smart School. Part 1 : RFID reader
Hello fellas! Today, I’m going to tell you our progress for our final project, smart school. First of all, our RFID reader arrived on Tuesday, soo on Wednesday, we’re trying to make it.
So, we needArduino uno
Arduino uno
Cable
RFID reader (RDM 6300 series)
So, what we do in this section are (our reference http://www.instructables.com/id/Arduino-Tutorials-RFID/?ALLSTEPS)
Connect arduino to RFID reade
Code it
Trying to read ID from card (in this section, we’re using Master Game Card). Actually, we want to use our ID card, but our RFID have different frequency, so we can’t use it.
This is our baby uuuu
Tumblr media
And this is when we’re using RFID
Tumblr media
Our code
#include <SoftwareSerial.h> SoftwareSerial RFID(2, 3); // RX and TX int i;
void setup() { RFID.begin(9600); // start serial to RFID reader Serial.begin(9600); // start serial to PC }
void loop() { if (RFID.available() > 0) { i = RFID.read(); Serial.print(i, DEC); Serial.print(” “); } }
Actually, we were trying to use our Student Card (that have RFID tags). But, we can’t read it. Than, we changed it using Game Master card and it worked well. So, our conclusion is the Game Master card and our Student Card have different frequency. But the important thing is, we’re sucessfull using this RFID reader.
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 6 : (Still) Sending Data with ESP
Hi fellas! My team still hev to struggling with ESP. We can’t connect it in last assignment, but we were trying to make it better this time.
So, what we’re going to do in this section will be those
Connect the wiring of FTDI to ESP
Upload the code from Arduino IDE to FTDI-ESP connection
Connect to my laptop access point with AT+CWJAP command
Start a connection with the server on my laptop with AT+CIPSTART command
Initiate and send the data to server with AT+CIPSEND command
Check on server whether the data has been sent from ESP
How to set the FTDI? Me too, I don’t know (ha ha). No no, let me tell you this
We use an empty block of codes inside the setup() and loop() procedures on Arduino IDE. We upload the code to the FTDI-ESP connection, and use the serial monitor to do the AT Commands. Those are the AT Commands
AT+CWJAP=”ssid”,”password” (connect to access point)
AT+CIPSTART=”TCP”,”ip address”,port (connect to server)
AT+CIPSEND=”data length” (initate and send data to server)
Sooo, we’re trying to connect to web server with Luthfi’s laptop. In his laptop, he’s using XAMPP web server.
Yo, we have bad news here :( Actually, we get some notifications that told us that “400 (Bad Request)” and “408 (Request Time Out)”. But actually, we can connect it to server. Here’s the picture
Tumblr media Tumblr media Tumblr media
But this is the bad news
Tumblr media
My prediction is, the problem lies on the request syntax from the ESP. I bet that the syntax is wrong, thus the server cannot understand it. But until now, we still don’t know how the syntax should be because every single time we send the data it always get a 400 or 408 response from the server.
-in Luthfi I trust
Maybeeee, we’re going to do this again in some time again. Byeeeee.
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 5 : Sending Data with ESP
Hi, meet me again in this blog! Soo today I’m going to write about sending data with ESP. After all those failuers, finally we can made our ESP8266 work.
So, what do we need?
We need
Arduino
Resistor 220k ohm
ESP8266
Some cable
Sensor, but it’s not that necessary because you can replace it with dummy data
We’re not a pro, so we look for reference and here it is : http://www.instructables.com/id/Arduino-Esp8266-Post-Data-to-Website/
First, we connect all of thoooose things like this
Tumblr media
This is the evidence that the ESP is working.
Tumblr media
Finally, an access point with our ESP8266. We made it by AT Command. At first, it didn’t work like this because.. Simply we can’t get any respond. Anyway, AT Command is a list of built-in commands inside the ESP itself, which means even without using Arduino ESP could actually work by itself as an independent WiFi module.
Tumblr media Tumblr media
But actually....
We can’t upload our code to web server. We didn’t know what’s the main problem, it’s simply the code didn’t work after we upload it. The ideal condition are
ESP will try to connect to web server. The status of the connection then should be reported on the serial monitor. After connected, Arduino will send some dummy data using the AT Command of ESP which have been precoded previously. If the data has been sent successfully, ESP will again report that on the serial monitor. Then web server will receive the data and store them on the server. Users can see the data being stored from a web browser, and our assignment should be finished.
-said Luthfi
Buuut the condition didn’t like that. Our serial monitor can’t show anything. Doom.
Yeah, anyway, happy holiday.
0 notes
learningphase · 9 years ago
Text
Arduino, Final Project : Smart School
Finally, my team have to decided the title for our final project. From brainstorming, we get three ideas. First, drone. Second, smartqua. And last, smart school. Drone, yeah everyone knows about it. We want to make drone that can take picture and send it to website. This helps us to see area that we can’t reach, like when there’s earthquake or tsunami. Smartqua, it’s like monitoring system for pond. This is because pond needs extra care for every little detail, like the level of oxygen or nitrogen. Last, smart school is system you use to get data you need from student’s card. This system can help to check attendance is easier or to pay something at canteen.
We made feasibility analysis. Those aspects we consider are : price, time, human resource, need, and capabilities. We also make point for every object. We used scale 1-10 for every object.
Tumblr media
Okay, so let’s know more about smart school!
We choose this project because we look at student’s card is only used for ID card. But, we can make it more useful by add RFid in it. We can use this RFid to check the attendance or we can make something for pay in canteen. The price for the card is high enough. Why don’t we use it for something else?
The system design we propose are:
System can read user identity via RFid code
System can send RFid code to server
Server can search and match the RFid code with identity ID in database
Server can show output from identity match
Server can reduce saldo of RFid user
The input for our smart school is tap using RFid. After that, the process are either checking database for attendance or simply reduce the saldo that the card reader had for paying. The output is updated attendance and saldo.
Sooo, we need
Arduino uno
FTDI
RFid Reader
Jumper
ESP8266
Resistor
Potensiometer
Maybe something we’re not figure it out right now
This is our system block diagram
Tumblr media
This is our software block diagram.
Tumblr media
This is our hardware block diagram
Tumblr media
See, ciayo!
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 4 : Basic Calculator
We had another task.
The components are
Arduino uno
Keypad 4x4
LCD 16x2
Breadboard
Wire
So, we made calculator and get the input from keypad, and we show the output with LCD. It’s really basic calculator.
At the first attempt, we tried to make complete wiring, using both of keypad and LCD at the same time. But unfortunately, it didn’t work.
So, we tried to make something with keypad first. We used keypad to make input the data to serial monitor on laptop.
After that, we tried to make a code and show it on LCD. Here’s the result when the LCD on.
Tumblr media
After that, we tried to make the complete calculator. Here’s the result.
Tumblr media
Here’s the code for our calculator
https://github.com/safaracathasa/IMKA/blob/master/calculator.cpp
youtube
The problem we face on this task are
1. The backlight for the LCD didn’t turn on. I don’t know why pin 1 on our arduino can’t be used. So, we can’t turn the backlight on.
2. The pin isn’t enough, so we only use 3x4 keypad, not 4x4. We didn’t uss different input from keypad to do operation, instead we only use a certain input, which is ‘*’ input, as a substitute. For example, if we want to do addition operation which is use ‘+’symbol, we have to press the ‘*’ button a certain times. It’s the same principle applied to the rest of operations.
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 3 : Wifi Module using FTDI
So meet me again with my arduino! So, for my Human and Interaction Design subject, my team (include Yusuf, Nunu, Irfan) should make calculator and implementing wifi module. So, for wifi module, we found a LIGHT side (yeah like Jedi on Star Wars), using a module called FTDI. It will provide you 3,3V, exactly, and you can code it with Arduino software on your PC. Yaay. It will make your arduino and components last longer because you don’t have to code while plug in it the computer.
Actually, we found this LIGHT side because of our team member, Nunu, ask her dad about arduino. Actually her dad like to make something with microcontroller for their work. So, at her home, Nunu tried FTDI and ESP8266 with her dad. They did it without arduino, wuhuuuu. After they done, Nunu used some libraries prepared fot FTDI and made some web server. She tried to access it via web browser and by thing its IP address, she could open a webpage template of FTDI. Sooooo we can make our own webpage and put in on FTDI and we have web server. Wow. I never know Internet of Things can do something like this.
Here’s the cool picture of FTDI
Tumblr media Tumblr media
But, this week when we tried to make it by ourselves, we didn’t make it because we buy the wrong FTDI component. :( Maybe in the third attempt, we will make it success
0 notes
learningphase · 9 years ago
Text
Ardunio, Phase 2 : Wifi Module
Due to my college assignment, Human Interaction and Computer, my team (me, Nurizka, Luthfi, Irfan P.) should learn about wifi module. The series of this module is ESP8266. Here is the picture
Tumblr media
Actually, before start anything, we search about this module. The maximum voltage for ESP8266 is 3V, so we should use resistor so the voltage won’t be more than 3V.
But we had another problem. We didn’t have resistor so we’re afraid to test it with arduino. So, we postpone it.
See you in the next post!
0 notes
learningphase · 9 years ago
Text
Arduino, Phase 1
So this semester, for one of my subject, Human Interaction and Computer, I’m going to make arduino project again. I have team consist of four people. Me, Nurizka, Luthfi, and Irfan. We’re doing something like “test project” before make something big. So, in this phase, we’re going to make something like thermometer. We’re using LM35 sensor for heat and two seven-segments for display. And breadboard plus cable for install the properties.
We done this project only in several hours because Luthfi is very smart doing this project.
We’re facing many problems for this test project.
1. The wire isn’t installed properly because the quality of cable
Tumblr media
2. The code doesn’t work properly. So at the first, seven segment shows the degree too hot
Tumblr media
3. We have to change the computer because arduino’s software version at Irfan’s laptop doesn’t compatible with arduino uno
But finally, we manage to make the arduino work properly
Tumblr media
0 notes
learningphase · 9 years ago
Text
Welcome
Hi fellas! This would be my second tumblr. I’m going to post my portfolio during my college’s year. (Which is only 3 semesters again). It’s kinda late, but it’s okay than doing nothing. Happy reading!
0 notes