2
votes

I am using the GSMSHIELD library with an Arduino Mega and I am getting the following error on two different systems.

/Users/-----/Documents/Arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::configandwait(char*)': /Users/-----/Documents/Arduino/libraries/GSMSHIELD/SIM900.cpp:62:18: error: 'class HWSerial' has no member named 'read' connCode=_cell.read();

I can trace this back through the GSM.h file:

#include "HWSerial.h"
...

HWSerial _cell;

and the Arduino HardwareSerial.h file:

  public:
inline HardwareSerial(
  volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
  volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
  volatile uint8_t *ucsrc, volatile uint8_t *udr);
void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
void begin(unsigned long, uint8_t);
void end();
virtual int available(void);
virtual int peek(void);
virtual int read(void);
<snip>

I can't for the life of me figure out why this won't compile, unless it's an Arduino development system version (1.6.9) issue...

I don't find any info on which versions of the IDE the library was written/tested on.

Any ideas?

1
Distributions aka "boards" can have totally different kernel of arduino, for example String without c_str() etc. Such cases have very similar image like Your problem. Source You see, probably isn't in working set.Jacek Cz
Yes, I understand that. But this library is made for either Uno or Mega, controlled by an #ifdef, so it's supposed to work with this board. It works for the Uno, but that uses software serial, I want to use the Mega's hardware serial. That is why I thought it might be a version issue...Arana
Did you managed to get it work?CallMeLaNN
No, I didn't. This was shortly before the project fell apart. I also noticed that the library seemed to be untouched for some time now. I think the owner has abandoned it and it needs to be updated to match the latest version of the IDE and associated libraries. If I get back to it the spring, and find a solution, I will post it here. Otherwise, let me know if you get anywhere with it.Arana

1 Answers

0
votes

Make sure you uncomment the first line in HWSerial.h from //#define MEGA to #define MEGA

There are two places for you to uncomment the define in order for you to use Mega instead of Uno board. That is in GSM.h and HWSerial.h!