2017년 2월 14일 화요일

Arduino Common Error



Arduino Common Error

Introduction

For a beginner, sometime we will meet some compilation or upload errors. Here we summarize some common errors and solutions, hope this can help.
Q1:
Maybe you hadn’t put the right Library to libraries, if you can sure have the Library, then try closing Arduino IDE, and reopen it.
Q2:
Maybe you had forgotten to plug your Arduino, try re-plugging the USB cable.
Q3:
Maybe you had chosen the wrong board, try choosing the right board, or re-plug you USB cable. If your board is Seeeduino, check if M_RST_AUTO switch to AUTO.
Finally, whenever you meet some unknown problem, try re-plug your USB cable, this will solve almost half of your problem!

Resources Download

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking

AT Command Tester Application



AT Command Tester Application

Introduction

AT Command Tester is an online tool for testing AT commands and other module functionalities such as data callvoice call,HTTPnetwork registrationSMSPhonebooksignal qualitySIM interfacedevice info etc.
AT Command Tester can be used with 2G Modules (GPRS/EDGE/1x) or 3G Modules (HSDPA/HSPA/EVDO) or 4G modules (LTE)
First select ‘Find Ports’ to search for avaialble ports. Then select the modem port and press ‘Connect’. Once connected to the module, you can send AT commands from the ‘Command Mode’ tab
In script mode, you can send multiple AT commands at a same time as shown below. You can create your own script and save it on the local machine.Then load the script and execute.
To perform basic diagnostics on the SIM900 module, choose the ‘Diagnostics’ tab,The diagnostics commands and the results are shown an below, AT+CGMI SIMCOM_Ltd OK Manufacturer : SIMCOM_Ltd AT+CGMM
SIMCOM_SIM900
OK Model Number : SIMCOM_SIM900
Revision:1137B03SIM900M64_ST_MMS
OK Revision : Revision:1137B03SIM900M64_ST_MMS
+CSQ: 8,0
OK Signal level is -97 dbm. Signal condition is marginal.The signal strength range is -53 dbm (Excellent) to -109 dbm (Marginal).
+CREG: 0,1
OK The device is registered in home network.
+CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0
OK Device is NOT connected.
+COPS: 0,0,”T-Mobile”
OK Device is currently on “T-Mobile” network.
+CPIN: READY OK
SIM is ready.
Voice Call with SIM900 Select the ‘Voice Call’ tab to test outgoing and incoming voice calls. The ‘AT Command Tester’ will check whether the device is registered before dialing the call,
The AT command sequence for outgoing call is shown below, Checking registration status… AT+CREG? +CREG: 0,1 OK The device is registered in home network. Dialing number 858xxxxxxx
ATD858XXXXXXX;
OK Voice call successfull Hanging up the call..
ATH
OK Call sucessfully dis-connected..
+CNUM: “”,”1858XXXXXXX”,129,7,4 OK
GPRS Data call with SIM900
To setup GPRS call with the SIM900 modem, select the ‘Data Call’ tab. Here you can get all the PDP context stored on the device. The PDP context has carrier APN and other information that are required to set up a GPRS call.
Here is the sequence of AT commands to set up data call
+CGDCONT: 1,”IP”,”epc.tmobile.com”,”0.0.0.0”,0,0 +CGDCONT: 2,”IP”,”test5”,”0.0.0.0”,0,0 +CGDCONT: 3,”IP”,”“,”0.0.0.0”,0,0
OK Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
Checking if device is already connected…
+CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0
OK Attaching to network… AT+CGATT=1
OK
Connecting…
OK Connect Sucessful
SMS with SIM900 Select the ‘SMS’ to send SMS messages. You can also read and delete SMS messages stored on the SIM.
Here is the sequence of AT commands to send SMS message,
Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
AT+CMGS=”858XXXXXXX”
> Test Message with AT Command Tester�
+CMGS: 19
OK SMS Send successful
Network Selection Network selection enables the user to select the network that is available. Use the ‘Network Selection’ tab for this feature,
Here are the commands for Network Selection,
Finding Networks. Please wait..
+COPS: (2,”T-Mobile”,”T-Mobile”,”310260”),(1,”AT&T”,”AT&T”,”310410”),,(0,1,4),(0,1,2)
OK Networks found
Phonebook
With the ‘Phone Book’ tab, you can add/delete/read phone book entries stored on the SIM,
Getting phonebook entries..
+CPBR: 1,”*233”,129,”Refill Now”
+CPBR: 2,”#999#”,255,”Check Balance”
+CPBR: 3,”8878878878”,129,”Test”
OK
SIM900 HTTP
With the ‘HTTP’ tab, you can read the bearer profiles and test HTTP GET and HTTP POST,
Getting Bearer profiles..
AT+SAPBR=4,1
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK AT+SAPBR=4,2
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK AT+SAPBR=4,3
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK
Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
Querying bearer 1 .
AT+SAPBR=2,1
+SAPBR: 1,1,”162.184.222.162”
OK Bearer 1 is Connected.IP address is “162.184.222.162”
Bearer 1 is Connected.
Initializing HTTP service…
OK Error initializing HTTP service.
Setting up HTTP parameters..
OK AT+HTTPPARA=”CID”,1[[|]]
OK
HTTP GET is sucessful
+HTTPREAD:58 Sucessful HTTP GET test. Data received from m2msupport.net OK Terminating HTTP session..
OK
SIM900 FTP
FTP Get and Put with SIM900 module can be tested as shown below,
Checking registration status…
AT+CREG?
+CREG: 0,1
OK The device is registered in home network.
Querying bearer 1 .
AT+SAPBR=2,1
+SAPBR: 1,1,”162.184.222.162”
OK Bearer 1 is Connected.IP address is “162.184.222.162”
Bearer 1 is Connected.
Setting up FTP parameters..
OK
AT+FTPSERV=”ftp.m2msupport.net”
OK AT+FTPUN=”xxxxxx”
OK AT+FTPPW=”xxxxxxx”
OK AT+FTPGETNAME=”ftptest.txt”
OK AT+FTPGETPATH=”/www/m2msupport/”
OK AT+FTPGET=1
OK
+FTPGET:1,1 FTP session sucessfully started
AT+FTPGET=2,1024
+FTPGET:2,784 2-11-16 10:53:34.769 ----------------------------------------------- eclipse.buildId=M20120914-1800 java.version=1.6.0_16 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.m2e.logback.appender 4 0 2012-11-16 12:11:54.493 !MESSAGE Unable to update index for central|http://repo.maven.apache.org/maven2: C:\Users\sgobi.m2\repository.cache\m2e\1.2.0\26522e0d83a422eed93329ece7565cfc\nexus-maven-repository-index.zip (The system cannot find the file specified)
!ENTRY org.eclipse.jdt.ui 4 10001 2012-11-16 13:21:21.138 !MESSAGE Internal Error !STACK 1 OK AT+FTPGET=2,1024
+FTPGET:2,0
OK FTP data transfer is complete
+FTPGET:1,0 FTP session end

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking

AT Command Tester



AT Command Tester

Introduction

AT Command Tester is an online tool for testing AT commands and other module functionalities such as data callvoice call,HTTPnetwork registrationSMSPhonebooksignal qualitySIM interfacedevice info etc.
AT Command Tester can be used with 2G Modules (GPRS/EDGE/1x) or 3G Modules (HSDPA/HSPA/EVDO) or 4G modules (LTE)
First select ‘Find Ports’ to search for available ports. Then select the modem port and press ‘Connect’. Once connected to the module, you can send AT commands from the ‘Command Mode’ tab
In script mode, you can send multiple AT commands at a same time as shown below. You can create your own script and save it on the local machine.Then load the script and execute.
To perform basic diagnostics on the SIM900 module, choose the ‘Diagnostics’ tab,The diagnostics commands and the results are shown an below, AT+CGMI SIMCOM_Ltd OK Manufacturer: SIMCOM_Ltd AT+CGMM
SIMCOM_SIM900
OK Model Number : SIMCOM_SIM900
Revision:1137B03SIM900M64_ST_MMS
OK Revision: Revision:1137B03SIM900M64_ST_MMS
+CSQ: 8,0
OK Signal level is -97 dbm. Signal condition is marginal.The signal strength range is -53 dbm (Excellent) to -109 dbm (Marginal).
+CREG: 0,1
OK The device is registered in home network.
+CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0
OK Device is NOT connected.
+COPS: 0,0,”T-Mobile”
OK Device is currently on “T-Mobile” network.
+CPIN: READY OK
SIM is ready.

Voice Call with SIM900

Select the ‘Voice Call’ tab to test outgoing and incoming voice calls. The ‘AT Command Tester’ will check whether the device is registered before dialing the call,
The AT command sequence for outgoing call is shown below, Checking registration status… AT+CREG? +CREG: 0,1 OK The device is registered in home network. Dialing number 858xxxxxxx
ATD858XXXXXXX;
OK Voice call successfull Hanging up the call..
ATH
OK Call sucessfully dis-connected..
+CNUM: “”,”1858XXXXXXX”,129,7,4 OK

GPRS Data call with SIM900

To setup GPRS call with the SIM900 modem, select the ‘Data Call’ tab. Here you can get all the PDP context stored on the device. The PDP context has carrier APN and other information that are required to set up a GPRS call.
Here is the sequence of AT commands to set up data call
+CGDCONT: 1,”IP”,”epc.tmobile.com”,”0.0.0.0”,0,0 +CGDCONT: 2,”IP”,”test5”,”0.0.0.0”,0,0 +CGDCONT: 3,”IP”,”“,”0.0.0.0”,0,0
OK Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
Checking if device is already connected…
+CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0
OK Attaching to network… AT+CGATT=1
OK
Connecting…
OK Connect Sucessful

SMS with SIM900

Select the ‘SMS’ to send SMS messages. You can also read and delete SMS messages stored on the SIM.
Here is the sequence of AT commands to send SMS message,
Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
AT+CMGS=”858XXXXXXX”
> Test Message with AT Command Tester�
+CMGS: 19
OK SMS Send successful

Network Selection

Network selection enables the user to select the network that is available. Use the ‘Network Selection’ tab for this feature
Here are the commands for Network Selection,
Finding Networks. Please wait..
+COPS: (2,”T-Mobile”,”T-Mobile”,”310260”),(1,”AT&T”,”AT&T”,”310410”),,(0,1,4),(0,1,2)
OK Networks found

Phonebook

With the ‘Phone Book’ tab, you can add/delete/read phone book entries stored on the SIM,
Getting phonebook entries..
+CPBR: 1,”*233”,129,”Refill Now”
+CPBR: 2,”#999#”,255,”Check Balance”
+CPBR: 3,”8878878878”,129,”Test”
OK

SIM900 HTTP

With the ‘HTTP’ tab, you can read the bearer profiles and test HTTP GET and HTTP POST,
Getting Bearer profiles..
AT+SAPBR=4,1
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK AT+SAPBR=4,2
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK AT+SAPBR=4,3
+SAPBR: CONTYPE: GPRS APN: PHONENUM: USER: PWD: RATE: 2
OK
Checking registration status…
+CREG: 0,1
OK The device is registered in home network.
Querying bearer 1 .
AT+SAPBR=2,1
+SAPBR: 1,1,”162.184.222.162”
OK Bearer 1 is Connected.IP address is “162.184.222.162”
Bearer 1 is Connected.
Initializing HTTP service…
OK Error initializing HTTP service.
Setting up HTTP parameters..
OK AT+HTTPPARA=”CID”,1[[|]]
OK
HTTP GET is sucessful
+HTTPREAD:58 Sucessful HTTP GET test. Data received from m2msupport.net OK Terminating HTTP session..
OK

SIM900 FTP

FTP Get and Put with SIM900 module can be tested as shown below,
Checking registration status…
AT+CREG?
+CREG: 0,1
OK The device is registered in home network.
Querying bearer 1 .
AT+SAPBR=2,1
+SAPBR: 1,1,”162.184.222.162”
OK Bearer 1 is Connected.IP address is “162.184.222.162”
Bearer 1 is Connected.
Setting up FTP parameters..
OK
AT+FTPSERV=”ftp.m2msupport.net”
OK AT+FTPUN=”xxxxxx”
OK AT+FTPPW=”xxxxxxx”
OK AT+FTPGETNAME=”ftptest.txt”
OK AT+FTPGETPATH=”/www/m2msupport/”
OK AT+FTPGET=1
OK
+FTPGET:1,1 FTP session sucessfully started
AT+FTPGET=2,1024
+FTPGET:2,784 2-11-16 10:53:34.769 ----------------------------------------------- eclipse.buildId=M20120914-1800 java.version=1.6.0_16 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.m2e.logback.appender 4 0 2012-11-16 12:11:54.493 !MESSAGE Unable to update index for central|http://repo.maven.apache.org/maven2: C:\Users\sgobi.m2\repository.cache\m2e\1.2.0\26522e0d83a422eed93329ece7565cfc\nexus-maven-repository-index.zip (The system cannot find the file specified)
!ENTRY org.eclipse.jdt.ui 4 10001 2012-11-16 13:21:21.138 !MESSAGE Internal Error !STACK 1 OK AT+FTPGET=2,1024
+FTPGET:2,0
OK FTP data transfer is complete
+FTPGET:1,0 FTP session end

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking

A Handy Serial Library



A Handy Serial Library

Introduction

Arduino hadn’t debugging function, maybe this is the first impression of some software engineers. In fact, often we just use the Arduino to do some simple application, even there’s no debugging, and it does not matter. If you want to use the Arduino to do some complex application, such as face recognition, then maybe you have to rethink if you had chosen the wrong platform.
As for some simple application, we can use serial print to debug, and Arduino had provided a very easy to use serial print function.
void setup() { Serial.begin(115200); Serial.println("hello world"); } void loop() { // add code here }
Besides, there is Serial.print, Serial.write and so on. When you are familiar with these functions, you will find that these function is not so friendly actually, just have a look at the following code:
void setup() { Serial.begin(115200); Serial.print("a["); Serial.print(3); Serial.print("] = "); Serial.println(5); } void loop() { // add code here }
To print a[3]=5, it can take 4 lines of code, troublesom? Remember the C language lessons, it takes only one line of code:
printf("a[%d] = %d", 3, 5);
As for C++, one line is enough also:
cout << "a[" << 3 << "] = " << 5 << endl;
I will glad that if Arduino has the function such as printf or cout, it’s really convenient. It’s lucky that some guy had written such library, you can refer to http://arduiniana.org/libraries/streaming/ I made some small change to this library, you can download here: https://github.com/loovee/Streaming , why not have a try?

Resources

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking

A Comparison of Different Grove Temperature Sensors



A Comparison of Different Grove Temperature Sensors

Introduction


Temperature is a very important physical parameter to our daily lives. The measurement of temperature can be critical in industry applications and experimental test in labs, some home appliance also require measuring temperature for temperature control. The Grove family provides up to ten types of sensors that can be used to measure temperature. They all featured with high reliability and the easy-to-use Grove interface, but they do have their differences and may be used for different projects and applications. Here in this wiki we make a list of the key features of very Grove temperature sensors, include cost, measuring range, accuracy, sensitivity, response time, long-term stability and so on. The table can be a reference for you to choose the optimal sensor for your projects.

How to Choose the Optimal Temperature Sensor

Before you looking at the table, there are several things that need to be considered to select a right sensor for your project.

At first, what is the object to be measured?

Is it the ambient air temperature in the room or a specific enclosure? Is it an air vent for airflow or a water tank for liquid? Or maybe an electronic system that may encounter high voltage and cause heating? Things like these would affect your choice of sensors based on cost budget, power consumption, safety factors, response time, and even the distance from sensor to instrument. For example, if you are measuring the temperature in your room, you might just need a cheap, low-cost thermometer that does not need to be very sensitive. But if your object is a greenhouse for growing plants, you might need a high accurate and sensitive sensor that precisely measures both the temperature and humidity.

Secondly, what is the expected range of temperature to be measured?

The expected range of temperature to be measured is very important. If the object’s temperature exceeds the sensor’s measuring range, it may result in irreversible damage to the sensor module or even the system that is connected to the sensor.

Another consideration is, how accurate do you need it to be?

Temperature sensors like thermocouples have very wide measuring range and are adequate to be used in harsh environment, but they usually lack of accuracy and long-term stability. The accuracy of measurement is critical in some cases like medical devices, wearable devices and some home facilities etc. Sensors with higher accuracy usually have higher cost and they have to be used very carefully to avoid physical damage on it (some may require not touching it with bare hand).

Specification

Temperature Sensor NameInterfaceRangeAccuracySensitivityDatasheet
Temp&Humi SensorDigital0~50C+-2C1CDHT11
Temp&Humi Sensor ProDigital-40~80C+-0.5C0.1CDHT22/AM2302
Temperature SensorAnalog-40~125C+-1.5CN/ANCP18WF104F03RC
One Wire Temperature SensorOne Wire-55~125C+-0.5C0.5CDS18B20
High Temperature SensorAnalog-50~600C2%N/AK Type Thermocouple
Temperature&Humidity Sensor (High-Accuracy & Mini)I2C0~70C+-0.5C1CTH02
DIGITAL INFRARED TEMPERATURE SENSORI2C-40~85C+-0.5C0.02CMLX90615
Temperature&Humidity Sensor(SHT31)I2C-40~125C+-0.3C0.01CSHT31
INFRARED TEMPERATURE SENSORAnalog-10~100CN/AN/AOTP-538U
Temperature&Humidity Sensor(HDC1000)I2C-40~125C+-0.2C0.01CHDC1000
Barometer Sensor(BMP180)I2C-40~85C+-0.5C0.1CBMP180
Barometer Sensor(BMP280)I2C-40~85C+-0.5C0.01CBMP280
Temp&Humi&Barometer Sensor(BME280)I2C-40~85C+-0.5C0.01CBME280
More details please download below list.

Groves

Temp&Humi SensorTemp&Humi Sensor ProThermistor
GET ONE NOW!GET ONE NOW!GET ONE NOW!
ThermocoupleTH02Digital Infrared
GET ONE NOW!GET ONE NOW!GET ONE NOW!
SHT31InfraredHDC1000
GET ONE NOW!GET ONE NOW!GET ONE NOW!
BMP180BMP280BME280
GET ONE NOW!GET ONE NOW!GET ONE NOW!