Page 1 of 1

library problem on github

Unread postPosted:Tue Sep 17, 2019 11:22 am
by verenicolson
Just did fresh download from https://github.com/DFRobot/DFRobot_SIM7000 and used the example DFRobot_SIM7000_http from that download (Also fresh download of https://github.com/DFRobot/DFRobot_SIM tonight) and the current github code won't compile. get this error
Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\vere.nicolson\Documents\Arduino\SketchBook\DFRobotSIM7000HTTPtest\DFRobotSIM7000HTTPtest.ino:18:0:

C:\Users\vere.nicolson\Documents\Arduino\libraries\DFRobot_SIM7000-master/DFRobot_SIM7000.h:9:6: error: multiple definition of 'enum Protocol'

enum Protocol {

^

In file included from C:\Users\vere.nicolson\Documents\Arduino\libraries\DFRobot_SIM-master/DFRobot_SIM.h:7:0,

from C:\Users\vere.nicolson\Documents\Arduino\SketchBook\DFRobotSIM7000HTTPtest\DFRobotSIM7000HTTPtest.ino:12:

C:\Users\vere.nicolson\Documents\Arduino\libraries\DFRobot_SIM-master/DFRobot_SIMclient.h:6:6: note: previous definition here

enum Protocol {

^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Re: library problem on github

Unread postPosted:Tue Sep 17, 2019 11:30 am
by verenicolson
problem above was on Arduino IDE version 1.8.9

Re: library problem on github

Unread postPosted:Wed Sep 18, 2019 9:31 am
by nana.wang
Hi thanks for your support.
Have you added #include <DFRobot_SIM.h> to ino?
Please kindly note that once #include <DFRobot_SIM7000.h> is conluded, there is no need to add <DFRobot_SIM.h> .

Re: library problem on github

Unread postPosted:Wed Sep 18, 2019 10:51 am
by verenicolson
Yes I had included <DFRobot_SIM.h> Thank you

Now I have removed <DFRobot_SIM.h> it compiles but the serial output stopped at
"Turn ON SIM7000......"
This happened with both the HTTP and the AT examples so I thought there might be a problem before the boolean "sim7000.turnON()" is decided in the DFRobot_SIM7000.cpp file

To test I put the following debugs into the DFRobot_SIM7000.cpp file
" bool DFRobot_SIM7000::turnON(void)
{
pinMode(12,OUTPUT);
digitalWrite(12, HIGH);
delay(2000);
digitalWrite(12, LOW);
int i=3;
while(1){
Serial.println(F("in the [while(1) loop")); //VN inserted
i = 6;
delay(200);
baudrate = 19200;
setRate(baudrate);
send_cmd("AT\r\n");
while(i){
if(check_send_cmd("AT\r\n","OK",1,1000)){
return true;
Serial.println(F("in the true part of [ if(check_send_cmd())]")); //VN inserted
}
delay(20);
Serial.println(F("in the flase part of [ if(check_send_cmd())]")); //VN inserted
i--;
}
pinMode(12,OUTPUT);
digitalWrite(12, HIGH);
delay(2000);
digitalWrite(12, LOW);
}
} "

The resulting output was
" Turn ON SIM7000......
in the [while(1) loop
in the flase part of [ if(check_send_cmd())]
in the flase part of [ if(check_send_cmd())]
in the flase part of [ if(check_send_cmd())]
in the flase part of [ if(check_send_cmd())]
in the flase part of [ if(check_send_cmd())]
in the flase part of [ if(check_send_cmd())]
in the [while(1) loop
in the flase part of [ if(check_send_cmd())] "


Can you suggest a next step to see if this is a software or hardware issue?

Re: library problem on github

Unread postPosted:Thu Sep 19, 2019 1:31 am
by nana.wang
Hi have you read the wiki first?
If not, please check its wiki via SKU No. or Product No. in the wiki page.