Open klaasdc opened 10 years ago
You have to make some changes in WiFiRM04.cpp, line 11 and line 12:
int16_t WiFiRM04Class::_state[MAX_SOCK_NUM] = { NA_STATE }; uint16_t WiFiRM04Class::_server_port[MAX_SOCK_NUM] = { 0 };
Thanks! It compiles now, but haven't tested it on the board yet.
Anyway, I added some preprocessor commands to automate selection: In WiFiRM04.cpp, line 11:
#if MAX_SOCK_NUM == 1
int16_t WiFiRM04Class::_state[MAX_SOCK_NUM] = { NA_STATE };
uint16_t WiFiRM04Class::_server_port[MAX_SOCK_NUM] = { 0 };
#else
int16_t WiFiRM04Class::_state[MAX_SOCK_NUM] = { NA_STATE, NA_STATE };
uint16_t WiFiRM04Class::_server_port[MAX_SOCK_NUM] = { 0, 0 };
#endif
In at_drv.cpp, line 41:
#if defined(__AVR_ATmega328P__)//Arduino Uno
//Only one Serial port available
#define AT_DRV_SERIAL Serial
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)//Arduino Mega
// use Serial1 as default serial port to communicate with WiFi module
#define AT_DRV_SERIAL Serial1
// use Serial2 to communicate the uart2 of our WiFi module
#define AT_DRV_SERIAL1 Serial2
#endif
In at_drv.cpp, line 2213:
#ifdef AT_DRV_SERIAL1 //Check if 2nd serial port is to be used
HardwareSerial AtDrv::serialPort[] = {AT_DRV_SERIAL, AT_DRV_SERIAL1};
#else
HardwareSerial AtDrv::serialPort[] = {AT_DRV_SERIAL, AT_DRV_SERIAL};
#endif
KlaasDC
Hi,
Thank for your suggestion. I've fixed this issue.
i use arduino uno and did the following changes:
inside at_drv.cpp, and set
inside "wl_definitions.cpp"
Still i get the same error while compiling as, \utility\at_drv.cpp:2207: error: 'Serial1' was not declared in this scope \utility\at_drv.cpp:2207: error: 'Serial2' was not declared in this scope
Looking forward for suggestions to set this right and make the module work.
Hi KrithikaRaja,
Try to define both AT_DRV_SERIAL and AT_DRV_SERIAL1 as Serial as the following:
Hello, I've rectified that. Thank you for your response. I have another query. I connected the module with my home network. I'm able to scan the available network through the program. But when I try to connect it with WPA network, I get 'echo no response, can't switch to at mode ' in the serial window. Where have i gone wrong ? Pls guide me. I use arduino mega 2560 and hlk -rm04 Wi-Fi module On 17 Mar 2015 11:55, "chunlinhan" notifications@github.com wrote:
Hi KrithikaRaja,
Try to define both AT_DRV_SERIAL and AT_DRV_SERIAL1 as Serial as the following:
define AT_DRV_SERIAL Serial
define AT_DRV_SERIAL1 Serial
— Reply to this email directly or view it on GitHub https://github.com/chunlinhan/WiFiRM04/issues/3#issuecomment-82142502.
Hi KrithikaRaja,
Would you mind to show me the debug message? BTW, the sketch you're using is "ConnectWithWPA.ino" ?
Hello, Thank you so much for your kindness! I've just fixed it. It's working. Thanks again! On 17 Mar 2015 12:42, "chunlinhan" notifications@github.com wrote:
Hi KrithikaRaja,
Would you mind to show me the debug message? BTW, the sketch you're using is "ConnectWithWPA.ino" ?
— Reply to this email directly or view it on GitHub https://github.com/chunlinhan/WiFiRM04/issues/3#issuecomment-82170599.
I'm trying to compile the library for an Arduino Uno, since I have this module as a shield version ( http://ledsee.com/index.php/arduino-modules2013-02-16-10-32-17/arduino-shields/wifi-arduino-schield-detail )
The Uno has only 1 serial port, so I changed
inside at_drv.cpp, and set
inside "wl_definitions.cpp" to avoid Serial1 and Serial2 not defined error
But now I get new errors:
Is the code only meant for Arduino Mega? Thanks