Open SoundConception opened 9 years ago
I can confirm I get the same error messages with Arduino 1.6.3.
I also get the same issue when I try to compile any of the examples supplied with the library. eg ScanNetworks.ino
Further info: Developing for an Arduino Due, so can't go back to Arduino 1.0.6.
Hi,
May I know which Arduino borad you're using? I saw your error message and noticed that:
"c:\users\xxxx\appdata\roaming\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\sys\types.h:97:24: error: conflicting declaration 'typedef short unsigned int u_short' typedef unsigned short u_short;"
It seems you're not using Arduino AVR board? (because arm-none-eabi-gcc is gcc for ARM)
I've never tried to build this lib for non Arduino AVR boards (e.g. Arduino Due) but I've tried ScanNetworks.ino could be compiled successfully (Mega2560 board) with my IDE 1.6.3.
Hi,
Thanks for your response. Yes the board is an Arduino Due.
Would the solution be for me to rename this typedef from u_short
to perhaps something like u_short16
throughout the WiFiRM04 library?
Looking into this further the issues all seem to relate to various unsigned int data types.
u_short
type defined as an unsigned short
(ie at least 16 bit long)u_short
as a uint16
(ie exactly 16 bit long)size_t
as the third parameter to ServerDrv::getDataBuf (ie at least 16 bit long)According to http://www.arduino.cc/en/Reference/Int the Arduino Due stores ints as "a 32-bit (4-byte) value". How would you recommend I modify the library to take this into account? Thanks again for your help on this.
for size_t, I thought you could just convert it to uint16_t (Arudino's WiFi lib does this too, check Arduino\libraries\WiFi\src\WiFiClient.cpp)
It should be fine since most sketches won't read 64K bytes at once.
This what WiFi lib dose:
int WiFiClient::read(uint8_t* buf, size_t size) { // sizeof(size_t) is architecture dependent // but we need a 16 bit data type here uint16_t _size = size; if (!ServerDrv::getDataBuf(_sock, buf, &_size)) return -1; return 0; }
Thanks your suggestion overcame the issue in WiFiClient::read.
Had a similar issue with WiFiUDP::read and took a similar approach:
int WiFiUDP::read(unsigned char* buffer, size_t len)
{
if (available())
{
uint16_t size = 0; // <-- Changed from size_t
if (!ServerDrv::getDataBuf(_sock, buffer, &size))
return -1;
return size;
}else{
return -1;
}
}
Also had a compile problem with wifi_spi.h indicating uint8_t
, uint16_t
and uint32_t
did not name a type, so added #include <inttypes.h>
to fix that.
Now having compile issues with spi_drv.cpp:
....'SPCR' was not declared in this scope
....'MSTR' was not declared in this scope
....'_BV' was not declared in this scope
....'SPE' was not declared in this scope
....'SPDR' was not declared in this scope
....'SPSR' was not declared in this scope
....'SPIF' was not declared in this scope
But I'm having trouble tracking down where these are normally defined.
Hi,
You could just remove spi_drv.cpp and spi_drv.h. I think this should work.
Hi chunlinhan,
I tried removing spi_drv.cpp and spi_drv.h. That does allow it to compile without any errors, however adding #include <WifiRM04.h>
to a simple sketch then stops the Reset switch working. Further reading indicates that SPI on the Due is quite different to other Arduino boards, and any code using 8bit-AVR specific registers needs to be re-written to suit the corresponding 32bit SAM3X8E registers.
Thank you very much for your efforts though.
Hi @SoundConception
I have the same problem. Did you solve the problem?
Can you help me please. Thanks.
Getting conflicts when I try and include WiFiRM04 library using Arduino 1.6.4:
Will try going back to Arduino 1.6.3